开发者

Error when migrating web.xml from Java EE 5 to Java EE 6

开发者 https://www.devze.com 2023-03-30 03:26 出处:网络
I am experiencing problems with my app since I migrated web.xml from Java-EE-5 to Java-EE-6. Here is the stacktrace I get when I deploy my app:

I am experiencing problems with my app since I migrated web.xml from Java-EE-5 to Java-EE-6. Here is the stacktrace I get when I deploy my app:

24 août 2011 14:10:45 org.apache.catalina.startup.HostConfig deployDescriptor
GRAVE: Erreur lors du déploiement du descripteur de configuration ROOT.xml
java.lang.IllegalAccessError: class javax.xml.parsers.SecuritySupport12 cannot access its superclass javax.xml.parsers.SecuritySupport
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2818)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1148)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1643)
    at org.apache.catalina.loader.Webap开发者_如何学CpClassLoader.loadClass(WebappClassLoader.java:1521)
    at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1948)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1911)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1800)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1768)
    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1754)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1266)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:633)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:525)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1377)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1436)
    at org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:856)
    at org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:353)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:572)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
24 août 2011 14:10:47 org.apache.catalina.startup.HostConfig deployDescriptor

header from web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0"> 

ROOT.xml:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="/home/julien/Documents/jeanbaptistemartin.com/java/site/jeanbaptistemartin/target/ROOT" path="/ROOT"/>


This blog post (in a comment above by @balteo) has the answer:

Add metadata-complete="true" in your web.xml to override default properties of 3.0 for annotations. By default, Tomcat 7 will scan all of your class files for annotations and attempt to deploy any classes found with web descriptors it understands. Setting metadata-complete tells tomcat that the web.xml and other descriptor files are complete, and not to bother with the annotations.

This solution seems to work, but it doesn't really satisfy me, because I have been deploying the same war on multiple tomcat 7 servers without a problem, but when we finally deployed to production we got this error. I'm still unsure why our production server would be any different from the test servers.

0

精彩评论

暂无评论...
验证码 换一张
取 消