我正在尝试通过Eclipse中的Tomcat运行war文件。但是,当我尝试运行它时,我在服务器控制台中收到以下错误:
Aug 2, 2013 4:06:58 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/Users/kajarigd/J2EEProject/eclipse/Eclipse.app/Contents/MacOS/lib], exists: [false], isDirectory: [false], canRead: [false]
Aug 2, 2013 4:06:58 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/Users/kajarigd/J2EEProject/eclipse/Eclipse.app/Contents/MacOS/lib], exists: [false], isDirectory: [false], canRead: [false]
Aug 2, 2013 4:06:58 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/Users/kajarigd/J2EEProject/eclipse/Eclipse.app/Contents/MacOS/lib], exists: [false], isDirectory: [false], canRead: [false]
Aug 2, 2013 4:06:58 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/Users/kajarigd/J2EEProject/eclipse/Eclipse.app/Contents/MacOS/lib], exists: [false], isDirectory: [false], canRead: [false]
java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
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:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:236)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:426)
请让我知道如何解决这个问题。
答案 0 :(得分:7)
您的项目应该创建为动态Web项目。
由于您的项目已经创建,因此您应该向其添加动态Web模块构面。
右键点击该项目 - >属性 - >项目方面 - >检查动态Web模块方面 - >行。