“Error java.lang.NoSuchFieldError:IS_DIR”同时从Eclipse启动Apache Tomcat [英] "Error java.lang.NoSuchFieldError: IS_DIR" while starting Apache Tomcat from Eclipse
问题描述
在尝试从eclipse启动Apache Tomcat时,我遇到以下错误:
While trying to start Apache Tomcat from eclipse, I encounter the following error:
18 Nov, 2010 5:23:03 PM org.apache.catalina.startup.Bootstrap initClassLoaders
SEVERE: Class loader creation threw exception
java.lang.NoSuchFieldError: IS_DIR
at org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:166)
at org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:91)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:206)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)
我使用tomcat 6.0.18,并尝试使用6.0.29。我只需在Window> Preferences> Tomcat中输入tomcat路径。 Eclipse是版本3.5。
I use tomcat 6.0.18, and also tried with 6.0.29. I just enter the tomcat path in the Window > Preferences > Tomcat. Eclipse is version 3.5.
什么似乎是问题?
推荐答案
您似乎在运行时类路径中有过时的Tomcat核心库版本,在类加载中优先。清理您的运行时类路径,以摆脱不属于它们的Tomcat特定库。这涵盖了其中 / WEB-INF / lib
, JRE / lib
, JRE / lib / EXT
。 Tomcat特定的库应该保存在自己的 Tomcat / lib
文件夹中,永远不要复制/移动。
You seem to have outdated versions of the Tomcat core libraries in the runtime classpath which got precedence in classloading. Cleanup your runtime classpath to get rid of Tomcat specific libraries where they don't belong. This covers among others /WEB-INF/lib
, JRE/lib
, JRE/lib/ext
. Tomcat specific libraries should be kept in its own Tomcat/lib
folder and never be copied/moved around.
一个href =http://tomcat.apache.org/tomcat-4.0-doc/catalina/docs/api/org/apache/catalina/startup/ClassLoaderFactory.html =nofollow> Tomcat 4.0 例如确实没有这个字段,但是 Tomcat 6.0 。
Tomcat 4.0 for example does indeed not have this field, but Tomcat 6.0 do.
这篇关于“Error java.lang.NoSuchFieldError:IS_DIR”同时从Eclipse启动Apache Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!