我正在开发一个自定义文档过滤器。到目前为止,我已经在 eclipse 中创建了一个项目,添加了必要的 jar 文件,并使用我自己的文档过滤器成功构建了一个 jar 文件。
让连接器找到课程我缺少什么步骤?
在文件中配置文档过滤器时'connectorInstance.xml'
出现问题,似乎在类路径中找不到 jar 文件......
Java 包具有以下类路径:
com.google.enterprise.connector.util.filter.DocFilterWildCardSearch
或者也尝试了以下路径
com.kapsch.gsa.filter.DocFilterWildCardSearch
我将文件复制'DocFilterWildCardSearch.jar'
到以下路径:
C:\Program Files\GoogleConnectors\GSAConnectors1\Tomcat\webapps\connector-manager\WEB-INF\lib
重新启动连接器并收到以下错误消息:
Nov 20, 2013 4:50:29 PM [Init] com.google.enterprise.connector.servlet.StartUp doStartup
SEVERE: Connector Manager Startup failed:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DocumentFilters' defined in ServletContext resource [/WEB-INF/documentFilters.xml]: Cannot create inner bean 'asfsdf' of type [com.kapsch.gsa.filter.DocFilterWildCardSearch] while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.kapsch.gsa.filter.DocFilterWildCardSearch] for bean with name 'asfsdf' defined in ServletContext resource [/WEB-INF/documentFilters.xml]; nested exception is java.lang.ClassNotFoundException: com.kapsch.gsa.filter.DocFilterWildCardSearch
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
文档过滤器的配置文件:connectorInstance.xml
<?xml version="1.0"?>
<beans>
<bean class="com.example.connector.HelloWorldConnector" id="helloworld-connector"> </bean>
<bean class="com.google.enterprise.connector.util.filter.DocumentFilterChain" id="DocumentFilters">
<constructor-arg>
<list>
<bean class="com.kapsch.gsa.filter.DocFilterWildCardSearch" id="asfsdf">
<property value="Author" name="propertyName"/>
<property value="Roli" name="propertyValue"/>
<property value="false" name="overwrite"/>
</bean>
</list>
</constructor-arg>
</bean>
</beans>