java.lang.ClassNotFoundException:服务器启动时的org.springframework.web.method.support.CompositeUriComponentsContributor [英] java.lang.ClassNotFoundException: org.springframework.web.method.support.CompositeUriComponentsContributor on server startup
问题描述
在研究之后,我在pom.xml文件中添加了下面的依赖项:
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-web< / artifactId>
< version> 4.0.6.RELEASE< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-beans< / artifactId>
< version> 4.0.6.RELEASE< / version>
< /依赖关系>
< dependency>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging< / artifactId>
< version> 1.1.1< / version>
< /依赖关系>
罐子的屏幕截图
我仍然有上述错误。请问可能会出错? = UTF-8 >?;
< project xmlns =http://maven.apache.org/POM/4.0.0xmlns: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>书店< / groupId>
< artifactId>书店< / artifactId>
< name>书店< / name>
<包装>战争< / packaging>
< version> 1.0.0-BUILD-SNAPSHOT< / version>
<属性>
< java-version> 1.8< / java-version>
< org.springframework-version> 4.0.3.RELEASE< /org.springframework-version>
< spring.security.version> 4.0.3.RELEASE< /spring.security.version>
< org.aspectj-version> 1.7.4< /org.aspectj-version>
< org.slf4j-version> 1.7.5< /org.slf4j-version>
< hibernate.version> 4.3.5.Final< /hibernate.version>
< / properties>
<依赖关系>
<! - Spring - >
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-context< / artifactId>
< version> $ {org.springframework-version}< / version>
<排除项>
<! - 排除Commons记录SLF4j - >
<排除>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging< / artifactId>
< /排除>
< /排除>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
<版本> $ {slf4j-version}< / version>
< scope>运行时< / scope>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-webmvc< / artifactId>
< version> $ {org.springframework-version}< / version>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-api< / artifactId>
< version> 1.6.4< / version>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> 1.6.4< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-tx< / artifactId>
< version> $ {org.springframework-version}< / version>
< /依赖关系>
<! - Hibernate - >
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> $ {hibernate.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-entitymanager< / artifactId>
< version> $ {hibernate.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-web< / artifactId>
< version> $ {spring.security.version}< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-config< / artifactId>
< version> $ {spring.security.version}< / version>
< /依赖关系>
<! - Apache Commons DBCP - >
< dependency>
< groupId> commons-dbcp< / groupId>
< artifactId> commons-dbcp< / artifactId>
< version> 1.4< / version>
< /依赖关系>
<! - Spring ORM - >
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-orm< / artifactId>
< version> $ {org.springframework-version}< / version>
< /依赖关系>
<! - AspectJ - >
< dependency>
< groupId> org.aspectj< / groupId>
< artifactId> aspectjrt< / artifactId>
< version> $ {org.aspectj-version}< / version>
< /依赖关系>
<! - 记录 - >
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-api< / artifactId>
< version> $ {org.slf4j-version}< / version>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> jcl-over-slf4j< / artifactId>
< version> $ {org.slf4j-version}< / version>
< scope>运行时< / scope>
< /依赖关系>
< dependency>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> $ {org.slf4j-version}< / version>
< scope>运行时< / scope>
< /依赖关系>
< dependency>
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.17< / version>
<排除项>
<排除>
< groupId> javax.mail< / groupId>
< artifactId>邮件< / artifactId>
< /排除>
<排除>
< groupId> javax.jms< / groupId>
< artifactId> jms< / artifactId>
< /排除>
<排除>
< groupId> com.sun.jdmk< / groupId>
< artifactId> jmxtools< / artifactId>
< /排除>
<排除>
< groupId> com.sun.jmx< / groupId>
< artifactId> jmxri< / artifactId>
< /排除>
< /排除>
< scope>编译< / scope>
< /依赖关系>
<! - @Inject - >
< dependency>
< groupId> javax.inject< / groupId>
< artifactId> javax.inject< / artifactId>
< version> 1< / version>
< /依赖关系>
< dependency>
< groupId> cglib< / groupId>
< artifactId> cglib< / artifactId>
< version> 2.2< / version>
< /依赖关系>
< dependency>
< groupId> org.aspectj< / groupId>
< artifactId> aspectjweaver< / artifactId>
< version> 1.6.11< / version>
< /依赖关系>
<! - Servlet - >
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> servlet-api< / artifactId>
< version> 2.5< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> javax.servlet.jsp< / groupId>
< artifactId> jsp-api< / artifactId>
< version> 2.1< / version>
< scope>提供< / scope>
< /依赖关系>
< dependency>
< groupId> javax.servlet< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.2< / version>
< /依赖关系>
<! - Test - >
< dependency>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.7< / version>
< scope> test< / scope>
< /依赖关系>
< dependency>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-ehcache< / artifactId>
< version> 4.3.8.Final< / version>
< /依赖关系>
< dependency>
< groupId> net.sf.ehcache< / groupId>
< artifactId> ehcache-core< / artifactId>
< version> 2.6.10< / version>
< /依赖关系>
< dependency>
< groupId> org.codehaus.jackson< / groupId>
< artifactId> jackson-mapper-asl< / artifactId>
< version> 1.9.13< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.activemq< / groupId>
< artifactId> activemq-spring< / artifactId>
< version> 5.10.0< / version>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-jms< / artifactId>
< version> 4.0.3.RELEASE< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.activemq< / groupId>
< artifactId> activemq-kahadb-store< / artifactId>
< version> 5.13.1< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.activemq< / groupId>
< artifactId> activemq-broker< / artifactId>
< version> 5.13.1< / version>
< /依赖关系>
< dependency>
< groupId> org.apache.activemq< / groupId>
< artifactId> activemq-all< / artifactId>
< version> 5.1.0< / version>
< scope>编译< / scope>
< /依赖关系>
< dependency>
< groupId> org.springframework< / groupId>
< artifactId> spring-jms< / artifactId>
< version> 3.1.0.RELEASE< / version>
< scope>编译< / scope>
< /依赖关系>
< dependency>
< groupId> com.caucho< / groupId>
< artifactId> hessian< / artifactId>
< version> 4.0.7< / version>
< /依赖关系>
< / dependencies>
< build>
< plugins>
< plugin>
< artifactId> maven-eclipse-plugin< / artifactId>
< version> 2.9< / version>
<配置>
< additionalProjectnatures>
< projectnature> org.springframework.ide.eclipse.core.springnature< / projectnature>
< / additionalProjectnatures>
< additionalBuildcommands>
< buildcommand> org.springframework.ide.eclipse.core.springbuilder< / buildcommand>
< / additionalBuildcommands>
< downloadSources> true< / downloadSources>
< downloadJavadocs> true< / downloadJavadocs>
< / configuration>
< / plugin>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 2.5.1< / version>
<配置>
< source> 1.8< / source>
< target> 1.8< / target>
< compilerArgument> -Xlint:all< / compilerArgument>
< showWarnings> true< / showWarnings>
< showDeprecation> true< / showDeprecation>
< / configuration>
< / plugin>
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> exec-maven-plugin< / artifactId>
< version> 1.2.1< / version>
<配置>
< mainClass> org.test.int1.Main< / mainClass>
< / configuration>
< / plugin>
< / plugins>
< finalName>书店< / finalName>
< / build>
< / project>
I have added the below dependencies in pom.xml file after research
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.0.6.RELEASE</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
The screen shot of the jars
And I still having the above error. Please what could be wrong?
<?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>
<groupId>bookstore</groupId>
<artifactId>bookstore</artifactId>
<name>bookstore</name>
<packaging>war</packaging>
<version>1.0.0-BUILD-SNAPSHOT</version>
<properties>
<java-version>1.8</java-version>
<org.springframework-version>4.0.3.RELEASE</org.springframework-version>
<spring.security.version>4.0.3.RELEASE</spring.security.version>
<org.aspectj-version>1.7.4</org.aspectj-version>
<org.slf4j-version>1.7.5</org.slf4j-version>
<hibernate.version>4.3.5.Final</hibernate.version>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
</dependency>
<!-- Apache Commons DBCP -->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- Spring ORM -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<scope>compile</scope>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.11</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- Test -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>4.3.8.Final</version>
</dependency>
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.10</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-spring</artifactId>
<version>5.10.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-kahadb-store</artifactId>
<version>5.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>3.1.0.RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.caucho</groupId>
<artifactId>hessian</artifactId>
<version>4.0.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
</plugins>
<finalName>bookstore</finalName>
</build>
</project>
这篇关于java.lang.ClassNotFoundException:服务器启动时的org.springframework.web.method.support.CompositeUriComponentsContributor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!