10:01:05,759  INFO ContextLoader:273 - Root WebApplicationContext: initialization started
10:01:06,005  INFO XmlWebApplicationContext:495 - Refreshing Root WebApplicationContext: startup date [Wed Nov 14 10:01:06 CST 2012]; root of context hierarchy
10:01:06,205  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-common.xml]
10:01:06,481  WARN AnnotationAttributesReadingVisitor:91 - Failed to classload type while reading annotation metadata. This is a non-fatal error, but certain annotation metadata may be unavailable.
java.lang.ClassNotFoundException: Entity
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
at org.springframework.core.type.classreading.RecursiveAnnotationAttributesVisitor.visitEnd(AnnotationAttributesReadingVisitor.java:167)
at org.springframework.asm.ClassReader.a(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.asm.ClassReader.accept(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:54)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:237)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1419)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
10:01:06,513  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-user.xml]
10:01:06,535  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-user.xml]
10:01:06,546  INFO DefaultListableBeanFactory:623 - Overriding bean definition for bean 'usermanager': replacing [Generic bean: class [com.niit.service.imp.UserServiceImp]; scope=; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-user.xml]] with [Generic bean: class [com.niit.service.imp.UserServiceImp]; scope=; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-user.xml]]
10:01:06,547  INFO DefaultListableBeanFactory:623 - Overriding bean definition for bean 'userimp': replacing [Generic bean: class [com.niit.dao.imp.UserDaoImp]; scope=; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-user.xml]] with [Generic bean: class [com.niit.dao.imp.UserDaoImp]; scope=; abstract=false; lazyInit=false; autowireMode=1; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null; defined in file [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\WEB-INF\classes\spring\applicationContext-user.xml]]
10:01:06,836  INFO PropertyPlaceholderConfigurer:177 - Loading properties file from class path resource [config/mysql.properties]
10:01:06,874  INFO DefaultListableBeanFactory:557 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2437ef: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,dataSource,sqlSessionFactory,sqlSession,transactionManager,usermanager,userimp,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
10:01:06,974 DEBUG LogFactory:47 - Logging initialized using 'org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
10:01:07,810  INFO ContextLoader:302 - Root WebApplicationContext: initialization completed in 2048 ms
2012-11-14 10:01:07 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.util.Log4jConfigListener
java.lang.IllegalStateException: Web app root system property already set to different value: 'webapp.root' = [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST\] instead of [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
at org.springframework.web.util.WebUtils.setWebAppRootSystemProperty(WebUtils.java:148)
at org.springframework.web.util.Log4jWebConfigurer.initLogging(Log4jWebConfigurer.java:117)
at 

解决方案 »

  1.   

    Web app root system property already set to different value: 'webapp.root' = [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST\] instead of [D:\software\apache-tomcat-7.0.23\apache-tomcat-7.0.23\webapps\SSMTEST.myeclipse.bak\] - Choose unique values for the 'webAppRootKey' context-param in your web.xml files!
      

  2.   

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml     /ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- 配置spring配置文件加载的位置 -->
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    classpath*:spring/applicationContext-*.xml
    </param-value>
    </context-param> <!-- 加载spring的配置文件 -->
    <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>

      <listener>   
       <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>   
      </listener> 
    <filter>
    <filter-name>struts-cleanup</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.ActionContextCleanUp
    </filter-class>
    </filter>
    <filter>
    <filter-name>struts2.0</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>struts-cleanup</filter-name>
    <url-pattern>*.do</url-pattern>
    <url-pattern>*.htm</url-pattern>
    <url-pattern>*.action</url-pattern>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping> <filter-mapping>
    <filter-name>struts2.0</filter-name>
    <url-pattern>*.do</url-pattern>
    <url-pattern>*.htm</url-pattern>
    <url-pattern>*.action</url-pattern>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>

    <servlet>
    <servlet-name>RandImg</servlet-name>
    <servlet-class>com.web.PictureCheckCode</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>RandImg</servlet-name>
    <url-pattern>/RandImg</url-pattern>
    </servlet-mapping>


    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    </web-app>
      

  3.   

    上面就是web.xml文件 大家帮我看看 我自己也检查检查啊
      

  4.   

    Choose unique values for the 'webAppRootKey' context-param in your web.xml files!你的tomcat下是不是总署了多个应用,并配置相同的webAppRootKey?
    检查几个项目web.xml文件,看webAppRootKey结点下的value值是不是重复了.不要重复.
      

  5.   

    非常感谢  但是webAppRootKey 在哪里找?请指教
      

  6.   

    看一下你加载的tomcat的servlet-api这个jar包,看看有木有,然后看看版本对不对,然后可以删掉重新添加正确的版本,重新编译一下,重新启动看看!
      

  7.   

    谢谢大家 我以前用的是tomcat7.0 配置了两个项目 一个是ssh 一个是ssm 又配置了一个tomcat6.0 把ssm加到了tomcat6.0上  结果没有包异常了  原因可能是同一个tomcat下的两个项目的webrootkey重复了  零时的办法是用不同的tomcat 但是怎么处理webrootkey重复的问题?请指教
      

  8.   

    你可以在tomcat下写两个你配置的项目启动路径的xml文件。<?xml version='1.0' encoding='utf-8'?>
    <Context  crossContext="true"  reloadable="true" docBase="D:\xx\..\xx项目\WebContent" path="\xx项目名称"/>看看跑不跑的起来...