简体   繁体   English

使用spring-data-jpa部署应用程序失败

[英]Deployment of application using spring-data-jpa fails

I have a simple web application which is deploying and working fine in Apache Tomcat 8.0. 我有一个简单的Web应用程序,该应用程序可以在Apache Tomcat 8.0中进行部署并正常工作。 As soon as I add the spring-data-jpa dependency, it fails. 一旦添加spring-data-jpa依赖关系,它就会失败。 No changes in code until now. 到目前为止,代码没有任何变化。

    <spring.version>3.2.2.RELEASE</spring.version>
    <spring.data.jpa.version>1.6.0.RELEASE</spring.data.jpa.version>

    <!-- SPRING -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>${spring.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>${spring.data.jpa.version}</version>
    </dependency>

Here is the output: 这是输出:

NetBeans: Deploying on Apache Tomcat or TomEE
    profile mode: false
    debug mode: false
    force redeploy: true
Undeploying ...
undeploy?path=/student-exchange
OK - Undeployed application at context path /student-exchange
In-place deployment at /Users/Vincent/NetBeansProjects/student-exchange/target/StudentsApplication
Deployment is in progress...
deploy?config=file%3A%2Fvar%2Ffolders%2Fzg%2Fb2w5j60d2x7cy12hxn998r480000gs%2FT%2Fcontext8080124463540341991.xml&path=/student-exchange
FAIL - Deployed application at context path /student-exchange but context failed to start

I can't find out what the cause is here. 我找不到原因在这里。 Are there further details which are not shown by Netbeans? 是否还有Netbeans未显示的更多详细信息?

I have found the solution. 我找到了解决方案。 It was actually right there in a Tomcat log file which was not shown in an output window. 它实际上就在Tomcat日志文件中,该文件未在输出窗口中显示。

    <spring.version>3.2.9.RELEASE</spring.version>

Spring version of 2.2.5 or better should be used. 应该使用2.2.5或更高版本。 Now using 2.2.9 and is deploying and working find. 现在使用2.2.9并正在部署和工作中。 Even JPA repositories all working. 甚至JPA储存库都可以正常工作。

I'm still not sure where I can find compatibility lists with clearly documented Spring versions compatible with other Spring projects. 我仍然不确定在哪里可以找到兼容性列表,这些列表具有明确记录的与其他Spring项目兼容的Spring版本。 On Spring Data JPA, I didn't find anything about the minimum required version. 在Spring Data JPA上,我没有找到有关最低要求版本的任何信息。

It's pretty simple actually: consider the dependency versions stated in the library POMs the lower version boundary. 实际上,这非常简单:将库POM中声明的依赖版本视为较低的版本边界。 For the current Spring Data Dijkstra release train (including Spring Data JPA 1.6) it's Spring 3.2.9. 对于当前的Spring Data Dijkstra发行版(包括Spring Data JPA 1.6),它是Spring 3.2.9。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM