Can not permit Java encoding names in Tomcat6

二次信任 提交于 2020-01-05 10:32:00

问题


On two supposedly identical machines, I am having two different startup results for Tomcat 6.0.24. I am using Java version 1.7_09 on both, yet get wildly different results.

The problem is that I apparently can not use Java encoding names in Tomcat6, as stated below:

May 6, 2013 4:01:43 p.m. org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib64/gcj-4.4.7
May 6, 2013 4:01:43 p.m. org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 6, 2013 4:01:43 p.m. org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 560 ms
May 6, 2013 4:01:43 p.m. org.apache.catalina.users.MemoryUserDatabase open
WARNING: Exception configuring digester to permit java encoding names in XML files. Only IANA encoding names will be supported.
org.xml.sax.SAXNotSupportedException: http://apache.org/xml/features/allow-java-encodings
   at gnu.xml.stream.SAXParserFactory.setFeature(libgcj.so.10)
   at org.apache.tomcat.util.digester.Digester.setFeature(Digester.java:556)
   at org.apache.catalina.users.MemoryUserDatabase.open(MemoryUserDatabase.java:391)
   at org.apache.catalina.users.MemoryUserDatabaseFactory.getObjectInstance(MemoryUserDatabaseFactory.java:103)
   at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
   at javax.naming.spi.NamingManager.getObjectInstance(libgcj.so.10)
   at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
   at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
   at org.apache.naming.NamingContextBindingsEnumeration.nextElementInternal(NamingContextBindingsEnumeration.java:113)
   at org.apache.naming.NamingContextBindingsEnumeration.next(NamingContextBindingsEnumeration.java:71)
   at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:137)
   at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.createMBeans(GlobalResourcesLifecycleListener.java:109)
   at org.apache.catalina.mbeans.GlobalResourcesLifecycleListener.lifecycleEvent(GlobalResourcesLifecycleListener.java:81)
   at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:703)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:593)
   at java.lang.reflect.Method.invoke(libgcj.so.10)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
May 6, 2013 4:01:43 p.m. org.apache.catalina.core.StandardService start

However, on another machine I get a successful start:

May 06, 2013 11:03:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
May 06, 2013 11:03:57 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 06, 2013 11:03:57 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 757 ms
May 06, 2013 11:03:57 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 06, 2013 11:03:57 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.24
May 06, 2013 11:03:57 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive nexus.war
2013-05-06 11:03:58 INFO  [main           ] - org.sonatype.appcontext.AppContext - 
Application context "nexus" dump:
"nexus-work"="/usr/share/tomcat6/sonatype-work/nexus" (raw: "${user.home}/sonatype-work/nexus", src: propsFile(/var/lib/tomcat6/webapps/nexus/WEB-INF/plexus.properties))
"runtime"="/var/lib/tomcat6/webapps/nexus/WEB-INF" (raw: "${bundleBasedir}", src: propsFile(/var/lib/tomcat6/webapps/nexus/WEB-INF/plexus.properties))
"pr.encryptor.publicKeyPath"="/apr/public-key.txt" (raw: "/apr/public-key.txt", src: propsFile(/var/lib/tomcat6/webapps/nexus/WEB-INF/plexus.properties))
"application-conf"="/usr/share/tomcat6/sonatype-work/nexus/conf" (raw: "${nexus-work}/conf", src: propsFile(/var/lib/tomcat6/webapps/nexus/WEB-INF/plexus.properties))
"nexus-app"="/var/lib/tomcat6/webapps/nexus/WEB-INF" (raw: "${runtime}", src: propsFile(/var/lib/tomcat6/webapps/nexus/WEB-INF/plexus.properties))
"security-xml-file"="/usr/share/tomcat6/sonatype-work/nexus/conf/security.xml" (raw: "${nexus-work}/conf/security.xml", src: propsFile(/var/lib/tomcat6/webapps/nexus/WEB-INF/plexus.properties))
"bundleBasedir"="/var/lib/tomcat6/webapps/nexus/WEB-INF" (raw: "/var/lib/tomcat6/webapps/nexus/WEB-INF", src: static("bundleBasedir"="/var/lib/tomcat6/webapps/nexus/WEB-INF"))
Total of 7 entries.

2013-05-06 11:04:02 INFO  [main           ] - org.sonatype.sisu.goodies.eventbus.internal.DefaultEventBus - Using Reentrant Guava EventBus
2013-05-06 11:04:02 INFO  [main           ] - org.sonatype.sisu.ehcache.CacheManagerComponentImpl - Configuring EHCache CacheManager from classpath.
2013-05-06 11:04:02 INFO  [main           ] - org.sonatype.security.configuration.source.FileSecurityConfigurationSource - Loading Security configuration from /usr/share/tomcat6/sonatype-work/nexus/conf/security-configuration.xml
2013-05-06 11:04:03 INFO  [main           ] - org.sonatype.nexus.DefaultNexus - 
-------------------------------------------------

Initializing Sonatype Nexus 2.3.1-01

I do not know what is different between the two that would allow one machine to permit Java encoding, while another can not.


回答1:


Very similar problem with a solution (related to a missing jar) outlined in the oracle forums that might be useful.:

https://forums.oracle.com/thread/2394329



来源:https://stackoverflow.com/questions/16402786/can-not-permit-java-encoding-names-in-tomcat6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!