JFinal用tomcat启动报错

Java_Coder 发布于 2015/12/09 16:13
阅读 1K+
收藏 0


求解答。。

错误信息:

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>




加载中
0
天蓬小猪
天蓬小猪
com.demo.jfinal.config.CoreConfig 这是个什么鬼?我记得demo里面没有这个类啊!!把这个地方改改,搞不定的就是看视频吧,没有视频链接就私信我
Java_Coder
Java_Coder
com.demo.jfinal.config.CoreConfig,这个是我自己定义的类。是jar包的问题。。。
0
陌生、路人甲
陌生、路人甲

com.demo.jfinal.config.CoreConfig 配置错误 上次给一个新人解决了这个问题 不记得怎么解决的了 看看官网的demo

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