JAVA开发jar lib包,Spring配置文件如何处理?
项目开发一个Jar lib依赖包,其中使用了spring容器技术,就有application.xml bean配置文件。问题是如果其它工程
引用这个jar包,而这个主工程也用了spring容器,也有xml bean配置文件。这种如何处理?
一般开发jar lib包时,用spring容器技术是如何设计给上层应用使用?

5个回答

第一个问题,你可以通过配置ContextLoaderListener的监听文件路径,将两个项目的xml都注册到一个spring容器中,例如在web.xml中配置:

    <!-- spring配置文件路径 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>
             <!--加入Spring配置文件-->
            classpath:config/applicationContext.xml
            <!-- /WEB-INF/classes/applicationContext.xml,/WEB-INF/classes/spring-srevlet.xml -->
        </param-value>
    </context-param>

    <!-- Spring监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

第二个问题,原则上开发第三方时,不应该直接使用spring容器(但可以依赖spring的jar),而是提供spring集成支持,容器一般在运行时才集成。这个东西我也不好用语言表达,举个简单例子,比如jedis是不依赖任何spring功能,但是spring-data-redis就能将jedis无缝集成到spring容器中。

java 的lib 包中 不要使用 配置文件中的配置,如果必须要使用的话,要在调用 lib 的工程中配置 lib 中需要的配置。

如果是一个项目就spring配置一遍,所有子模块共用一个。
如果是2个项目,就分别配置啊,夸项目,jar包一般配置多次,每个项目的jar包放到当前项目中使用

最好jar包不要用application.xml直接命名,或者放到根目录以外的文件夹如:resources/XXX/application.xml

1) 利用了Spring ApplicationContext 的 registerBeanDefinition方法和动态bean注册技术;
2) 作为bean管理的一个规范:要求Service类实现 setDAO(DAO dao)方法,以便统一注入dao实例;
3) 作为bean管理的一个规范:调用 dao.setDatasource(datasource)方法进行数据源注入;
4) 作为bean管理的一个规范:内部使用className作为 service bean 和dao bean的内部id;
5) 作为bean管理的一个规范:ServiceFactory内获取bean实例时,都采用prototype scope。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
关于打包成Jar包后找不到spring配置文件的问题

如题,最近试着用gradle建java项目,在打包成jar包后,却一直找不到spring配置文件。 请大神们指点一下。我自己一个人捣豉了两天还是没找出原因来。 以下是项目的结构: ![项目的结构](https://img-ask.csdn.net/upload/201603/23/1458705708_896430.png) 以下是打包后的目录: ![jar包目录](https://img-ask.csdn.net/upload/201603/23/1458705774_118719.png)

Spring boot打成jar包,依赖的config及lib文件外置,项目无法启动

最终想达到的效果: 将项目打成jar包,并且依赖的其他jar包以及配置文件外置 问题描述: 在开发工具中,运行项目正常启动,打成jar包之后运行产生bean无法注入的错误,详细见infromation.log。 其中:加上spring-boot-maven-plugin插件打成jar包,运行没有问题,不过却包含了两份依赖的jar包,内外各一份。对应的dao也加上了@Repository注解 ``` Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.hhly.information.dao.InformationMapper com.hhly.information.sevice.impl.InformationServiceImpl.informationDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.hhly.information.dao.InformationMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:573) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] ... 43 common frames omitted Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.hhly.information.dao.InformationMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoSuchBeanDefinitionException(DefaultListableBeanFactory.java:1373) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1119) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1014) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:545) ~[spring-beans-4.2.6.RELEASE.jar:4.2.6.RELEASE] ... 45 common frames omitted ``` 环境: Spring boot版本:1.3.5.RELEASE Java 版本:1.7 开发工具:Eclipse neon pom.xml配置: ``` <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <!-- <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <maimClass>com.hhly.information.InformationApplication</maimClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <!-- 添加index则不从mainfest中读取classpath,而是从Index.list中读取 --> <!-- <index>true</index> --> <manifest> <mainClass>com.hhly.information.InformationApplication</mainClass> <!-- to create a class path to your dependecies you have to fill true in this field --> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> <!--<classpathLayoutType>custom</classpathLayoutType> <customClasspathLayout> lib/$${artifact.groupId}.$${artifact.artifactId}.$${artifact.extension} </customClasspathLayout> --> </manifest> <manifestEntries> <Class-Path>./</Class-Path> </manifestEntries> </archive> <excludes> <exclude>config/**</exclude> </excludes> </configuration> </plugin> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <!-- not append assembly id in release file name --> <appendAssemblyId>false</appendAssemblyId> <descriptors> <descriptor>src/main/build/package.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins> </build> ```

请问Spring如何在jar文件里面按文件夹加载配置文件?

一个Web应用有多个模块(假设有org和auth两个模块), 我希望为每个模块创建一个项目, 在项目中维护模块用到的配置文件. 然后将这些模块分别打包成jar放到web应用的WEB-INF/lib下. 现在用单元测试, 在Web应用中运行单元测试, 如果在Web应用的Build Path/Project中添加模块项目, 单元测试能够成功, 如果使用Build Path/Libraries添加模块jar文件, 运行单元测试失败. Spring中加载配置文件代码如下: [code="xml"] <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="mappingDirectoryLocations"> <list> <value>classpath*:/config/hibernate/app/</value> <value>classpath*:/config/hibernate/framework/</value> </list> </property> ... </bean> [/code] 每个jar包里面都有/config/hibernate/framework文件夹 错误信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'menuService' defined in URL [jar:file:/E:/home/workspaces/eclipse/simple-web/WebContent/WEB-INF/lib/auth.jar!/config/spring/app/services.xml]: Cannot resolve reference to bean 'defaultMediator' while setting bean property 'defautMediator'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultMediator' defined in class path resource [config/env/base-dao.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [config/persistence/hibernate.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: URL [jar:file:/E:/home/workspaces/eclipse/simple-web/WebContent/WEB-INF/lib/auth.jar!/config/hibernate/framework/] cannot be resolved to absolute file path because it does not reside in the file system: jar:file:/E:/home/workspaces/eclipse/simple-web/WebContent/WEB-INF/lib/auth.jar!/config/hibernate/framework/ 网上找到一个相关的讨论: http://forum.springframework.org/archive/index.php/t-10029.html 好像是说对于directory的加载必须是文件夹必须存在于文件系统中, jar下面的文件夹找不到.不知道这个问题有没有办法解决? 谢谢先! ps. 第一次提问, 如果有不当之处请各位包涵 [b]问题补充:[/b] 感谢czlonly的回答, 不过能不能写详细一点? 我刚才试了一下, 如果把配置文件改成 [code="xml"] <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="mappingLocations"> <list> <value>classpath*:/config/hibernate/framework/*.xml</value> </list> </property> ... </bean> [/code] 果然可以了

gradle项目引入jar包时,将jar包的依赖包也引入

我有一个gradle构建的springboot项目,这个项目依赖了很多第三方的包。现在我要将这个项目打为JAR包,但是我不想将依赖包打入jar包中。当别人引用我的jar包时,需要将jar依赖的包一起导入。请问这个怎么实现?我知道可以将jar包上传到仓库中,然后在pom中配置好依赖信息,使用maven构建的项目导入这个jar包就可以实现将依赖包一同导入,但是使用gradle构建的项目导入时,并没有将依赖的包一起导入。

Intellij idea 启动mavaen没有编译jar包

由于刚开始用这个开发工具真玩不明白,后来用eclipse Tomcat 启动也是同样的,lib下都没有包 在网上找了很久都没有答案! 这个eclipse 用tomcat 启动 eclipse用jetty启动可以 [![图片说明](https://img-ask.csdn.net/upload/201708/04/1501776211_865882.png)图片说明](https://img-ask.csdn.net/u pload/201708/04/1501776199_774992.png) 下面是用intellij idea 17 使用jetty 和tomcat 都启动不了 ![图片说明](https://img-ask.csdn.net/upload/201708/04/1501776510_838409.png) ![ 图片说明](https://img-ask.csdn.net/upload/201708/04/1501776538_88491.png) ![图片说明](https://img-ask.csdn.net/upload/201708/04/1501776554_98247.png) 不明白怎么没有把jar包编译到lib文件下

项目打的jar包,在linux中启动,卡在一半.不运行下去了.

我的Spring boot 项目.打了一个jar包.然后在linux中启动.然后有几句提示之后就卡住不动了.服务器是1核,2G的配置. 服务器的运行代码是这个.然后就卡住了. ``` [root@VM_0_2_centos demo]# sh restart.sh [root@VM_0_2_centos demo]# SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/demo/app/demo.jar!/BOOT-INF/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/home/demo/app/demo.jar!/BOOT-INF/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] ``` restart.sh的代码是这个. ``` #!/bin/sh base_home='/home/demo' app_name='demo' pid=`ps -ef|grep ${app_name}|grep -v grep|grep -v restart|awk '{print$2}'` if [ -n "${pid}" ] ;then kill -9 ${pid} sleep 10 fi gclog_file=$base_home/log/gc.log dump_dir=$base_home/heapdump errorlogs_dir=$base_home/log java -Xmx1g -jar $base_home/app/${app_name}.jar --spring.config.location=$base_home/config/application.yml >> $base_home/log/${app_name}_$(date +'%Y%m%d').log & ```

急!在线等。使用maven把项目打成war包,java文件没有被包含进去!!!!

希望大牛能帮我解答一下疑惑,小弟感激不尽。 项目介绍:自己搭的Spring Spring MVC MyBatis JavaWeb项目,JDK:1.8. 今天用maven打包项目,莫名其妙的java文件就打包不进去了, 没有修改过pom.xml文件,执行mvn clean install / mvn package / mvn compile 都打包成功,不报错,但是就是没有包含进java文件 ----------- [INFO] Total time: 4.518 s [INFO] Finished at: 2018-10-16T15:04:22+08:00 [INFO] Final Memory: 13M/309M [INFO] ------------------------------------------------------------------------ F:\luzongzhu\personal\zjjsfood\leron> 下图是项目的文件层级图 ![图片说明](https://img-ask.csdn.net/upload/201810/16/1539673597_465891.png) 再贴一下我的pom.xml文件 ``` <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <name>leron</name> <groupId>leron</groupId> <artifactId>leron</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>3.1.1.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>3.1.1.RELEASE</version> </dependency> <!-- springframe end --> <!-- https://mvnrepository.com/artifact/javax.persistence/persistence-api --> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0</version> </dependency> <!--引入pageHelper分页插件 --> <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>5.0.0</version> </dependency> <!-- 返回json字符串的支持 --> <!-- mybatis核心包 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.3.1</version> </dependency> <!-- mybatis/spring包 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.2.2</version> </dependency> <!-- mysql驱动包 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.29</version> </dependency> <!-- junit测试包 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> <!-- jstl --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>javax.servlet.jsp</groupId> <artifactId>jsp-api</artifactId> <version>2.2.1-b03</version> <scope>provided</scope> </dependency> <!-- 通用Mapper --> <dependency> <groupId>com.github.abel533</groupId> <artifactId>mapper</artifactId> <version>2.3.4</version> </dependency> <!-- servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> <!-- json数据 --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.8.5</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.5</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.8.5</version> </dependency> <dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-mapper-asl</artifactId> <version>1.9.4</version> </dependency> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>2.4</version> <classifier>jdk15</classifier> </dependency> <!-- commons --> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>commons-pool</groupId> <artifactId>commons-pool</artifactId> <version>1.5.6</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.8.3</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.9</version> </dependency> <!-- https://mvnrepository.com/artifact/commons-io/commons-io --> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.4</version> </dependency> <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>javax.annotation</groupId> <artifactId>jsr250-api</artifactId> <version>1.0</version> </dependency> <dependency> <groupId>net.sf.ezmorph</groupId> <artifactId>ezmorph</artifactId> <version>1.0.6</version> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <!-- 日志文件管理包 --> <!-- log start --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.7.21</version> </dependency> <!-- freemarker begin --> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.21</version> </dependency> <!-- freemarker end --> <!-- https://mvnrepository.com/artifact/com.sun.mail/javax.mail --> <dependency> <groupId>com.sun.mail</groupId> <artifactId>javax.mail</artifactId> <version>1.5.6</version> </dependency> </dependencies> <!-- 插件配置 --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <warName>leron</warName> <webResources> <resource> <directory>${basedir}/src/main/resources/lib</directory> <targetPath>WEB-INF/lib</targetPath> <filtering>false</filtering> <includes> <include>**/*.jar</include> </includes> </resource> </webResources> </configuration> </plugin> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>utf8</encoding> </configuration> </plugin> </plugins> </build> </project> ```

maven依赖项目打jar包问题

eclipse中有2个maven项目(都不是web项目)。A项目依赖B项目(A就是控制层,B就是service和DAO)A的pom.xml文件里<dependency><groupId>com.B</groupId<artifactId>B</artifactId></dependency>,A项目配了一些application.xml;在B中配置了一些beans.xml;将B项目maven install到本地仓库,A项目直接引用B的jar包。在eclipse里运行A一切正常。但将A打jar包后。一直报错。 org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'comDict' defined in URL [jar:file:/E:/game/A_lib/B.jar!/config/beans.xml] A项目打成jar包{ A的配置文件,A_lib(存放A所有依赖的jar包的文件夹),A.jar} 以上3块放在同一个文件夹下面。运行java -jar A.jar。就会报上面的错。comDict是配置在beans.xml里面的一个bean。jar:file:/E:/game/A_lib/B.jar!/config/beans.xml]这个B.jar后面带个感叹号。eclipse里运行A正常。打jar包运行就错。

maven dependencies 里面的jar包如何直接在项目中使用

我通过pom.xml文件网项目的maven仓库中导入了很多jar包,但是项目进行编译时总是提醒找不到jar包,并且一定要将本地仓库的jar包复制到WEB_INF /lib目录下才能正常使用,请问是什么原因呢?如何配置才能直接使用maven dependencies下的jar包呢?

哪位大神帮我解决一下eclipse运行突然报404,好像是spring配置文件有问题

七月 28, 2019 2:17:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:xuexiao' did not find a matching property. 七月 28, 2019 2:17:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MyHRSht' did not find a matching property. 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.5.34 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Sep 4 2018 22:28:22 UTC 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.5.34.0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 10.0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jre1.8.0_201 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_201-b09 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: E:\apache-tomcat-8.5.34-myeclipse 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=E:\apache-tomcat-8.5.34-myeclipse 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=E:\apache-tomcat-8.5.34-myeclipse\endorsed 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=UTF-8 七月 28, 2019 2:17:54 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_201/bin/server;C:/Program Files/Java/jre1.8.0_201/bin;C:/Program Files/Java/jre1.8.0_201/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_201\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\申红涛\AppData\Local\Microsoft\WindowsApps;;E:\eclipse;;.] 七月 28, 2019 2:17:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8083"] 七月 28, 2019 2:17:56 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 28, 2019 2:17:57 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8039"] 七月 28, 2019 2:17:57 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 28, 2019 2:17:57 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2984 ms 七月 28, 2019 2:17:57 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 七月 28, 2019 2:17:57 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.5.34 七月 28, 2019 2:18:15 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 七月 28, 2019 2:18:15 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 28, 2019 2:18:15 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 七月 28, 2019 2:20:49 下午 org.apache.ibatis.mapping.VendorDatabaseIdProvider getDatabaseId 严重: Could not get a databaseId from dataSource java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:395) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) 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:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 29 more 七月 28, 2019 2:20:50 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springmvc' 七月 28, 2019 2:21:10 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 七月 28, 2019 2:21:10 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 28, 2019 2:21:10 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2019-07-28 14:21:13 Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xuexiao\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) 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:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ... 20 more Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:135) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:434) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:406) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:163) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470) ... 26 more 七月 28, 2019 2:21:13 下午 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 'sqlSessionFactory' defined in file [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xuexiao\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) 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:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ... 20 more Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:135) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:434) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:406) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:163) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470) ... 26 more 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/xuexiao] startup failed due to previous errors 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 七月 28, 2019 2:21:14 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks 严重: The web application [xuexiao] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5c5c779c]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 七月 28, 2019 2:21:14 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks 严重: The web application [xuexiao] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5c353122]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 七月 28, 2019 2:21:14 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8083"] 七月 28, 2019 2:21:14 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8039"] 七月 28, 2019 2:21:14 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 197051 ms web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>SpringMybatisOa</display-name> <!-- dwr --> <servlet> <servlet-name>dwr_invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr_invoker</servlet-name> <url-pattern>/dwre/*</url-pattern> </servlet-mapping> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springconfig/*</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>*.action</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> spring.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:jdbc.properties"></property> </bean> <bean id="ds" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${driverClass}" /> <property name="jdbcUrl" value="${url}" /> <property name="user" value="${userName}" /> <property name="password" value="${passWord}" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="ds" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="ds" /> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="dao/*.xml"></property> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <property name="basePackage" value="dao" /> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> <context:component-scan base-package="biz.impl"/> </beans> springmvc.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <mvc:annotation-driven/><!-- 启动注解方式的mvc --> <context:component-scan base-package="action"/><!-- 扫描该包下所有类加载到容器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/"/> <property name="suffix" value=".jsp"/> </bean> </beans>

springboot 多模块打包war,tomcat启动提示找不到配置文件

新项目使用springboot maven module方式新建了多个子模块,(多个)web,service,dao,entity,util、storage。其中web依赖entity、service、util、storage。 uitl模块中有个ConfigUtil.java @Component @ConfigurationProperties @PropertySource(value = "classpath:config.properties",encoding = "utf-8") public class ConfigUtil { ...... } 其中config.properties文件放在util模块的resources文件夹下。 在将其中一个web项目打包成war时,在tomcat中启动时提示找不到config.properties ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579522003_255875.png) 下面是uitl模块的pom文件 ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.zjyc.dsy</groupId> <artifactId>dsy-al</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <name>dsy-util</name> <packaging>jar</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>artemis</groupId> <artifactId>artemis-lib</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/jar/artemis-http-client-1.0-SNAPSHOT.jar</systemPath> </dependency> </dependencies> <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> </includes> <!-- resource的filtering属性用来表示资源文件中的占位符是否需要被替换,true为需要替换。 --> <filtering>false</filtering> </resource> <resource> <directory>src/main/resources</directory> <includes> <include>**/*</include> </includes> <filtering>false</filtering> </resource> </resources> </build> </project> ``` 下面是web模块的pom ``` <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <parent> <groupId>com.zjyc.dsy</groupId> <artifactId>dsy-al</artifactId> <version>0.0.1-SNAPSHOT</version> <relativePath>../pom.xml</relativePath> </parent> <groupId>com.zjyc.dsy.web</groupId> <artifactId>dsy-web</artifactId> <name>dsy-web</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>com.zjyc.dsy.entity</groupId> <artifactId>dsy-entity</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.service</groupId> <artifactId>dsy-service</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>com.zjyc.dsy.storage</groupId> <artifactId>dsy-storage</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <!-- 引入java编译器插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> <compilerVersion>1.8</compilerVersion> <encoding>UTF-8</encoding> </configuration> </plugin> <!-- 资源文件拷贝插件 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>unpack</id> <phase>generate-resources</phase> <goals> <goal>unpack</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>com.zjyc.dsy.util</groupId> <artifactId>dsy-util</artifactId> <version>0.0.1-SNAPSHOT</version> <type>jar</type> <overWrite>true</overWrite> <outputDirectory>${project.build.directory}/classes</outputDirectory> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> <pluginManagement> <plugins> <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--> <plugin> <groupId>org.eclipse.m2e</groupId> <artifactId>lifecycle-mapping</artifactId> <version>1.0.0</version> <configuration> <lifecycleMappingMetadata> <pluginExecutions> <pluginExecution> <pluginExecutionFilter> <groupId> org.apache.maven.plugins </groupId> <artifactId> maven-dependency-plugin </artifactId> <versionRange> [2.1,) </versionRange> <goals> <goal>unpack</goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <excludes> <exclude>**/*.properties</exclude> </excludes> </resource> </resources> </build> </project> ``` 下面是war解压之后classes的目录结构 ![图片说明](https://img-ask.csdn.net/upload/202001/20/1579522257_42080.png) tomcat启动报错代码 ``` 20-Jan-2020 19:55:46.409 警告 [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '500' did not find a matching property. 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.6 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Mar 5 2018 09:34:35 UTC 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.6.0 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows Server 2008 R2 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 6.1 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: C:\Program Files\Java\jdk1.8.0_161\jre 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_161-b12 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: E:\apache-tomcat-9 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: E:\apache-tomcat-9 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=E:\apache-tomcat-9\conf\logging.properties 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 20-Jan-2020 19:55:46.534 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=E:\apache-tomcat-9 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=E:\apache-tomcat-9 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=E:\apache-tomcat-9\temp 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3]. 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 20-Jan-2020 19:55:46.550 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 20-Jan-2020 19:55:47.440 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.0.2m 2 Nov 2017] 20-Jan-2020 19:55:47.565 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"] 20-Jan-2020 19:55:47.612 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Jan-2020 19:55:47.628 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-7778"] 20-Jan-2020 19:55:47.628 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read 20-Jan-2020 19:55:47.628 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1553 ms 20-Jan-2020 19:55:47.659 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 20-Jan-2020 19:55:47.659 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.6 20-Jan-2020 19:55:47.675 信息 [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] 20-Jan-2020 19:55:50.815 信息 [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 20-Jan-2020 19:55:52.456 严重 [main] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dsy-web-0.0.1-SNAPSHOT]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:742) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493) Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.zjyc.dsy.web.App]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/config.properties] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:325) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:242) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132) at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5030) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) ... 38 more Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/config.properties] at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:159) at org.springframework.core.io.support.EncodedResource.getReader(EncodedResource.java:143) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:95) at org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:73) at org.springframework.core.io.support.PropertiesLoaderUtils.loadProperties(PropertiesLoaderUtils.java:59) at org.springframework.core.io.support.ResourcePropertySource.<init>(ResourcePropertySource.java:67) at org.springframework.core.io.support.DefaultPropertySourceFactory.createPropertySource(DefaultPropertySourceFactory.java:37) at org.springframework.context.annotation.ConfigurationClassParser.processPropertySource(ConfigurationClassParser.java:455) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:274) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:194) at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:298) at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:202) at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:170) ... 54 more 20-Jan-2020 19:55:52.471 严重 [main] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/dsy-web-0.0.1-SNAPSHOT]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:746) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:718) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:987) at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:772) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:426) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1586) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123) at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:966) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1427) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1417) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75) at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:943) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.startup.Catalina.start(Catalina.java:682) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493) 20-Jan-2020 19:55:52.487 信息 [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [E:\apache-tomcat-9\webapps\dsy-web-0.0.1-SNAPSHOT.war] has finished in [4,812] ms 20-Jan-2020 19:55:52.487 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-80"] 20-Jan-2020 19:55:52.503 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-7778"] 20-Jan-2020 19:55:52.518 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 4881 ms ```

maven打包的时候怎么能把子项目的resouce资源打包进去?

能不能把依赖的子项目工程中的配置文件打入到 父级项目中???

Maven集成时依赖jar包版本控制问题

我有一个WEB工程需要用到commons-collections和commons-dbcp. 代码中用到的是commons-collections的3.1版本特性,但是资源库中commons-dbcp依赖的 commons-collections指定了2.1版本。看了下commons-dbcp-1.2.1.pom: <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>2.1</version> </dependency> 当我将web工程打包时,maven会将commons-collections-3.1.jar 和commons-collections-2.1.jar都拷贝进WAR包。 如何只让maven只将 commons-collections-3.1.jar拷贝到war包中去? [b]问题补充:[/b] 谢谢,jansel的答复,方案1是可以行的,但是觉得maven应该有其它解决方案,所以发贴出来咨询一下。方案2我试过了,在我自己的工程pom.xml文件中指定了 高版本的common-collections,但是maven做package的时候依赖会将两个版本的common-collections库都打进WEB-INF/lib,我的maven版本是2.0.9. [b]问题补充:[/b] E:\NGWORK\javaprj\webapp>mvn dependency:tree -Dverbose -Dincludes=commons-collections E:\NGWORK\javaprj\webapp>set MAVEN_OPTS=-Xms64m -Xmx512m [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'dependency'. [INFO] ------------------------------------------------------------------------ [INFO] Building Unnamed - asiainfo.cboss:cboss:war:SNAPSHOT [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ Downloading: http://repo1.maven.org/maven2/asiainfo/cas/aicasclient/1.0/aicasclient-1.0.pom Downloading: http://repo1.maven.org/maven2/cmcc/twcmcc/1.4/twcmcc-1.4.pom Downloading: http://repo1.maven.org/maven2/castor/castor-xml/1.0/castor-xml-1.0.pom Downloading: http://repo1.maven.org/maven2/asiainfo/openboss/openclient/2.0/openclient-2.0.pom Downloading: http://repo1.maven.org/maven2/xstream/xstream/1.3/xstream-1.3.pom Downloading: http://repo1.maven.org/maven2/jdk/tools/1.4.2/tools-1.4.2.pom Downloading: http://repo1.maven.org/maven2/servlet/servlet/2.3/servlet-2.3.pom Downloading: http://repo1.maven.org/maven2/asiainfo/cboss/portalExternal/1.8/portalExternal-1.8.pom Downloading: http://repo1.maven.org/maven2/asiainfo/openbuff/EzfrmWeb/1.0/EzfrmWeb-1.0.pom Downloading: http://repo1.maven.org/maven2/asiainfo/openbuff/EzfrmBiz/1.0/EzfrmBiz-1.0.pom Downloading: http://repo1.maven.org/maven2/net/sf/jasperreports/2.0.3/jasperreports-2.0.3.pom Downloading: http://repo1.maven.org/maven2/lowagie/itext/1.3.1/itext-1.3.1.pom Downloading: http://repo1.maven.org/maven2/lowagie/itext-asian/1.0/itext-asian-1.0.pom Downloading: http://repo1.maven.org/maven2/net/sf/json/2.2.1/json-2.2.1.pom Downloading: http://repo1.maven.org/maven2/net/sf/ezmorph/1.0.4/ezmorph-1.0.4.pom Downloading: http://repo1.maven.org/maven2/edu/concurrent/1.0/concurrent-1.0.pom Downloading: http://repo1.maven.org/maven2/asiainfo/ny/nysecurity/1.0/nysecurity-1.0.pom Downloading: http://repo1.maven.org/maven2/cmcc/trustwork/1.4/trustwork-1.4.pom Downloading: http://repo1.maven.org/maven2/cmcc/pwdSvr/1.4/pwdSvr-1.4.pom Downloading: http://repo1.maven.org/maven2/poi/poi/2.5.1-FINAL/poi-2.5.1-FINAL.pom [INFO] [dependency:tree] [INFO] asiainfo.cboss:cboss:war:SNAPSHOT [INFO] +- asiainfo.cboss:cboss-common:jar:SNAPSHOT:compile [INFO] | \- org.apache.velocity:velocity:jar:1.5:compile [INFO] | \- (commons-collections:commons-collections:jar:3.1:compile - omitted for conflict with 2.1) [INFO] +- commons-collections:commons-collections:jar:3.1:runtime (scope not updated to compile) [INFO] +- commons-dbcp:commons-dbcp:jar:1.2.1:compile [INFO] | \- (commons-collections:commons-collections:jar:2.1:compile - omitted for conflict with 3.1) [INFO] +- commons-beanutils:commons-beanutils:jar:1.6:compile [INFO] | \- (commons-collections:commons-collections:jar:2.0:compile - omitted for conflict with 3.1) [INFO] \- commons-pool:commons-pool:jar:1.2:compile [INFO] \- (commons-collections:commons-collections:jar:2.1:compile - omitted for conflict with 3.1) [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 33 seconds [INFO] Finished at: Wed Sep 09 13:18:59 CST 2009 [INFO] Final Memory: 13M/63M [b]问题补充:[/b] 的确是按最短路径实现的,我在自己的pom.xml中指定了使用版本,maven就是使用这个版本的。 上午是因为忘记做clean了,所以原来已经拷贝到WEB-INF/lib目录的库没有被清理这样commons-collections-2.1.jar还是会存在, 让我误认为不能生效。

一个简单spring2.5的例子,无论如何找不到配置文件

1.test类如下 [code="java"]public class SpringTest { public static void main(String[] args) { ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); SimpleMan dao = (SimpleMan) ctx.getBean("simpleMan"); System.out.println(dao.hello()); } } [/code] 2.beans.xml代码如下 [code="java"]<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <context:annotation-config/> <context:component-scan base-package="org.example"/> </beans>[/code] 3.test类和beans.xml配置文件都在包org.example下 4.spring2.5的架包从官网上下载的,都拷贝在了WEB-INF的lib目录下 5.两种情况 第一种:lib只引入spring.jar包 第二种:lib引入了dist/modules下的包,共14个 6.无论哪种情况都出现了如下错误: [code="java"]Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:146) at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:84) at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:59) at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:58) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at org.example.SpringTest.main(SpringTest.java:10) [/code] 何解呢?谢谢大家了。。 [b]问题补充:[/b] 将commons-logging.jar包拷贝到lib目录下依然找不到beans.xml 现在有个方法能解决了: 1.将ClassPathXmlApplicationContext换成FileSystemXmlApplicationContext 2.将beans.xml拷贝到根目录下,即WebContent目录下 现在不报错了 什么原因,唉,我也不明白

maven管理spring项目,依赖包已经加载,但是在类中无法使用spring的注解

![图片说明](https://img-ask.csdn.net/upload/201705/31/1496200559_982800.png)![图片说明](https://img-ask.csdn.net/upload/201705/31/1496200587_956745.png) @Service无法使用,不能将包导入,请问谁清楚,麻烦解答一下

idea导入maven项目,将pom.xml更新,但是看不到jar包

之前我以为看不到jar包是因为我仓库有报错,所以我又将本地仓库全部删除, 然后有更新了下pom,看到仓库的jar在一个个下载,没想到下载完之后idea还是 报错,![图片说明](https://img-ask.csdn.net/upload/201905/27/1558966525_575796.png) ,而且在idea项目还是看不到jar

SpringBoot打包后无法读取到resources下的资源

项目调试运行没有什么问题,在maven package后就无法读取到resources下的资源了 项目中有两个外部jar包,放在resources的lib下,在pom中引用如下 ```java <dependency> <groupId>com.tossft</groupId> <artifactId>sssk</artifactId> <version>0.0.1-SNAPSHOT</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/lib/sssk.jar</systemPath> </dependency> ``` ```java <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource> <!-- 原路径 --> <directory>src/main/resources/lib</directory> <targetPath>WEB-INF/lib/</targetPath> <includes> <include>**/*.jar</include> </includes> </resource> </webResources> </configuration> </plugin> ``` 这个jar需要读取resources下config文件夹下的xxx.xml配置文件, 在IDE中调试运行是没有问题的,maven package再运行就报错,找不到这个xml了

请问:在SSM框架中,引入了oracle的jar包 ,依赖是添加成功了的,但是使用时报异常

请问:在SSM框架中,引入了oracle的jar包 ,依赖是添加成功了的,但是使用mybatis-generator:generate时报异常 这是报错代码 [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building ssm Maven Webapp 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- mybatis-generator-maven-plugin:1.3.0:generate (default-cli) @ ssm --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.562 s [INFO] Finished at: 2017-09-08T09:46:14+08:00 java.lang.RuntimeException: Exception getting JDBC Driver at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:84) at org.mybatis.generator.internal.db.ConnectionFactory.getConnection(ConnectionFactory.java:53) at org.mybatis.generator.config.Context.getConnection(Context.java:487) at org.mybatis.generator.config.Context.introspectTables(Context.java:396) at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222) at org.mybatis.generator.maven.MyBatisGeneratorMojo.execute(MyBatisGeneratorMojo.java:184) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: java.lang.**_ClassNotFoundException: oracle.jdbc.driver.OracleDriver_** at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at org.mybatis.generator.internal.ObjectFactory.externalClassForName(ObjectFactory.java:89) at org.mybatis.generator.internal.db.ConnectionFactory.getDriver(ConnectionFactory.java:81) ... 27 more [INFO] Final Memory: 9M/77M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:1.3.0:generate (default-cli) on project ssm: Exception getting JDBC Driver -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException 这是pom文件配置 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.chinasofti.ssmdemo</groupId> <artifactId>ssm</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>ssm Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <aspectj.version>1.8.9</aspectj.version> <jackson.version>1.9.13</jackson.version> <spring.version>4.3.4.RELEASE</spring.version> </properties> <dependencies> <!-- mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.1.0 -Dpackaging=jar -Dfile=ojdbc6.jar --> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.1.0</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- servlet API --> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> <!-- jstl֧�� --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.1.2</version> <type>jar</type> </dependency> <dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> <type>jar</type> </dependency> <!-- spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <!-- aspectj --> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>${aspectj.version}</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>${aspectj.version}</version> </dependency> <!-- jackson --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.7.5</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.7.5</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> <version>2.7.5</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>5.3.4.Final</version> </dependency> <!-- �ļ��ϴ� --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>1.3.3</version> </dependency> <!-- �־û� --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.4.2</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>1.3.1</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.38</version> </dependency> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> </dependencies> <build> <finalName>ssm</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.6.0</version> <configuration> <source>8</source> <target>8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.0</version> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.38</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-dependencies</id> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <excludeArtifactIds>servlet-api,jsp-api</excludeArtifactIds> <outputDirectory>web/WEB-INF/lib</outputDirectory> <overWriteReleases>false</overWriteReleases> <overWriteSnapshots>true</overWriteSnapshots> </configuration> </execution> </executions> </plugin> </plugins> </build> </project> maven库是添加了oracl的jar包的![图片说明](https://img-ask.csdn.net/upload/201709/08/1504835578_584970.png)

spring 代理 servlet 问题

<p>我的项目上面使用了spring代理servlet,XML文件都配置没问题,可是我一访问servlet就老提示错误</p> <h1>HTTP Status 500 - </h1> <hr size="1" noshade="65535" /> <p><strong><span style="color: #ffffff; background-color: #525d76;">type</span></strong> Exception report</p> <p><strong><span style="color: #ffffff; background-color: #525d76;">message</span></strong> </p> <p><strong><span style="color: #ffffff; background-color: #525d76;">description</span></strong> <span style="text-decoration: underline;">The server encountered an internal error () that prevented it from fulfilling this request.</span></p> <p><strong><span style="color: #ffffff; background-color: #525d76;">exception</span></strong> </p> <pre>javax.servlet.ServletException: Wrapper cannot find servlet class org.springFramework.web.servlet.DispatcherServlet or a class it depends on org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:595) </pre> <p> </p> <p><strong><span style="color: #ffffff; background-color: #525d76;">root cause</span></strong> </p> <pre>java.lang.ClassNotFoundException: org.springFramework.web.servlet.DispatcherServlet org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705) org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577) org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) java.lang.Thread.run(Thread.java:595) </pre> <p> </p> <p><strong><span style="color: #ffffff; background-color: #525d76;">note</span></strong> <span style="text-decoration: underline;">The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.</span></p> <hr size="1" noshade="65535" /> <h3>Apache Tomcat/5.0.28</h3> <p>==========================</p> <p>tomcat log</p> <p> </p> <p>2008-10-10 19:43:42 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: <a href="http://www.cnn.com">http://www.cnn.com</a>], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: <a href="http://www.yahoo.com">http://www.yahoo.com</a>], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: <a href="http://jakarta.apache.org">http://jakarta.apache.org</a>]]<br />2008-10-10 19:43:43 StandardContext[/jsp-examples]ContextListener: contextInitialized()<br />2008-10-10 19:43:43 StandardContext[/jsp-examples]SessionListener: contextInitialized()<br />2008-10-10 19:43:46 StandardContext[/reserve]Loading Spring root WebApplicationContext<br />2008-10-10 19:43:55 StandardContext[/reserve]Initializing WebApplicationContext for Struts ActionServlet 'action', module ''<br />2008-10-10 19:43:55 StandardContext[/servlets-examples]ContextListener: contextInitialized()<br />2008-10-10 19:43:55 StandardContext[/servlets-examples]SessionListener: contextInitialized()<br />2008-10-10 19:45:15 StandardContext[/reserve]Marking servlet ListServlet as unavailable<br />2008-10-10 19:45:15 StandardContext[/reserve]Error loading WebappClassLoader<br />  delegate: false<br />  repositories:<br />    /WEB-INF/classes/<br />----------&gt; Parent Classloader:<br />StandardClassLoader<br />  delegate: true<br />  repositories:<br />    file:I:\Tomcat\Tomcat5.0\shared\classes\<br />----------&gt; Parent Classloader:<br />StandardClassLoader<br />  delegate: true<br />  repositories:<br />    file:I:\Tomcat\Tomcat5.0\common\classes\<br />    file:I:\Tomcat\Tomcat5.0\common\endorsed\xalan.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\ant-launcher.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\ant.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-collections-3.1.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-dbcp-1.2.1.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-el.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-pool-1.2.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\jasper-compiler.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\jasper-runtime.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\jsp-api.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\msbase.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\mssqlserver.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\msutil.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-common.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-factory.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-java.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-resources.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\servlet-api.jar<br />    file:I:\Tomcat\Tomcat5.0\common\lib\tools.jar<br />----------&gt; Parent Classloader:<br /><a href="mailto:sun.misc.Launcher$AppClassLoader@181afa3">sun.misc.Launcher$AppClassLoader@181afa3</a></p> <p><br /> org.springFramework.web.servlet.DispatcherServlet<br />java.lang.ClassNotFoundException: org.springFramework.web.servlet.DispatcherServlet<br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)<br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)<br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964)<br /> at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)<br /> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)<br /> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)<br /> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)<br /> at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)<br /> at java.lang.Thread.run(Thread.java:595)</p> <p>2008-10-10 19:45:15 StandardWrapperValve[ListServlet]: Allocate exception for servlet ListServlet<br />javax.servlet.ServletException: Wrapper cannot find servlet class org.springFramework.web.servlet.DispatcherServlet or a class it depends on<br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:974)<br /> at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)<br /> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)<br /> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)<br /> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)<br /> at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)<br /> at java.lang.Thread.run(Thread.java:595)<br />----- Root Cause -----<br />java.lang.ClassNotFoundException: org.springFramework.web.servlet.DispatcherServlet<br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340)<br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)<br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964)<br /> at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:687)<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:144)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)<br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)<br /> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)<br /> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)<br /> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)<br /> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)<br /> at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)<br /> at java.lang.Thread.run(Thread.java:595)</p> <p> </p> <p> </p> <p> </p> <p>=========================</p> <p> </p> <p> </p> <p> </p> <p>web.xml</p> <p> </p> <pre name="code" class="xml"><!----> &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt; /WEB-INF/classes/config/spring/applicationContext-*.xml &lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt; org.springframework.web.context.ContextLoaderListener &lt;/listener-class&gt; &lt;/listener&gt; <!----> &lt;filter&gt; &lt;filter-name&gt;ActivityTimeFilter&lt;/filter-name&gt; &lt;filter-class&gt; org.springframework.web.filter.DelegatingFilterProxy &lt;/filter-class&gt; &lt;init-param&gt; &lt;param-name&gt;targetFilterLifecycle&lt;/param-name&gt; &lt;param-value&gt;true&lt;/param-value&gt; &lt;/init-param&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;ActivityTimeFilter&lt;/filter-name&gt; &lt;url-pattern&gt;/*&lt;/url-pattern&gt; &lt;/filter-mapping&gt; <!----> &lt;servlet&gt; &lt;servlet-name&gt;ListServlet&lt;/servlet-name&gt; &lt;servlet-class&gt; org.springFramework.web.servlet.DispatcherServlet &lt;/servlet-class&gt; &lt;/servlet&gt; <!----> &lt;servlet-mapping&gt; &lt;servlet-name&gt;ListServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/servlet/list_xml&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </pre> <p> </p> <p> </p> <p>=======================</p> <p> </p> <p>applicationContext-servlet.xml</p> <p> </p> <pre name="code" class="xml"><!----> &lt;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"&gt; &lt;bean id="ListServlet" class="com.reserve.web.servlet.ListServlet"&gt; &lt;property name="listServletLogic" ref="ListServletLogic"&gt; &lt;/bean&gt; &lt;/beans&gt;</pre> <p> </p> <p> </p> <p>===========================</p> <p> </p> <p>spring.jar包我也都加上了,版本也都对~</p> <p>找了半天我还是找不出来什么地方错误,请指教~谢谢~</p><br /><strong>问题补充:</strong><br />spring-webmvc.jar <br /> <br />这个我也试 过了,也不行,然后我才换的spring.jar的,还是不行 <br /> <br />是不是我配置文件写的有问题呢?<br /><strong>问题补充:</strong><br />我spring是2.0的,是eclipse里面我用myeclipse加载的,选择的是2.0<br /><strong>问题补充:</strong><br />这个是我今天的tomcat的log <br /> <br />2008-10-10 19:56:26 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]] <br />2008-10-10 19:56:26 StandardContext[/jsp-examples]ContextListener: contextInitialized() <br />2008-10-10 19:56:26 StandardContext[/jsp-examples]SessionListener: contextInitialized() <br />2008-10-10 19:56:28 StandardContext[/reserve]Loading Spring root WebApplicationContext <br />2008-10-10 19:56:34 StandardContext[/reserve]Marking servlet ListServlet as unavailable <br />2008-10-10 19:56:34 StandardContext[/reserve]Error loading WebappClassLoader <br />  delegate: false <br />  repositories: <br />    /WEB-INF/classes/ <br />----------&gt; Parent Classloader: <br />StandardClassLoader <br />  delegate: true <br />  repositories: <br />    file:I:\Tomcat\Tomcat5.0\shared\classes\ <br />----------&gt; Parent Classloader: <br />StandardClassLoader <br />  delegate: true <br />  repositories: <br />    file:I:\Tomcat\Tomcat5.0\common\classes\ <br />    file:I:\Tomcat\Tomcat5.0\common\endorsed\xalan.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\ant-launcher.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\ant.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-collections-3.1.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-dbcp-1.2.1.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-el.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\commons-pool-1.2.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\jasper-compiler.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\jasper-runtime.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\jsp-api.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\msbase.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\mssqlserver.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\msutil.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-common.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-factory.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-java.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\naming-resources.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\servlet-api.jar <br />    file:I:\Tomcat\Tomcat5.0\common\lib\tools.jar <br />----------&gt; Parent Classloader: <br />sun.misc.Launcher$AppClassLoader@181afa3 <br /> <br /> <br /> org.springFramework.web.servlet.DispatcherServlet <br />java.lang.ClassNotFoundException: org.springFramework.web.servlet.DispatcherServlet <br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340) <br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) <br /> at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) <br /> at org.apache.commons.digester.Rule.end(Rule.java:276) <br /> at org.apache.commons.digester.Digester.endElement(Digester.java:1058) <br /> at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76) <br /> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) <br /> at org.apache.commons.digester.Digester.parse(Digester.java:1567) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) <br /> at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br /> <br />2008-10-10 19:56:34 StandardContext[/reserve]Servlet /reserve threw load() exception <br />javax.servlet.ServletException: Wrapper cannot find servlet class org.springFramework.web.servlet.DispatcherServlet or a class it depends on <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:974) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) <br /> at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) <br /> at org.apache.commons.digester.Rule.end(Rule.java:276) <br /> at org.apache.commons.digester.Digester.endElement(Digester.java:1058) <br /> at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76) <br /> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) <br /> at org.apache.commons.digester.Digester.parse(Digester.java:1567) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) <br /> at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br />----- Root Cause ----- <br />java.lang.ClassNotFoundException: org.springFramework.web.servlet.DispatcherServlet <br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1340) <br /> at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189) <br /> at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:964) <br /> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862) <br /> at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013) <br /> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357) <br /> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823) <br /> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) <br /> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595) <br /> at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:903) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) <br /> at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:256) <br /> at org.apache.commons.digester.Rule.end(Rule.java:276) <br /> at org.apache.commons.digester.Digester.endElement(Digester.java:1058) <br /> at org.apache.catalina.util.CatalinaDigester.endElement(CatalinaDigester.java:76) <br /> at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) <br /> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) <br /> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) <br /> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) <br /> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) <br /> at org.apache.commons.digester.Digester.parse(Digester.java:1567) <br /> at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:488) <br /> at org.apache.catalina.core.StandardHost.install(StandardHost.java:863) <br /> at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:483) <br /> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427) <br /> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983) <br /> at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349) <br /> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091) <br /> at org.apache.catalina.core.StandardHost.start(StandardHost.java:789) <br /> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083) <br /> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478) <br /> at org.apache.catalina.core.StandardService.start(StandardService.java:480) <br /> at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313) <br /> at org.apache.catalina.startup.Catalina.start(Catalina.java:556) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287) <br /> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425) <br /> <br />2008-10-10 19:56:35 StandardContext[/reserve]Initializing WebApplicationContext for Struts ActionServlet 'action', module '' <br />2008-10-10 19:56:35 StandardContext[/servlets-examples]ContextListener: contextInitialized() <br />2008-10-10 19:56:35 StandardContext[/servlets-examples]SessionListener: contextInitialized() <br />2008-10-10 19:56:55 StandardWrapperValve[ListServlet]: Servlet ListServlet is currently unavailable <br />2008-10-10 19:56:56 StandardWrapperValve[ListServlet]: Servlet ListServlet is currently unavailable <br />2008-10-10 19:56:57 StandardWrapperValve[ListServlet]: Servlet ListServlet is currently unavailable <br />

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

《Oracle Java SE编程自学与面试指南》最佳学习路线图2020年最新版(进大厂必备)

正确选择比瞎努力更重要!

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

字节跳动面试官竟然问了我JDBC?

轻松等回家通知

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

阿里面试官让我用Zk(Zookeeper)实现分布式锁

他可能没想到,我当场手写出来了

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

立即提问
相关内容推荐