贴子要沉了,难道没人用过compass吗???

解决方案 »

  1.   

    我的可以使   感觉还可以
    <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation=" http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
    default-lazy-init="true"> <!-- 使用compass注解 -->
    <bean id="annotationConfiguration" class="org.compass.annotations.config.CompassAnnotationsConfiguration"/> <bean id="compass" class="org.compass.spring.LocalCompassBean">
    <!-- 指定资源位置地点 -->
    <property name="resourceDirectoryLocations">
    <list>
    <value>classpath:com/jun/oa/beans</value>
    </list>
    </property>
    <!-- 指定映射类方式 -->
    <property name="classMappings">
    <list>
    <value>com.jun.oa.beans.AddressList</value>
    </list>
    </property>
    <property name="compassConfiguration"
    ref="annotationConfiguration" />
    <property name="compassSettings">
    <props>
    <prop key="compass.engine.connection">file://d:/index</prop>
    <prop key="compass.engine.highlighter.default.formatter.simple.pre"><![CDATA[<font color='red'>]]></prop>
    <prop key="compass.engine.highlighter.default.formatter.simple.post"><![CDATA[</font>]]></prop>
    <prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
    <!--
    <prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">net.paoding.analysis.analyzer.PaodingAnalyzer</prop>
    -->
    <prop key="compass.engine.analyzer.default.type">net.paoding.analysis.analyzer.PaodingAnalyzer</prop>
    </props>
    </property>
    <property name="transactionManager" ref="transactionManager" />
    </bean> <!-- hibernateGPS定位配置 -->
    <bean id="hibernateGpsDevice"
    class="org.compass.gps.device.hibernate.HibernateGpsDevice">
    <property name="name" value="hibernateDevice"/>
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="mirrorDataChanges" value="true"/>
    </bean>
    <!-- 同步更新索引 也就是当有数据添加删除修改的时候也同步到索引库里面 -->
    <bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps" init-method="start" destroy-method="stop">
    <property name="compass" ref="compass" />
    <property name="gpsDevices">
    <list>
    <bean
    class="org.compass.spring.device.SpringSyncTransactionGpsDeviceWrapper">
    <property name="gpsDevice" ref="hibernateGpsDevice" />
    </bean>
    </list>
    </property>
    </bean>

    <!-- 定时重建索引(利用quartz)或随Spring ApplicationContext启动而重建索引 -->
    <bean id="compassIndexBuilder"
    class="com.jun.oa.service.compass.CompassIndexBuilder"
    lazy-init="false">
    <property name="compassGps" ref="compassGps" />
    <property name="buildIndex" value="false" />
    <property name="lazyTime" value="10" />
    </bean>
    </beans>
      

  2.   

    楼主你好,我也是做ssh+compass集成的。 但是我现在发生了一个问题, 不知道楼主遇到过没。   异常是这样的。我往数据库里面登一条记录, 发生了个 don't flush the Session after an exception occurs 这段主要在hibernategps 这块的问题。