Jfinal 编译运行问题
1. undertow
如何配置静态资源映射
Windows
下的路径必须是/
,不能是\
.
undertow.resourcePath=src/main/webapp,C:/Users/apple/image_resources,classpath:webapp`
2. 新建模块运行报错: 需要重载包含该模块的主pom.xml
文件
Connected to the target VM, address: '127.0.0.1:26427', transport: 'socket'
Starting JFinal 4.9.15 -> http://127.0.0.1:8080
Info: jfinal-undertow 2.5, undertow 2.0.34.Final, jvm 11.0.11
java.lang.ClassNotFoundException: com.xxx.module.article.ArticleProxy
...
java.lang.NullPointerException
at com.jfinal.plugin.activerecord.Model.findAll(Model.java:766)
3. 部署后外网无法问题
undertow.host=0.0.0.0
4. DemoConfig
运行出错
pom.xml
里添加对servelt.api
的依赖和部署打包.
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
</dependency>
Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/ServletException
at com.demo.common.DemoConfig.main(DemoConfig.java:31)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 1 more
参考
- jfinal-undertow 常见问题