【问题标题】:Deployment of application using spring-data-jpa fails使用 spring-data-jpa 部署应用程序失败
【发布时间】:2014-06-05 21:00:02
【问题描述】:

我有一个简单的 Web 应用程序,它在 Apache Tomcat 8.0 中部署和运行良好。一旦我添加了 spring-data-jpa 依赖项,它就会失败。到目前为止,代码没有任何变化。

    <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>

这是输出:

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

我无法找出原因。是否还有 Netbeans 未显示的更多细节?

【问题讨论】:

  • 如果你在 Netbeans 之外部署,它可以工作吗?

标签: java spring hibernate spring-mvc jpa


【解决方案1】:

我找到了解决方案。它实际上就在 Tomcat 日志文件中,但未显示在输出窗口中。

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

应使用 2.2.5 或更高版本的 Spring 版本。现在使用 2.2.9 并且正在部署和工作查找。甚至 JPA 存储库都可以正常工作。

我仍然不确定在哪里可以找到与其他 Spring 项目兼容的明确记录的 Spring 版本的兼容性列表。在 Spring Data JPA 上,我没有找到有关最低要求版本的任何信息。

【讨论】:

    【解决方案2】:

    实际上非常简单:将库 POM 中声明的依赖版本视为较低的版本边界。对于当前的 Spring Data Dijkstra 发布系列(包括 Spring Data JPA 1.6),它是 Spring 3.2.9。

    【讨论】:

      猜你喜欢
      • 2018-04-12
      • 1970-01-01
      • 2012-05-21
      • 2018-09-18
      • 1970-01-01
      • 2021-05-05
      • 2017-02-05
      • 2016-10-20
      • 2018-10-11
      相关资源
      最近更新 更多