创建名称为' entityManagerFactory'的bean时出错在部署到WAS 8.5时在ServletContext资源中定义

时间:2017-08-21 14:30:11

标签: java spring maven spring-boot websphere

目前一直在努力在WAS 8.5中部署我的war文件,但每次启动war文件时都会发生错误。

  

初始化上下文时遇到异常:   {0} org.springframework.beans.factory.BeanCreationException:错误   创建名为&entityManagerFactory'的bean定义于   ServletContext资源[/WEB-INF/my-servlet.xml]:调用init   方法失败;嵌套异常是java.lang.NoSuchMethodError:   的javax /持久/ Table.indexes()[Ljavax /持久/索引;

的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>something-awesome</groupId>
<artifactId>something-awesome</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>something-awesome</name>
<url>/something-awesome</url>
<packaging>war</packaging>
<properties>
    <java-version>1.7</java-version>
</properties>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.3.RELEASE</version>
</parent>
<dependencies>

    <dependency>
        <groupId>com.ibm.db2.jcc</groupId>
        <artifactId>db2jcc</artifactId>
        <version>3.61</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
        <exclusions>
            <exclusion>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.hibernate.javax.persistence</groupId>
                <artifactId>hibernate-jpa-2.1-api</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.transaction</groupId>
                <artifactId>javax.transaction-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>

    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20151123</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>org.jboss.spec.javax.transaction</groupId>
                <artifactId>jboss-transaction-api_1.2_spec</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-c3p0</artifactId>
        <version>4.3.5.Final</version>
    </dependency>

    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.13</version>
    </dependency>

    <!-- Swagger Documentation -->
    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger2</artifactId>
        <version>2.2.2</version>
    </dependency>

    <dependency>
        <groupId>io.springfox</groupId>
        <artifactId>springfox-swagger-ui</artifactId>
        <version>2.2.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.4</version>
    </dependency>

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <scope>provided</scope>
    </dependency>

</dependencies>
<build>
    <defaultGoal>compile</defaultGoal>
    <finalName>${project.name}</finalName>
    <outputDirectory>${project.basedir}\src\main\webapp\WEB-INF\classes</outputDirectory>
    <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>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <packagingExcludes>WEB-INF/lib/servlet-api-2.5.jar,WEB-INF/lib/bootstrap-1.0.0.jar,WEB-INF/lib/com.ibm.mq-1.0.0.jar,WEB-INF/lib/com.ibm.mq.commonservices-1.0.0.jar,WEB-INF/lib/com.ibm.mq.connector-1.0.0.jar,WEB-INF/lib/com.ibm.mq.headers-1.0.0.jar,WEB-INF/lib/com.ibm.mq.jmqi-1.0.0.jar,WEB-INF/lib/com.ibm.mq.pcf-1.0.0.jar,WEB-INF/lib/com.ibm.websphere.sca.1.0-sca_api-1.0.0.jar,WEB-INF/lib/com.ibm.websphere.sca.2.0-sca_api-1.0.0.jar,WEB-INF/lib/com.ibm.ws.admin.core-1.0.0.jar,WEB-INF/lib/com.ibm.ws.admin.services-1.0.0.jar,WEB-INF/lib/com.ibm.ws.batch.runtime-1.0.0.jar,WEB-INF/lib/com.ibm.ws.emf-1.0.0.jar,WEB-INF/lib/com.ibm.ws.jaxrs-1.0.0.jar,WEB-INF/lib/com.ibm.ws.jpa-1.0.0.jar,WEB-INF/lib/com.ibm.ws.jsf.myfaces-1.0.0.jar,WEB-INF/lib/com.ibm.ws.portletcontainer-1.0.0.jar,WEB-INF/lib/com.ibm.ws.prereq.jackson-1.0.0.jar,WEB-INF/lib/com.ibm.ws.prereq.jaxrs-1.0.0.jar,WEB-INF/lib/com.ibm.ws.prereq.soap-1.0.0.jar,WEB-INF/lib/com.ibm.ws.prereq.vajava-1.0.0.jar,WEB-INF/lib/com.ibm.ws.prereq.wsdl4j-1.0.0.jar,WEB-INF/lib/com.ibm.ws.prereq.xlxp-1.0.0.jar,WEB-INF/lib/com.ibm.ws.runtime-1.0.0.jar,WEB-INF/lib/com.ibm.ws.runtime.dist-1.0.0.jar,WEB-INF/lib/com.ibm.ws.sib.server-1.0.0.jar,WEB-INF/lib/com.ibm.ws.sip.container-1.0.0.jar,WEB-INF/lib/com.ibm.ws.sip.interface-1.0.0.jar,WEB-INF/lib/com.ibm.ws.wccm-1.0.0.jar,WEB-INF/lib/com.ibm.ws.webcontainer-1.0.0.jar,WEB-INF/lib/com.ibm.wsfp.main-1.0.0.jar,WEB-INF/lib/dhbcore-1.0.0.jar,WEB-INF/lib/ffdcSupport-1.0.0.jar,WEB-INF/lib/j2ee-1.0.0.jar,WEB-INF/lib/mail-impl-1.0.0.jar,WEB-INF/lib/org.apache.tuscany.sca.api-1.0.0.jar,WEB-INF/lib/org.eclipse.emf.common-1.0.0.jar,WEB-INF/lib/org.eclipse.emf.commonj.sdo-1.0.0.jar,WEB-INF/lib/org.eclipse.emf.ecore-1.0.0.jar,WEB-INF/lib/org.eclipse.emf.ecore.change-1.0.0.jar,WEB-INF/lib/org.eclipse.emf.ecore.sdo-1.0.0.jar,WEB-INF/lib/org.eclipse.emf.ecore.xmi-1.0.0.jar,WEB-INF/lib/osgi.cmpn-1.0.0.jar,WEB-INF/lib/osgi.core-1.0.0.jar,WEB-INF/lib/PD-1.0.0.jar,WEB-INF/lib/RPCAdapter-1.0.0.jar,WEB-INF/lib/RPCAdapter-annotation-1.0.0.jar,WEB-INF/lib/rsadbutils-1.0.0.jar,WEB-INF/lib/servlet-api-2.5.jar,WEB-INF/lib/webmsg_applib-1.0.0.jar,WEB-INF/lib/wink-jaxrs-webdav-1.0.0.jar,WEB-INF/lib/wsadie.marshall-1.0.0.jar,WEB-INF/lib/wsadie.wsatlib-1.0.0.jar,WEB-INF/lib/xmlapi-1.0.0.jar,WEB-INF/lib/wink-jaxrs-webdav-1.0.0.jar,WEB-INF/lib/wsadie.marshall-1.0.0.jar,WEB-INF/lib/wsadie.wsatlib-1.0.0.jar,WEB-INF/lib/xmlapi-1.0.0.jar</packagingExcludes>
            </configuration>
        </plugin>
        <!-- <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> 
            <version>2.2</version> <configuration> <port>8080</port> <path>/</path> </configuration> 
            </plugin> -->
    </plugins>
</build>

依赖关系的树:

[INFO] +- com.ibm.db2.jcc:db2jcc:jar:3.61:compile
[INFO] +- org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile
[INFO] |  +- org.springframework.boot:spring-boot:jar:1.5.3.RELEASE:compile
[INFO] |  |  +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- org.springframework:spring-context:jar:4.3.8.RELEASE:compile
[INFO] |  |     +- (org.springframework:spring-aop:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |     +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |     +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |     \- (org.springframework:spring-expression:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-autoconfigure:jar:1.5.3.RELEASE:compile
[INFO] |  |  \- (org.springframework.boot:spring-boot:jar:1.5.3.RELEASE:compile - omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-starter-logging:jar:1.5.3.RELEASE:compile
[INFO] |  |  +- ch.qos.logback:logback-classic:jar:1.1.11:compile
[INFO] |  |  |  +- ch.qos.logback:logback-core:jar:1.1.11:compile
[INFO] |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.24; omitted for duplicate)
[INFO] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.25:compile
[INFO] |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for duplicate)
[INFO] |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for duplicate)
[INFO] |  |  \- org.slf4j:log4j-over-slf4j:jar:1.7.25:compile
[INFO] |  |     \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for duplicate)
[INFO] |  +- org.springframework:spring-core:jar:4.3.8.RELEASE:compile
[INFO] |  \- org.yaml:snakeyaml:jar:1.17:runtime
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:1.5.3.RELEASE:compile
[INFO] |  +- (org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile - omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-starter-tomcat:jar:1.5.3.RELEASE:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.14:compile
[INFO] |  |  +- org.apache.tomcat.embed:tomcat-embed-el:jar:8.5.14:compile
[INFO] |  |  \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:8.5.14:compile
[INFO] |  |     \- (org.apache.tomcat.embed:tomcat-embed-core:jar:8.5.14:compile - omitted for duplicate)
[INFO] |  +- org.hibernate:hibernate-validator:jar:5.3.5.Final:compile
[INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  |  +- (org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile - version managed from 3.3.0.Final; omitted for duplicate)
[INFO] |  |  \- (com.fasterxml:classmate:jar:1.3.3:compile - version managed from 1.2.0; omitted for duplicate)
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.8:compile
[INFO] |  +- org.springframework:spring-web:jar:4.3.8.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-aop:jar:4.3.8.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- org.springframework:spring-beans:jar:4.3.8.RELEASE:compile
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  \- org.springframework:spring-webmvc:jar:4.3.8.RELEASE:compile
[INFO] |     +- (org.springframework:spring-aop:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |     +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |     +- (org.springframework:spring-context:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |     +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |     +- org.springframework:spring-expression:jar:4.3.8.RELEASE:compile
[INFO] |     |  \- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |     \- (org.springframework:spring-web:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] +- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.3.RELEASE:compile
[INFO] |  +- (org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile - omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-starter-aop:jar:1.5.3.RELEASE:compile
[INFO] |  |  +- (org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-aop:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- (org.aspectj:aspectjweaver:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.3.RELEASE:compile
[INFO] |  |  +- (org.springframework.boot:spring-boot-starter:jar:1.5.3.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- org.apache.tomcat:tomcat-jdbc:jar:8.5.14:compile
[INFO] |  |  |  \- org.apache.tomcat:tomcat-juli:jar:8.5.14:compile
[INFO] |  |  \- org.springframework:spring-jdbc:jar:4.3.8.RELEASE:compile
[INFO] |  |     +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |     +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |     \- (org.springframework:spring-tx:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  +- (org.hibernate:hibernate-core:jar:5.0.12.Final:compile - omitted for duplicate)
[INFO] |  +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
[INFO] |  |  +- (org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile - version managed from 3.3.0.Final; omitted for duplicate)
[INFO] |  |  +- (org.hibernate:hibernate-core:jar:5.0.12.Final:compile - omitted for duplicate)
[INFO] |  |  +- (dom4j:dom4j:jar:1.6.1:compile - omitted for duplicate)
[INFO] |  |  +- (org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile - omitted for duplicate)
[INFO] |  |  \- (org.javassist:javassist:jar:3.21.0-GA:compile - version managed from 3.18.1-GA; omitted for duplicate)
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:1.11.3.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:1.13.3.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.24; omitted for duplicate)
[INFO] |  |  |  \- (org.slf4j:jcl-over-slf4j:jar:1.7.25:runtime - version managed from 1.7.24; omitted for duplicate)
[INFO] |  |  +- org.springframework:spring-orm:jar:4.3.8.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  +- (org.springframework:spring-jdbc:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-tx:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-aop:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- org.springframework:spring-tx:jar:4.3.8.RELEASE:compile
[INFO] |  |  |  +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  |  \- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.12; omitted for duplicate)
[INFO] |  |  \- (org.slf4j:jcl-over-slf4j:jar:1.7.25:runtime - version managed from 1.7.24; omitted for duplicate)
[INFO] |  \- org.springframework:spring-aspects:jar:4.3.8.RELEASE:compile
[INFO] |     \- (org.aspectj:aspectjweaver:jar:1.8.10:compile - version managed from 1.8.9; omitted for duplicate)
[INFO] +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] +- org.json:json:jar:20151123:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  +- org.javassist:javassist:jar:3.21.0-GA:compile (version managed from 3.18.1-GA)
[INFO] |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  +- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] |  +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] |     \- (org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile - version managed from 3.3.0.Final; omitted for duplicate)
[INFO] +- org.hibernate:hibernate-c3p0:jar:4.3.5.Final:compile
[INFO] |  +- (org.jboss.logging:jboss-logging:jar:3.3.1.Final:compile - version managed from 3.1.3.GA; omitted for duplicate)
[INFO] |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] |  +- (org.hibernate:hibernate-core:jar:5.0.12.Final:compile - version managed from 4.3.5.Final; omitted for duplicate)
[INFO] |  \- com.mchange:c3p0:jar:0.9.2.1:compile
[INFO] |     \- com.mchange:mchange-commons-java:jar:0.2.3.4:compile
[INFO] +- javax.transaction:jta:jar:1.1: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] +- io.springfox:springfox-swagger2:jar:2.2.2:compile
[INFO] |  +- org.mapstruct:mapstruct:jar:1.0.0.CR1:compile
[INFO] |  +- io.swagger:swagger-annotations:jar:1.5.3:compile
[INFO] |  +- io.swagger:swagger-models:jar:1.5.3:compile
[INFO] |  |  +- (com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile - version managed from 2.4.5; omitted for duplicate)
[INFO] |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.6.3; omitted for duplicate)
[INFO] |  |  \- (io.swagger:swagger-annotations:jar:1.5.3:compile - omitted for duplicate)
[INFO] |  +- io.springfox:springfox-spi:jar:2.2.2:compile
[INFO] |  |  \- io.springfox:springfox-core:jar:2.2.2:compile
[INFO] |  |     +- (com.google.guava:guava:jar:18.0:compile - omitted for duplicate)
[INFO] |  |     +- (com.fasterxml:classmate:jar:1.3.3:compile - version managed from 1.2.0; omitted for duplicate)
[INFO] |  |     +- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.12; omitted for duplicate)
[INFO] |  |     +- (org.aspectj:aspectjrt:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  |     +- (org.aspectj:aspectjweaver:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  |     +- (org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |     +- (org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |     \- (org.springframework.hateoas:spring-hateoas:jar:0.23.0.RELEASE:compile - version managed from 0.18.0.RELEASE; omitted for duplicate)
[INFO] |  +- io.springfox:springfox-schema:jar:2.2.2:compile
[INFO] |  |  +- (io.springfox:springfox-core:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  |  \- (io.springfox:springfox-spi:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  +- io.springfox:springfox-swagger-common:jar:2.2.2:compile
[INFO] |  |  +- (io.swagger:swagger-annotations:jar:1.5.3:compile - omitted for duplicate)
[INFO] |  |  +- (io.swagger:swagger-models:jar:1.5.3:compile - omitted for duplicate)
[INFO] |  |  +- (io.springfox:springfox-spi:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  |  +- (io.springfox:springfox-schema:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  |  +- (io.springfox:springfox-spring-web:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  |  +- (com.google.guava:guava:jar:18.0:compile - omitted for duplicate)
[INFO] |  |  +- (com.fasterxml:classmate:jar:1.3.3:compile - version managed from 1.2.0; omitted for duplicate)
[INFO] |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.12; omitted for duplicate)
[INFO] |  |  +- (org.aspectj:aspectjrt:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  |  +- (org.aspectj:aspectjweaver:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  |  +- (org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- (org.springframework.hateoas:spring-hateoas:jar:0.23.0.RELEASE:compile - version managed from 0.18.0.RELEASE; omitted for duplicate)
[INFO] |  +- io.springfox:springfox-spring-web:jar:2.2.2:compile
[INFO] |  |  +- (com.google.guava:guava:jar:18.0:compile - omitted for duplicate)
[INFO] |  |  +- (com.fasterxml:classmate:jar:1.3.3:compile - version managed from 1.2.0; omitted for duplicate)
[INFO] |  |  +- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.12; omitted for duplicate)
[INFO] |  |  +- (org.aspectj:aspectjrt:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  |  +- (org.aspectj:aspectjweaver:jar:1.8.10:compile - version managed from 1.8.6; omitted for duplicate)
[INFO] |  |  +- (org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |  +- (org.springframework.hateoas:spring-hateoas:jar:0.23.0.RELEASE:compile - version managed from 0.18.0.RELEASE; omitted for duplicate)
[INFO] |  |  +- (io.springfox:springfox-spi:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  |  \- (io.springfox:springfox-schema:jar:2.2.2:compile - omitted for duplicate)
[INFO] |  +- com.google.guava:guava:jar:18.0:compile
[INFO] |  +- com.fasterxml:classmate:jar:1.3.3:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.8.10:compile
[INFO] |  +- org.aspectj:aspectjweaver:jar:1.8.10:compile
[INFO] |  +- org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile
[INFO] |  |  +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-context:jar:4.3.8.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  |  +- (org.springframework:spring-aop:jar:4.3.8.RELEASE:compile - version managed from 4.0.9.RELEASE; omitted for duplicate)
[INFO] |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.10; omitted for duplicate)
[INFO] |  +- org.springframework.plugin:spring-plugin-metadata:jar:1.2.0.RELEASE:compile
[INFO] |  |  +- (org.springframework.plugin:spring-plugin-core:jar:1.2.0.RELEASE:compile - omitted for duplicate)
[INFO] |  |  \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.10; omitted for duplicate)
[INFO] |  \- org.springframework.hateoas:spring-hateoas:jar:0.23.0.RELEASE:compile
[INFO] |     +- (org.springframework:spring-aop:jar:4.3.8.RELEASE:compile - version managed from 4.3.5.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-beans:jar:4.3.8.RELEASE:compile - version managed from 4.3.5.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-context:jar:4.3.8.RELEASE:compile - version managed from 4.3.5.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-core:jar:4.3.8.RELEASE:compile - version managed from 4.3.5.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-web:jar:4.3.8.RELEASE:compile - version managed from 4.3.5.RELEASE; omitted for duplicate)
[INFO] |     +- (org.springframework:spring-webmvc:jar:4.3.8.RELEASE:compile - version managed from 4.3.5.RELEASE; omitted for duplicate)
[INFO] |     \- (org.slf4j:slf4j-api:jar:1.7.25:compile - version managed from 1.7.22; omitted for duplicate)
[INFO] +- io.springfox:springfox-swagger-ui:jar:2.2.2:compile
[INFO] |  \- (io.springfox:springfox-spring-web:jar:2.2.2:compile - omitted for duplicate)
[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.7:compile
[INFO] |  \- org.apache.logging.log4j:log4j-api:jar:2.7:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO] \- org.projectlombok:lombok:jar:1.16.16:provided

我只是不知道这个错误导致的位置。我实施了其他OP问题,这个问题与我当前的问题有某种联系,但遗憾的是我的运气没有。有帮助吗?

修改

在我的pom中添加hibernate-entityManager依赖项之后,它又创建了另一个问题。

  

初始化上下文时遇到异常:   {0} org.springframework.beans.factory.BeanCreationException:错误   创建名为&entityManagerFactory&#39;的bean定义于   ServletContext资源[/WEB-INF/something-servlet.xml]:不能   解析对bean&#39; jpaVendorAdapter&#39;的引用设置bean时   property&#39; jpaVendorAdapter&#39 ;;嵌套异常是   org.springframework.beans.factory.BeanCreationException:错误   创建名为&#39; jpaVendorAdapter&#39;的bean在ServletContext中定义   resource [/WEB-INF/something-servlet.xml]:bean的实例化   失败;嵌套异常是   org.springframework.beans.BeanInstantiationException:失败   实例   [org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter]:   构造函数抛出异常;嵌套异常是   java.lang.IllegalStateException:无法确定Hibernate   PersistenceProvider类

1 个答案:

答案 0 :(得分:0)

对于那些寻找这个问题答案的人,

我们将JPA从JPA2.1降级为JPA2.0(因为WAS8.5不能支持JPA2.1)

请参阅this表,了解JPA2.0 / JPA2.1之间的依赖性问题 - WAS

因为我们正在使用springboot,所以我们删除了这个依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

在maven中的dependencyTree的帮助下,我们能够识别附加到已删除依赖项的依赖项(上面提到的依赖项),并添加了这些依赖项:

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>4.1.7.Final</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.7.Final</version>

根据我的理解,springboot使用的是最新版本(JPA的最新版本是2.1),因此我们做了这个解决方案。