运行mvn tomcat7时出现此错误:从此pom.xml运行在tomcat 7中部署应用程序时。我的依赖项,我想问题来自于依赖包的混合版本。
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-samples-parent</artifactId>
<version>0.10.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>datatables-jsp-ajax</artifactId>
<packaging>war</packaging>
<name>Dandelion :: Samples :: Datatables :: datatables-jsp-ajax</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- Dandelion-Datatables -->
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-jsp</artifactId>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-spring3</artifactId>
</dependency>
<!-- Spring + Jackson -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!-- Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
</dependency>
<!-- Hibernate as JPA implementation -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<!-- Database drivers -->
<!-- H2 (local) -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
<!-- Logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
这里是../../ pom.xml:
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-samples-parent</artifactId>
<version>0.10.0</version>
<packaging>pom</packaging>
<name>Dandelion :: Samples :: Parent</name>
<description>Parent of all Dandelion samples</description>
<modules>
<module>dandelion/dandelion-jsp-starter</module>
<module>dandelion/dandelion-thymeleaf-starter</module>
<module>datatables/datatables-jsp-starter</module>
<module>datatables/datatables-jsp-themes</module>
<module>datatables/datatables-jsp-plugins</module>
<module>datatables/datatables-jsp-configuration-groups</module>
<module>datatables/datatables-jsp-extension</module>
<module>datatables/datatables-jsp-ajax</module>
<module>datatables/datatables-jsp-i18n-struts1</module>
<module>datatables/datatables-jsp-i18n-struts2</module>
<module>datatables/datatables-jsp-export</module>
<module>datatables/datatables-thymeleaf-starter</module>
<module>datatables/datatables-thymeleaf-themes</module>
<module>datatables/datatables-thymeleaf-plugins</module>
<module>datatables/datatables-thymeleaf-configuration-groups</module>
<module>datatables/datatables-thymeleaf-ajax</module>
<module>datatables/datatables-thymeleaf-export</module>
<module>datatables/datatables-thymeleaf-extension</module>
</modules>
<properties>
<!-- Configuration -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Dependencies -->
<dandelion.version>0.10.0</dandelion.version>
<dandelion.datatables.version>0.10.0</dandelion.datatables.version>
<jstl.version>1.2</jstl.version>
<tiles.version>2.2.2</tiles.version>
<servlet-api.version>3.0.1</servlet-api.version>
<thymeleaf.version>2.1.3.RELEASE</thymeleaf.version>
<thymeleaf.layout.version>1.2.4</thymeleaf.layout.version>
<thymeleaf.tiles2.version>2.1.1.RELEASE</thymeleaf.tiles2.version>
<spring.version>3.2.8.RELEASE</spring.version>
<jackson.version>1.9.13</jackson.version>
<struts1.version>1.3.10</struts1.version>
<struts2.version>2.1.8</struts2.version>
<hibernate.version>4.3.5.Final</hibernate.version>
<slf4j-api.version>1.7.5</slf4j-api.version>
<logback.version>1.1.2</logback.version>
<h2.version>1.3.175</h2.version>
<!-- Maven plugins -->
<maven-compiler-plugin.version>3.0</maven-compiler-plugin.version>
<tomcat7-maven-plugin.version>2.0</tomcat7-maven-plugin.version>
<jetty-maven-plugin.version>8.1.8.v20121106</jetty-maven-plugin.version>
<spring-boot-maven-plugin.version>1.0.2.RELEASE</spring-boot-maven-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- Dandelion -->
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-jsp</artifactId>
<version>${dandelion.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-thymeleaf</artifactId>
<version>${dandelion.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-spring3</artifactId>
<version>${dandelion.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-ehcache</artifactId>
<version>${dandelion.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-webjars</artifactId>
<version>${dandelion.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>dandelion-yuicompressor</artifactId>
<version>${dandelion.version}</version>
</dependency>
<!-- Dandelion-Datatables -->
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-jsp</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-thymeleaf</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-spring3</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-compression-yui</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-export-poi</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-export-poi-ooxml</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-export-itext</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-struts1</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<dependency>
<groupId>com.github.dandelion</groupId>
<artifactId>datatables-struts2</artifactId>
<version>${dandelion.datatables.version}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<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>
<!-- Struts 1 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-core</artifactId>
<version>${struts1.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-taglib</artifactId>
<version>${struts1.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts-extras</artifactId>
<version>${struts1.version}</version>
</dependency>
<!-- Struts 2 -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2.version}</version>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- Thymeleaf -->
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring3</artifactId>
<version>${thymeleaf.version}</version>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-tiles2</artifactId>
<version>${thymeleaf.tiles2.version}</version>
</dependency>
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
<version>${thymeleaf.layout.version}</version>
</dependency>
<!-- Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-api</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-servlet</artifactId>
<version>${tiles.version}</version>
</dependency>
<!-- Sitemesh -->
<dependency>
<groupId>org.sitemesh</groupId>
<artifactId>sitemesh</artifactId>
<version>${sitemesh3.version}</version>
</dependency>
<!-- Hibernate as JPA implementation -->
<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>
<!-- Database drivers -->
<!-- H2 (local) -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j-api.version}</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- Jetty 8 -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty-maven-plugin.version}</version>
<configuration>
<connectors>
<connector
implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>9090</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
</webAppConfig>
</configuration>
</plugin>
<!-- Tomcat 7 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat7-maven-plugin.version}</version>
<configuration>
<server>tomcat-development-server</server>
<port>9090</port>
<path>/${project.artifactId}</path>
</configuration>
</plugin>
<!-- Spring Boot -->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
答案 0 :(得分:6)
此类已添加到4.x.x版本中,您将无法在Hibernate 3中找到它
hibernate-core-4.1.6.Final.jar\org\hibernate\internal\CoreMessageLogger.class
您的Maven依赖关系树中可能有2个版本的hibernate-core
。
你需要:
mvn dependency:tree
hibernate-core
个版本以及其他第3个oarty依赖项代表您添加hibernate-core
hibernate-core
依赖项,并仅依赖于您的显式配置答案 1 :(得分:1)
看起来你有一个罐子冲突。你在类路径中有hibernate 3和Hibernate 4,而hibernate 3是第一个。
答案 2 :(得分:0)
这里是mvn依赖:tree
[INFO] ------------------------------------------------------------------------
[INFO] Building Dandelion :: Samples :: Datatables :: datatables-jsp-ajax 0.10.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ datatables-jsp-ajax ---
[INFO] com.github.dandelion:datatables-jsp-ajax:war:0.10.0
[INFO] +- com.github.dandelion:datatables-jsp:jar:0.10.0:compile
[INFO] | +- com.github.dandelion:datatables-core:jar:0.10.0:compile
[INFO] | | +- com.github.dandelion:dandelion-core:jar:0.10.0:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-core:jar:2.3.1:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.1:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.3.1:compile
[INFO] | | +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] | | | \- junit:junit:jar:4.10:compile
[INFO] | | | \- org.hamcrest:hamcrest-core:jar:1.1:compile
[INFO] | | \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] | +- com.github.dandelion:dandelion-jsp:jar:0.10.0:compile
[INFO] | \- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] +- com.github.dandelion:datatables-spring3:jar:0.10.0:compile
[INFO] +- org.springframework:spring-web:jar:3.2.8.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:3.2.8.RELEASE:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- org.springframework:spring-beans:jar:3.2.8.RELEASE:compile
[INFO] | +- org.springframework:spring-context:jar:3.2.8.RELEASE:compile
[INFO] | \- org.springframework:spring-core:jar:3.2.8.RELEASE:compile
[INFO] | \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.2.8.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:3.2.8.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.2.8.RELEASE:compile
[INFO] | +- org.springframework:spring-jdbc:jar:3.2.8.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:3.2.8.RELEASE:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- jstl:jstl:jar:1.2:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] +- org.apache.tiles:tiles-jsp:jar:2.2.2:compile
[INFO] | +- org.apache.tiles:tiles-servlet:jar:2.2.2:compile
[INFO] | | \- org.apache.tiles:tiles-core:jar:2.2.2:compile
[INFO] | | +- commons-digester:commons-digester:jar:2.0:compile
[INFO] | | \- org.slf4j:jcl-over-slf4j:jar:1.7.5:compile
[INFO] | \- org.apache.tiles:tiles-template:jar:2.2.2:compile
[INFO] | \- org.apache.tiles:tiles-api:jar:2.2.2:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.3.5.Final:compile
[INFO] | +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] | +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] | +- org.hibernate:hibernate-core:jar:4.3.5.Final:compile
[INFO] | | +- antlr:antlr:jar:2.7.7:compile
[INFO] | | \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] | +- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.4.Final:compile
[INFO] | +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] | +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] | \- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] +- com.h2database:h2:jar:1.3.175:compile
[INFO] \- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] \- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.576 s
[INFO] Finished at: 2014-05-28T20:58:20+01:00
答案 3 :(得分:0)
使用spring boot和jpa的活动时出现上述错误。这是hibernate核心和hibernate实体管理器版本的问题。所以我将我的春季启动版本从1.3x升级到1.4.0RELEASE。并包含hibernate依赖项如下修复问题。
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.2.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.2.2.Final</version>
</dependency>