关于Spring + Compass + paoding 配置的一个注意点

compass.cfg.xml

<?xml version="1.0" encoding="UTF-8"?> <compass-core-config xmlns="http://www.compass-project.org/schema/core-config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.compass-project.org/schema/core-config http://www.compass-project.org/schema/compass-core-config-2.2.xsd"> <compass name="default"> <connection> <file path="C:/target" /> </connection> <searchEngine> <analyzer name="MyAnalyzer" type="CustomAnalyzer" analyzerClass="net.paoding.analysis.analyzer.PaodingAnalyzer"> </analyzer> </searchEngine> </compass> </compass-core-config>

applicationContext.xml

<bean id="compass" class="org.compass.spring.LocalCompassBean" p:configLocation="classpath:compass.cfg.xml" p:transactionManager-ref="transactionManager"> <property name="resourceLocations"> <list> <value>classpath:xxx/POJO.cmd.xml</value> <value>classpath:xxx/POJO.cpm.xml</value> </list> </property> <property name="compassSettings"> <props> <!-- <prop key="compass.engine.connection">C:/target</prop> <prop key="compass.engine.analyzer.default.type">net.paoding.analysis.analyzer.PaodingAnalyzer</prop> --> <prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop> </props> </property> </bean>

上面的注释部分其实和compass.cfg.xml文件效果是一样的。我们可以去掉p:configLocation属性以及compass.cfg.xml文件,打开上画的注释,运行的结果是一致的。

 

另外:参看资料

http://ybzshizds.javaeye.com/blog/309644

你可能感兴趣的:(spring,c,Class,Path,encoding)