Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
前面一段时间看到 Tomcat7.0 发布了几个测试版,由于没有稳定,也就没有测试了,今天看到新闻,看到 Tomcat7.0 正式版已经发布了,到官网上下载下来,看看效果如何。
下面列出 Tomcat 7 的一些新特性介绍:
◆ Tomcat 7 完全支持 Servlet 3.0 规范
◆ Tomcat 7 新增了对 Java 注释的支持
◆ Tomcat 7 通过 web.xml 动态配置引用类库的功能
◆ Tomcat 7 改进了安全回话的跟踪
◆ Tomcat 7 改进了关系服务时候的功能,让关闭时的地址可以配置
◆ Tomcat 7 改进了启动类,目前 Tomcat 7 启动过程无须任何配置文件
◆ Tomcat 7 新增了配置参数,可以配置 Tomcat 7 的执行队列超时时间,和执行大大小限制
… …
新特性带来的是方便和更好地支持 Java 新特性。感觉 Tomcat7 对 Servlet3.0 的支持和 Java Annotaion 的支持是应现在流行 0 配置或尽量减少配置文件的需要, Servlet3.0 的到来,感觉最深地是带来直接在 code level 直接 Annotation 即可配置一个 Servlet ,并不需要以前的在 web.xml 下配置了。
下载 Tomcat7.0 后,和 MyEclipse 进行整合, MyEclipse 配置 Tomcat7.0 如下图
发现在启动的时候报了一个错误
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
at org.apache.catalina.startup.Bootstrap.<clinit>( Bootstrap.java:55 )
Caused by: java.lang.ClassNotFoundException : org.apache.juli.logging.LogFactory
at java.net.URLClassLoader$1.run( URLClassLoader.java:202 )
at java.security.AccessController.doPrivileged( Native Method )
at java.net.URLClassLoader.findClass( URLClassLoader.java:190 )
at java.lang.ClassLoader.loadClass( ClassLoader.java:307 )
at sun.misc.Launcher$AppClassLoader.loadClass( Launcher.java:301 )
at java.lang.ClassLoader.loadClass( ClassLoader.java:248 )
... 1 more
Exception in thread "main"
到网上搜索了一下,比较好解决,有个网址 http://mianniu.com/programming-world/java-lang-noclassdeffounderror-orgapachejulilogginglogfactory-at-org-apache-catalina-startup-bootstrap 上说
Solutions 1. In Eclipse, Open the “Server” tab.
2. Double click on the “Tomcat6″ entry to see the configuration.
3. Then click on the “Open launch configuration” link in the “General information” block.
4. In the dialog, select the “Classpath” tab.
5. Click the “Add external jar” button.
6. Select the file “/usr/share/tomcat6/bin/tomcat-juli.jar”
7. Close the dialog.
8. Start tomcat 6 from Eclipse.
实际上,就是把 bin/tomcat-juli.jar 下 add tomcat classpath 下,效果如下:
重新启动 Tomcat7.0 ,发现启动成功。
http://www.cnblogs.com/sunlinwh/archive/2011/01/21/1941374.html
作者: Leo_wl
出处: http://www.cnblogs.com/Leo_wl/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
版权信息查看更多关于Tomcat无法启动,报错java.lang.NoClassDefFoundError: org/a的详细内容...