idea运行时编译文件报错

使用IDEA创建Maven项目,模拟 jfinal_demo_for_maven 项目。项目启动后修改controller类内容后Ctrl+S → Ctrl+F9 进行编译,结果报错,项目停止。

报错内容:

Loading changes ......

Exception in thread "HotSwapWatcher" java.lang.NoClassDefFoundError: com/demo/blog/BlogController

at com.demo.common.DemoConfig.configRoute(DemoConfig.java:52)

at com.jfinal.core.Config.configJFinal(Config.java:54)

at com.jfinal.core.JFinal.init(JFinal.java:61)

at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:62)

at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)

at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)

at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:589)

at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:554)

at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)

at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:596)

at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:270)

at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:248)

at com.jfinal.server.undertow.UndertowServer.restart(UndertowServer.java:396)

at com.jfinal.server.undertow.hotswap.HotSwapWatcher.doRun(HotSwapWatcher.java:133)

at com.jfinal.server.undertow.hotswap.HotSwapWatcher.run(HotSwapWatcher.java:91)

Caused by: java.lang.ClassNotFoundException: com.demo.blog.BlogController

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)

at com.jfinal.server.undertow.hotswap.HotSwapClassLoader.loadClass(HotSwapClassLoader.java:106)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 16 more


评论区

JFinal

2018-12-19 15:14

可能是 IDEA 配置问题,将 jfinal demo for maven 直接跑一跑,是没有这个问题的

JFinal

2019-02-28 17:42

@再次表明 @vigo 直接导入项目,不要做任何多余的配置,立即启动即可

vigo

2019-02-28 18:37

@JFinal 谢谢,我刚刚发现了,配置是对的,但是我用的idea版本太老了,没有升级,升级成2018.3.4就可以了

热门反馈

扫码入社