【实战问题】【5】Spring boot报错java.awt.HeadlessException

解决方案:

1,在入口类里修改成以下代码,其中YourApplication改成你的入口类的名字

SpringApplicationBuilder builder = new SpringApplicationBuilder(YourApplication.class);
builder.headless(false).web(false).run(args);

2,在VM的Option里加上一句-Djava.awt.headless=false。然后启动

参考博客:

Spring boot出现java.awt.HeadlessException的解决办法 - 一起来书写我们的青春 - CSDN博客
https://blog.csdn.net/tudaodiaozhale/article/details/72620984

原文地址:https://www.cnblogs.com/huashengweilong/p/10807076.html

时间: 2024-08-30 06:30:41

【实战问题】【5】Spring boot报错java.awt.HeadlessException的相关文章

Spring Boot 报错:Error creating bean with name 'entityManagerFactory' defined in class path resource

spring boot 写一个web项目,在使用spring-data-jpa的时候,启动报如下错误: Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.2018-04-02 17:00:47.076 ERROR 4648 --- [ main] o.s.boot.SpringApplication : A

Spring Boot 报错记录

Spring Boot 报错记录 由于新建的项目没有配置数据库连接启动报错,可以通过取消自动数据源自动配置来解决 解决方案1: @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) //@SpringBootApplication @MapperScan("com.example.*") //扫描:该包下相应的class,主要是MyBatis的持久化类. 解决方案2: #去配置文件中配置数据库连接参数 #

Spring Boot报错Error creating bean with name 'userRepository': Invocation of init method failed; nested exception

问题:出现UserRePository注入创建失败,一定先检查所有的@注解是否已经标记 问题发现:entity下的实体类上面没有加注解  任何基于hibernate的实体类一定要加上@Entity注解! Spring Boot报错Error creating bean with name 'userRepository': Invocation of init method failed; nested exception 原文地址:https://www.cnblogs.com/my-prog

Spring Boot报错:java.lang.IllegalArgumentException: An invalid character [..] was present in the Cookie value

原因及解决办法:https://docs.spring.io/spring-boot/docs/2.0.3.RELEASE/reference/htmlsingle/#howto-use-tomcat-legacycookieprocessor @Configuration public class CookieConfig { /** * 解决问题: * There was an unexpected error (type=Internal Server Error, status=500)

spring+quartz报错:Table 'BANKSTEELERP_OLD.QRTZ_TRIGGERS' doesn't exist

spring3.2.8 + quartz2.2.1配置到application.xml中 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'startQuertz' defined in class path resource [application.xml]: Invocation of init method failed; nested exception is

使用maven多模块来构建系统时,spring初始化报错的问题

最近在实验maven结构的maven工程时,碰到一个问题,springbean总是初始化失败: Related cause: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userMapper' defined in file [D:\workspace\mavenweb\mavenweb-webapp\src\main\webapp\WEB-INF

Spring AOP报错处理 Can not set field to $Proxy 在spring中使用事物或AOP遇到的错误

[转] 解决方法: http://forum.springsource.org/showthread.php?85016-IllegalArgumentException-with-ApplicationContextAware-Proxy 在配置文件中加入proxy-target-class="true" <tx:annotation-driven transaction-manager="transactionManager" proxy-target-c

Webservice报错java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionRead

用spring集成发布一个Webservice服务,老是报错: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlBeanDefinitionReader.setValidationMode(I)V at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.<init>(XBeanXmlBeanDefinitionReader.j

junit报错java.lang.Exception: No tests found matching

junit报错java.lang.Exception: No tests found matching 最近在学习Spring的过程中用到了Junit,然而中间遇到了个令人十分捉狂的报错. 1 java.lang.Exception: No tests found matching [{ExactMatcher:fDisplayName=cdShouldNotBeNull], {ExactMatcher:fDisplayName=cdShouldNotBeNull(soundsystem.CDP