1

在两台假定相同的机器上,我对 Tomcat 6.0.24 有两个不同的启动结果。我在两者上都使用 Java 版本 1.7_09,但得到的结果却大相径庭。

问题是我显然不能在 Tomcat6 中使用 Java 编码名称,如下所述:

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

但是,在另一台机器上,我成功启动:

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

我不知道两者之间有什么不同,即允许一台机器允许 Java 编码,而另一台则不能。

4

1 回答 1

0

与甲骨文论坛中概述的可能有用的解决方案(与缺少 jar 相关)的非常相似的问题:

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

于 2013-08-28T18:26:31.497 回答