首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Spring Boot - org.springframework.context.ApplicationContextInitializer :java.lang.ClassNotFoundException

Spring Boot - org.springframework.context.ApplicationContextInitializer :java.lang.ClassNotFoundException
EN

Stack Overflow用户
提问于 2016-03-01 00:21:39
回答 2查看 8.8K关注 0票数 4

我正在尝试将一个简单的Spring Boot web应用程序部署到Pivotal Cloud foundry,但在执行cf推送时,我在日志中得到以下错误

代码语言:javascript
运行
AI代码解释
复制
java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextInitializer

这是我的pom.xml

代码语言:javascript
运行
AI代码解释
复制
    <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.0.BUILD-SNAPSHOT</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.7</java.version>
</properties>

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc-portlet</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

同样的应用程序被部署在我的本地主机上,并且我在构建war时没有任何问题。对此有什么想法吗?

EN

回答 2

Stack Overflow用户

发布于 2016-09-15 18:21:47

正如Andy Wilkinson指出的,这是Spring Boot1.4和java_buildpack之间不匹配的问题。可以通过显式提及java_buildpack的URL来解决此问题:

代码语言:javascript
运行
AI代码解释
复制
$ cf push -b https://github.com/cloudfoundry/java-buildpack.git …
票数 6
EN

Stack Overflow用户

发布于 2016-03-01 04:21:16

在maven构建期间,由于SSL握手异常,似乎没有下载jar。由于某种原因,尽管缺少jar,但我的构建并没有失败。通过在mvn全新安装期间启用debug发现了这一点

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35712435

复制
相关文章
Spring-boot_Spring Boot
Jasypt是一个加密库,Github上有一个集成了Jasypt的Spring Boot库,叫jasypt-spring-boot,本文演示了如何使用该库对配置文件进行加密。
全栈程序员站长
2022/11/09
1.3K0
Spring-boot_Spring Boot
Spring - ApplicationContextInitializer 扩展接口
该接口是整个spring容器在刷新之前初始化ConfigurableApplicationContext的回调接口,即在容器刷新之前会调用该类的initialize方法。
小小工匠
2022/12/01
3510
Spring Boot 缓存Spring Boot缓存
我们知道一个系统的瓶颈通常在与数据库交互的过程中。内存的速度远远快于硬盘速度。所以,当我们需要重复地获取相同的数据的时候,我们一次又一次的请求数据库或者远程服务,这无疑是性能上的浪费——会导致大量的时间耗费在数据库查询或者远程方法调用上(这些资源简直太奢侈了),导致程序性能的恶化——于是有了“缓存”。缓存(Cache)就是数据交换的缓冲区。 本章介绍在 Spring Boot 项目开发中怎样来使用Spring Cache 实现数据的缓存。
一个会写诗的程序员
2018/08/17
3.4K0
Spring Boot 日志Spring Boot 日志
在任何一个生产系统中,对日志的合理记录是非常重要的。这对系统故障的定位处理极其关键。Spring Boot支持Java Util Logging,Log4j2,Lockback作为日志框架, Spring Boot使用Logback作为默认日志框架。无论使用哪种日志框架,Spring Boot都支持配置将日志输出到控制台或者文件中。 本章我们来详细介绍 Spring Boot 应用的日志的配置与使用。
一个会写诗的程序员
2018/08/17
1.9K0
spring boot 源码解析-SpringApplication初始化
就是这么简单的代码,构成了spring boot的世界. 那么代码中只有⼀个@SpringBootApplication 注解 和 调⽤了SpringApplication#run
吴生
2018/05/23
8930
首页Spring BootSpring Boot入门学习
J2EE笨重的开发,繁多的配置,低下的开发效率,复杂的部署流程,第三方技术集成难度大。
cherishspring
2019/10/14
1.1K0
Spring boot (一)创建Spring boot项目
spring boot 版本兼容: spring boot 1.x 适用于jdk1.7 spring boot 2.x 使用 jdk8 以上
斯文的程序
2019/11/07
1.2K0
Spring Boot (十三): Spring Boot 小技巧
我们在做测试的时候经常需要初始化导入一些数据,如何来处理呢?会有两种选择,一种是使用 Jpa,另外一种是 Spring JDBC 。两种方式各有区别下面来详细介绍。
纯洁的微笑
2019/07/31
1.2K0
Spring Boot系列——Spring Boot如何启动
​上篇《Spring Boot系列——5分钟构建一个应用》介绍了如何快速创建一个Spring Boot项目并运行。虽然步骤少流程简单,为开发者省去了很多重复性的配置工作,但是其底层实现并没有这么简单。
JackieZheng
2018/09/28
1.1K0
Spring Boot系列——Spring Boot如何启动
Spring Boot
Spring Boot 的角色:Spring Framework -> Spring Boot -> Spring Cloud。
数媒派
2022/12/01
9340
Spring 和 Spring Boot
很多在开始的时候可能对 Spring 和 Spring boot 之间的关系可能有些混淆,在开始的时候如果能够对这 2 个概念有所了解的话,能够对后面的使用起到一些帮助作用。
HoneyMoose
2021/02/14
2.3K0
Spring 和 Spring Boot
Spring 和 Spring Boot
很多在开始的时候可能对 Spring 和 Spring boot 之间的关系可能有些混淆,在开始的时候如果能够对这 2 个概念有所了解的话,能够对后面的使用起到一些帮助作用。
HoneyMoose
2021/02/24
2.3K0
Spring 和 Spring Boot
Spring boot
Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can "just run".
用户7891378
2020/10/25
6240
Spring Boot
解释一下:Spring Boot 可以构建一切。Spring Boot 设计之初就是为了最少的配置,最快的速度来启动和运行 Spring 项目。Spring Boot 使用特定的配置来构建生产就绪型的项目。
纯洁的微笑
2019/09/05
1.3K1
Spring -> Spring Boot > Spring Cloud
想学习就必须得知道什么是微服务,什么是Spring Boot,什么是Spring Cloud,以及两者之间有什么关系?
Dawnzhang
2018/10/18
3.1K0
Spring Boot(五):Spring Boot Jpa 的使用
在上篇文章《Spring Boot(二):Web 综合开发》中简单介绍了一下 Spring Boot Jpa 的基础性使用,这篇文章将更加全面的介绍 Spring Boot Jpa 常见用法以及注意事项。
纯洁的微笑
2019/05/06
2.8K0
Spring Boot(五):Spring Boot Jpa 的使用
Spring Boot Application 监控利器: Spring Boot Actuator
接触和使用 Spring Boot,当然要知道 Spring Boot 的四大核心,包括:
happyJared
2019/04/18
2.8K0
SpringBoot源码分析之SpringApplication构造方法核心源码分析
  前面给大家介绍了SpringBoot启动的核心流程,本文开始给大家详细的来介绍SpringBoot启动中的具体实现的相关细节。
用户4919348
2022/01/07
4340
SpringBoot源码分析之SpringApplication构造方法核心源码分析
Spring Boot---(1)新建Spring Boot 项目
至此,项目就创建完成了。我们如果在启动类上加上@RestController (具体用法后面会介绍:Spring Boot---(5)SpringBoot常用注解),然后写个接口,就可以访问了,如下:
IT云清
2019/01/22
5890
Spring Boot(十七):使用 Spring Boot 上传文件
上传文件是互联网中常常应用的场景之一,最典型的情况就是上传头像等,今天就带着带着大家做一个 Spring Boot 上传文件的小案例。
纯洁的微笑
2019/09/25
1.1K0
Spring Boot(十七):使用 Spring Boot 上传文件

相似问题

org.springframework.context.ApplicationContextInitializer :java.lang.ClassNotFoundException

20

Spring boot 2.0.0.RELEASE java.lang.ClassNotFoundException: Spring

31

spring boot和maven build上的java.lang.ClassNotFoundException

12

Spring Boot 2升级java.lang.ClassNotFoundException: EmbeddedServletContainerCustomizer

2137

spring boot java.lang.ClassNotFoundException: org.dom4j.io.STAXEventReader

012
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
社区富文本编辑器全新改版!诚邀体验~
全新交互,全新视觉,新增快捷键、悬浮工具栏、高亮块等功能并同时优化现有功能,全面提升创作效率和体验
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文