开发者社区> 问答> 正文

JFinal用tomcat启动报错?报错


求解答。。

错误信息:

SEVERE: Exception starting filter jfinal
java.lang.ClassNotFoundException: com.jfinal.core.JFinalFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5542)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)



web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">


<filter>
<filter-name>jfinal</filter-name>
<filter-class>com.jfinal.core.JFinalFilter</filter-class>
<init-param>
<param-name>configClass</param-name>
<param-value>com.demo.jfinal.config.CoreConfig</param-value>
</init-param>
</filter>


<filter-mapping>
<filter-name>jfinal</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


</web-app>


pom.xm:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>


<groupId>com.demo</groupId>
<artifactId>Jfinal</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>


<name>Jfinal</name>
<url>http://maven.apache.org</url>


<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


<dependencies>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.jfinal</groupId>
<artifactId>jfinal</artifactId>
<version>2.0</version>
</dependency>


</dependencies>
</project>


<p>
	<span style="line-height:1.5;font-size:10pt;"><br>


展开
收起
爱吃鱼的程序员 2020-06-10 10:13:06 961 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    com.demo.jfinal.config.CoreConfig这是个什么鬼?我记得demo里面没有这个类啊!!把这个地方改改,搞不定的就是看视频吧,没有视频链接就私信我
    com.demo.jfinal.config.CoreConfig,这个是我自己定义的类。是jar包的问题。。。

    <spanstyle="font-family:Verdana,sans-serif,宋体;font-size:14px;background-color:#FFFFFF;">com.demo.jfinal.config.CoreConfig配置错误上次给一个新人解决了这个问题不记得怎么解决的了看看官网的demo

    回复<aclass='referer'target='_blank'>@陌生、路人甲:jfinal-1.9-bin-with-src.jar这个包我忘记了添加,导致找不到JFinalFilter这个类了。回复<aclass='referer'target='_blank'>@Java_Coder:具体说明下吧下次别人看到就不是问题已经解决了配置没有问题,我找到原因了,jar包的问题。。。

    2020-06-10 10:13:23
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Apache Tomcat 的云原生演进 立即下载
Apache Dubbo3 源码深入解读 立即下载
低代码开发师(初级)实战教程 立即下载