Dienstag, 9. April 2013

Exception during startup from Tomcat 6 - org.apache.catalina.users.MemoryUserDatabase

if you face this Exception during the starting from tomcat
org.apache.catalina.users.MemoryUserDatabase - Exception configuring digester to permit java encoding names in XML files. Only IANA encoding names will be supported.
org.xml.sax.SAXNotRecognizedException: http://apache.org/xml/features/allow-java-encodings
 at oracle.xml.jaxp.JXSAXParserFactory.setFeature(JXSAXParserFactory.java:129) ~[xmlparserv2-11.1.0.7.jar:na]
 at org.apache.tomcat.util.digester.Digester.setFeature(Digester.java:556) ~[tomcat-coyote.jar:6.0.35]
 at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:391) ~[catalina.jar:6.0.35]
 at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103) [catalina.jar:6.0.35]
 at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140) [catalina.jar:6.0.35]
 at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:321) [na:1.7.0_09]
 at org.apache.naming.NamingContext.lookup(NamingContext.java:793) [catalina.jar:6.0.35]
 at org.apache.naming.NamingContext.lookup(NamingContext.java:140) [catalina.jar:6.0.35]
 at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113) [catalina.jar:6.0.35]
 at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71) [catalina.jar:6.0.35]
 at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137) [catalina.jar:6.0.35]
 at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109) [catalina.jar:6.0.35]
 at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81) [catalina.jar:6.0.35]
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) [catalina.jar:6.0.35]
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:747) [catalina.jar:6.0.35]
 at org.apache.catalina.startup.Catalina.start(Catalina.java:595) [catalina.jar:6.0.35]
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_09]
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_09]
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_09]
 at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_09]
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) [bootstrap.jar:6.0.35]
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) [bootstrap.jar:6.0.35]
you should add the following properties to TOMCAT_HOME/conf/catalina.properties:
javax.xml.parsers.DocumentBuilderFactory=com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl
javax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl
javax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
javax.xml.datatype.DatatypeFactory=com.sun.org.apache.xerces.internal.jaxp.datatype.DatatypeFactoryImpl
With this properties you tell the tomcat and the underlying JVM which XML related factories it should use. Theses factories where delivered with each jdk but mostly the JDKs are configured to use other factories. It happend to me with JDK 1.7.09 and JRockit 1.6.0_31-R28.2.3-4.1.0 on tomcat 6.0.35

Kommentare:

  1. Thank you! This solved our problem on JDK 1.8 and Tomcat 8.5.

    AntwortenLöschen
  2. Run into the same problem, and your tip solved it. Thanks.

    AntwortenLöschen