我正在为java中的项目开发一个安全机制,我使用AccessDeniedException来限制某些项目方法中的用户访问。我与ws合作发布这种方法。我使用tomcat 7来部署我的ws。现在,当我启动tomcat 7来部署我的ws时,这就是我的IDE Eclipse控制台中的show:
GRAVE: WSSERVLET11: failed to parse runtime descriptor: java.lang.NoClassDefFoundError: java/nio/file/AccessDeniedExceptionjava.lang.NoClassDefFoundError: java/nio/file/AccessDeniedException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.getImplementorClass(DeploymentDescriptorParser.java:545)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:223)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)Caused by: java.lang.ClassNotFoundException: java.nio.file.AccessDeniedException
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 16 more
我使用jre7虽然我已经将jre6和jre8导入了我的项目。我在我的代码中导入了java.nio.file.AccessDeniedException类。我不明白在这种情况下发生了什么。如果我的项目没有找到java.nio.file.AccessDeniedException类。提前谢谢。