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