技术菜鸟,请求前辈指导!!!!在tomcat中 启动报错 jetty.jar已删除

xlati 发布于 2014/04/03 20:24
阅读 1K+
收藏 0

学习了jfinal几天,觉的很不错,很方便容易上手,写的很爽

一直是用jetty运行,也写了几个测试功能出来,但在tomcat里运行就出问题了,技术菜鸟,请求前辈指导!

2014-4-3 23:23:43 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded APR based Apache Tomcat Native library 1.1.22.
2014-4-3 23:23:43 org.apache.catalina.core.AprLifecycleListener init
信息: APR capabilities: IPv6 [false], sendfile [true], accept filters [false], random [true].
2014-4-3 23:23:44 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2014-4-3 23:23:44 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2014-4-3 23:23:44 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1578 ms
2014-4-3 23:23:44 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2014-4-3 23:23:44 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.35
2014-4-3 23:23:44 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2014-4-3 23:23:45 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2014-4-3 23:23:45 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2014-4-3 23:23:45 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2014-4-3 23:23:45 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2014-4-3 23:23:45 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2014-4-3 23:23:45 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory jfinalauthority
2014-4-3 23:23:45 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(F:\Tool\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35\webapps\jfinalauthority\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
2014-4-3 23:23:46 org.apache.catalina.core.ApplicationContext log
信息: Initializing Shiro environment
Init SecureRandom.
2014-4-3 23:23:49 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter jfinal
java.lang.NoClassDefFoundError: WebAppClassLoader
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.jfinal.ext.kit.Reflect.forName(Reflect.java:692)
at com.jfinal.ext.kit.Reflect.on(Reflect.java:85)
at com.jfinal.ext.kit.ClassSearcher.extraction(ClassSearcher.java:38)
at com.jfinal.ext.kit.ClassSearcher.search(ClassSearcher.java:169)
at com.jfinal.ext.route.AutoBindRoutes.config(AutoBindRoutes.java:84)
at com.jfinal.config.Routes.add(Routes.java:40)
at com.jayqqaa12.common.MyConfig.configRoute(MyConfig.java:80)
at com.jfinal.core.Config.configJFinal(Config.java:47)
at com.jfinal.core.JFinal.init(JFinal.java:68)
at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:49)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4072)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4726)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: WebAppClassLoader
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 47 more
2014-4-3 23:23:49 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2014-4-3 23:23:49 org.apache.catalina.core.StandardContext start
严重: Context [/jfinalauthority] startup failed due to previous errors
2014-4-3 23:23:49 org.apache.catalina.core.ApplicationContext log
信息: Cleaning up Shiro Environment
2014-4-3 23:23:49 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/jfinalauthority] appears to have started a thread named [shiro] but has failed to stop it. This is very likely to create a memory leak.
2014-4-3 23:23:49 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/jfinalauthority] appears to have started a thread named [Beetl-Scanner] but has failed to stop it. This is very likely to create a memory leak.
2014-4-3 23:23:50 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2014-4-3 23:23:50 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2014-4-3 23:23:50 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2014-4-3 23:23:50 org.apache.catalina.startup.Catalina start
信息: Server startup in 5721 ms

加载中
0
0
xlati
xlati

引用来自“wragony”的评论

差jar包

前辈,差那个jar包呢?

0
JFinal
JFinal

tomcat 下启动直接用 TOMCAT-HOME/bin/start.bat,而不能用 JFinal.start() ,因为此方法是与 jetty-server.jar 配合使用的

0
xlati
xlati

引用来自“JFinal”的评论

tomcat 下启动直接用 TOMCAT-HOME/bin/start.bat,而不能用 JFinal.start() ,因为此方法是与 jetty-server.jar 配合使用的


我是用bin/start.bat来启动,只有我是这样吗? 


0
JFinal
JFinal

引用来自“xlati”的评论

引用来自“JFinal”的评论

tomcat 下启动直接用 TOMCAT-HOME/bin/start.bat,而不能用 JFinal.start() ,因为此方法是与 jetty-server.jar 配合使用的


我是用bin/start.bat来启动,只有我是这样吗? 


     通过异常目测是 jfinal ext 在扫描路由的类时,发现了对jetty 中有关类的引用,造成对 jetty 包的类加载,从而造成找不到类的错误。

    检查一下代码,看有无对jetty 的引用,如果没有,再看一下 jfinal ext 中有无这类代码

0
xlati
xlati

引用来自“xlati”的评论

引用来自“JFinal”的评论

tomcat 下启动直接用 TOMCAT-HOME/bin/start.bat,而不能用 JFinal.start() ,因为此方法是与 jetty-server.jar 配合使用的


我是用bin/start.bat来启动,只有我是这样吗? 


     通过异常目测是 jfinal ext 在扫描路由的类时,发现了对jetty 中有关类的引用,造成对 jetty 包的类加载,从而造成找不到类的错误。

引用来自“JFinal”的评论

    检查一下代码,看有无对jetty 的引用,如果没有,再看一下 jfinal ext 中有无这类代码

这里有引用,但也不能删除

0
xlati
xlati

搞定 改下代码 不加载jetty此代码,多谢  @JFinal

@SuppressWarnings("unchecked")

    private static <T> List<Class<? extends T>> extraction(Class<T> clazz, List<String> classFileList) {
        List<Class<? extends T>> classList = Lists.newArrayList();
        for (String classFile : classFileList) {
        if(classFile.equals("com.jfinal.server.JettyServer")
           || classFile.equals("com.jfinal.server.JettyServer$1")
           || classFile.equals("com.jfinal.server.JFinalClassLoader")
        ){
        continue;
        }
            Class<?> classInFile = Reflect.on(classFile).get();
            if (clazz.isAssignableFrom(classInFile) && clazz != classInFile) {
                classList.add((Class<? extends T>) classInFile);
            }
        }


        return classList;
    }

云上太阳zr
云上太阳zr
我也是这个问题,你是改的哪里的呢?
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部