Score
0
3.5K Unstar Star 9.5K Fork 4K

卓源软件 / JeeSite 4.2JavaAGPL-3.0

idea里面无法直接run

Closed
alvin-hujh  Opened this issue

我用tomcat可以启动,但是直接run application就会报错如图
报错截图

本机的Java和maven都是配置好的
Java和maven配置

下面是报错详情

03-06 17:18:53.261 ERROR [org.springframework.boot.SpringApplication] - Application startup failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.jeesite.modules.config.Application]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:181)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
	at com.jeesite.modules.config.Application.main(Application.java:24)
Caused by: java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.support.SpringBootServletInitializer
	at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:163)
	at org.springframework.context.annotation.ConfigurationClassParser.retrieveBeanMethodMetadata(ConfigurationClassParser.java:380)
	at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:314)
	at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:198)
	at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:167)
	... 10 common frames omitted
Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContext
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at org.springframework.core.type.StandardAnnotationMetadata.getAnnotatedMethods(StandardAnnotationMetadata.java:152)
	... 15 common frames omitted
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 19 common frames omitted
6732 thinkgem 1578914432 total 7 participants

Comments (7)

rockxue 2018-03-06 23:12

我和你是一样的错误。

时间下的阴影 2018-03-07 09:03

是不能直接使用spring boot启动,我用tomcat启动的。

听说so 2018-03-07 11:17

我也是报这个错,你们有解决办法么

alvin-hujh 2018-03-08 14:35

@时间下的阴影 spring boot项目正常都应该能直接run的啊,为啥不能直接用这种方式呢,tomcat我也可以成功启动

6732 thinkgem 1578914432
卓源软件 2018-03-10 11:52 owner

介绍里的常见问题有说明,谢谢你的提问。

IntelliJ IDEA中提示NoClassDefFoundError: javax/servlet/ServletOutputStream错误,你只需要修改web项目下的pom.xml,注释掉spring-boot-starter-tomcat的provided部分改为compile即可。

cuishi 2018-07-07 12:36

@时间下的阴影 弄好了没 什么原因?

玉雨清农 2019-04-01 17:57

我修改了web项目下的pom.xml,注释掉spring-boot-starter-tomcat的provided部分改为compile。但是还是报同样的错误

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
Java
1
https://gitee.com/thinkgem/jeesite4.git
git@gitee.com:thinkgem/jeesite4.git
thinkgem
jeesite4
JeeSite 4.2

Search

131423 f1aaba0b 1899542 094922 1c74bed3 1899542