我在tomcat 7 Web服务器中部署Web应用程序时遇到问题。我试过通过ant部署我的war文件,我收到以下错误:
java.lang.NoClassDefFoundError: Could not initialize class java.nio.file.TempFileHelper
[java] at java.nio.file.Files.createTempFile(Unknown Source)
[java] at sun.net.www.protocol.jar.URLJarFile$1.run(Unknown Source)
[java] at sun.net.www.protocol.jar.URLJarFile$1.run(Unknown Source)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
[java] at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
[java] at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
[java] at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
[java] at sun.net.www.protocol.jar.JarURLConnection.getJarFile(Unknown Source)
[java] at org.apache.catalina.startup.TldConfig.tldScanJar(TldConfig.java:507)
[java] at org.apache.catalina.startup.TldConfig.access$100(TldConfig.java:59)
[java] at org.apache.catalina.startup.TldConfig$TldJarScannerCallback.scan(TldConfig.java:332)
[java] at org.apache.tomcat.util.scan.StandardJarScanner.process(StandardJarScanner.java:234)
[java] at org.apache.tomcat.util.scan.StandardJarScanner.scan(StandardJarScanner.java:159)
[java] at org.apache.catalina.startup.TldConfig.execute(TldConfig.java:306)
[java] at org.apache.catalina.startup.TldConfig.lifecycleEvent(TldConfig.java:585)
[java] at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
[java] at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
[java] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4974)
[java] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
[java] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
[java] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
[java] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
[java] at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:925)
[java] at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:723)
[java] at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
[java] at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1343)
[java] at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)
[java] at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
[java] at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
[java] at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1235)
[java] at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1393)
[java] at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1403)
[java] at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1382)
[java] at java.lang.Thread.run(Unknown Source)
Web应用程序的文件夹是在我的tomcat webapps文件夹中创建的,但在尝试通过以下方式访问应用程序时:
我收到404错误,告知该应用程序不存在。
我还尝试通过tomcat-manager部署我的应用程序,它说应用程序已正确部署,但它没有出现在tomcat应用程序列表中,但是该文件夹也是在webapps目录中创建的,当我尝试要在浏览器中访问,我得到的错误与之前相同。
我知道这肯定是一个tomcat失败,因为我尝试在另一台计算机上部署完全相同的war文件,并且它工作得很好。
有关如何解决此问题的任何建议?
答案 0 :(得分:0)
没有正确部署,因为它无法找到依赖关系jar。
无法找到此类“java.nio.file.TempFileHelper”
尝试找到该类,找出哪个jar包含该文件。
并将该jar放入WEB-INF / lib并再次尝试部署。它应该工作。