2009-4-3 12:06:53 org.apache.catalina.startup.HostConfig checkResources
信息: Reloading context [/compass2]
2009-4-3 12:06:53 org.apache.catalina.core.StandardContext stop
信息: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/compass2] has not been started
2009-4-3 12:06:53 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
2009-4-3 12:06:55 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compassIndexBuilder' defined in ServletContext resource [/WEB-INF/applicationContext-compass.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/compass/gps/CompassGps
Caused by: java.lang.NoClassDefFoundError: org/compass/gps/CompassGps
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at java.beans.Introspector$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)
at java.beans.Introspector.getTargetMethodInfo(Unknown Source)
at java.beans.Introspector.getBeanInfo(Unknown Source)
at java.beans.Introspector.getBeanInfo(Unknown Source)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:244)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:143)
at org.springframework.beans.BeanWrapperImpl.setIntrospectionClass(BeanWrapperImpl.java:236)
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:194)
at org.springframework.beans.BeanWrapperImpl.setWrappedInstance(BeanWrapperImpl.java:177)
at org.springframework.beans.BeanWrapperImpl.<init>(BeanWrapperImpl.java:130)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:753)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:245)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:188)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1105)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1307)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1571)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1580)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1560)
at java.lang.Thread.run(Unknown Source)
2009-4-3 12:06:55 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-4-3 12:06:55 org.apache.catalina.core.StandardContext start
严重: Context [/compass2] startup failed due to previous errors
2009-4-3 12:06:55 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext

解决方案 »

  1.   

    applicationContext-compass.xml 如下:<?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.0.xsd"
    default-lazy-init="true">
    <bean id="annotationConfiguration"
    class="org.compass.annotations.config.CompassAnnotationsConfiguration">
    </bean>
    <bean id="compass" class="org.compass.spring.LocalCompassBean">
    <property name="resourceDirectoryLocations">
    <list>
    <value>classpath:com/huahua</value>
    </list>
    </property>
    <property name="connection">
    <value>/lucene/indexes</value>
    </property>
    <property name="classMappings">
    <list>
    <value>com.huahua.pojo.Product</value>
    </list>
    </property>
    <property name="compassConfiguration"
    ref="annotationConfiguration" /> <property name="compassSettings">
    <props>
    <prop key="compass.transaction.factory">
    org.compass.spring.transaction.SpringSyncTransactionFactory
    </prop>
      <prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">net.paoding.analysis.analyzer.PaodingAnalyzer </prop>
    </props>
    </property> <property name="transactionManager" ref="transactionManager" />
    </bean>
    <bean id="hibernateGpsDevice"
    class="org.compass.gps.device.hibernate.HibernateGpsDevice">
    <property name="name">
    <value>hibernateDevice</value>
    </property>
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="mirrorDataChanges">
    <value>true</value>
    </property>
    </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>
    <bean id="compassTemplate"
    class="org.compass.core.CompassTemplate">
    <property name="compass" ref="compass" />
    </bean> <!-- 定时重建索引(利用quartz)或随Spring ApplicationContext启动而重建索引 -->
    <bean id="compassIndexBuilder"
    class="com.huahua.pojo.Implement.manager.CompassIndexBuilder"
    lazy-init="false">
    <property name="compassGps" ref="compassGps" />
    <property name="buildIndex" value="true" />
    <property name="lazyTime" value="10" />
    </bean></beans>
      

  2.   

    applicationContext-compass.xml 如下:<?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.0.xsd"
    default-lazy-init="true">
    <bean id="annotationConfiguration"
    class="org.compass.annotations.config.CompassAnnotationsConfiguration">
    </bean>
    <bean id="compass" class="org.compass.spring.LocalCompassBean">
    <property name="resourceDirectoryLocations">
    <list>
    <value>classpath:com/huahua</value>
    </list>
    </property>
    <property name="connection">
    <value>/lucene/indexes</value>
    </property>
    <property name="classMappings">
    <list>
    <value>com.huahua.pojo.Product</value>
    </list>
    </property>
    <property name="compassConfiguration"
    ref="annotationConfiguration" /> <property name="compassSettings">
    <props>
    <prop key="compass.transaction.factory">
    org.compass.spring.transaction.SpringSyncTransactionFactory
    </prop>
      <prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">net.paoding.analysis.analyzer.PaodingAnalyzer </prop>
    </props>
    </property> <property name="transactionManager" ref="transactionManager" />
    </bean>
    <bean id="hibernateGpsDevice"
    class="org.compass.gps.device.hibernate.HibernateGpsDevice">
    <property name="name">
    <value>hibernateDevice</value>
    </property>
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="mirrorDataChanges">
    <value>true</value>
    </property>
    </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>
    <bean id="compassTemplate"
    class="org.compass.core.CompassTemplate">
    <property name="compass" ref="compass" />
    </bean> <!-- 定时重建索引(利用quartz)或随Spring ApplicationContext启动而重建索引 -->
    <bean id="compassIndexBuilder"
    class="com.huahua.pojo.Implement.manager.CompassIndexBuilder"
    lazy-init="false">
    <property name="compassGps" ref="compassGps" />
    <property name="buildIndex" value="true" />
    <property name="lazyTime" value="10" />
    </bean></beans>
      

  3.   

    applicationContext-compass.xml 如下:
    <?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.0.xsd"
    default-lazy-init="true">
    <bean id="annotationConfiguration"
    class="org.compass.annotations.config.CompassAnnotationsConfiguration">
    </bean>
    <bean id="compass" class="org.compass.spring.LocalCompassBean">
    <property name="resourceDirectoryLocations">
    <list>
    <value>classpath:com/huahua</value>
    </list>
    </property>
    <property name="connection">
    <value>/lucene/indexes</value>
    </property>
    <property name="classMappings">
    <list>
    <value>com.huahua.pojo.Product</value>
    </list>
    </property>
    <property name="compassConfiguration"
    ref="annotationConfiguration" /> <property name="compassSettings">
    <props>
    <prop key="compass.transaction.factory">
    org.compass.spring.transaction.SpringSyncTransactionFactory
    </prop>
      <prop key="compass.engine.analyzer.MMAnalyzer.CustomAnalyzer">net.paoding.analysis.analyzer.PaodingAnalyzer </prop>
    </props>
    </property> <property name="transactionManager" ref="transactionManager" />
    </bean>
    <bean id="hibernateGpsDevice"
    class="org.compass.gps.device.hibernate.HibernateGpsDevice">
    <property name="name">
    <value>hibernateDevice</value>
    </property>
    <property name="sessionFactory" ref="sessionFactory" />
    <property name="mirrorDataChanges">
    <value>true</value>
    </property>
    </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>
    <bean id="compassTemplate"
    class="org.compass.core.CompassTemplate">
    <property name="compass" ref="compass" />
    </bean> <!-- 定时重建索引(利用quartz)或随Spring ApplicationContext启动而重建索引 -->
    <bean id="compassIndexBuilder"
    class="com.huahua.pojo.Implement.manager.CompassIndexBuilder"
    lazy-init="false">
    <property name="compassGps" ref="compassGps" />
    <property name="buildIndex" value="true" />
    <property name="lazyTime" value="10" />
    </bean>
    </beans>
      

  4.   

    错误在 Caused by: java.lang.NoClassDefFoundError: org/compass/gps/CompassGps 
    缺少了 一个.JAR包 我也不知道是那个包 自己找找看 在者两个包找找看jarcompass-x/modules/core/compass-core-x.jar, compass/modules/core/lib/commons-logging-x.jar, 
      

  5.   

    严重: Exception sending context initialized event to listener instance of class
    好好的看下这句话!一般抛出的异常要自己独立去解决!因为别人不知道你的工程模块和部署是什么,大体不了解,有了错误也不好解释的!