我最近(几乎)完成了我正在处理的合同的应用程序,并且正在将当前实例从我的工作计算机移植到生产服务器,以便在我执行开发的最后步骤之前解决任何问题,我遇到了一些配置问题。任何帮助将不胜感激。
我正要开始工作并检查操作系统版本,但显然有人将其关闭了……我认为它正在运行 Natty 或 Oneiric。生产服务器正在运行 Redhat Enterprise 5。
我的 destkop (Ubuntu) 上的 Web 应用程序由 apache2 托管。它是一个带有代理的网页,通过 AJP 将流量路由到同一台计算机上的 tomcat6 实例。此代理仅受到从网页发起的 AJAX 请求的影响。
我正在将此应用程序移植到已经安装了 tomcat 的 Red Hat 实例。RELEASE-NOTES 表示它是 7.0.23 版本。在我加入我的 webapp 之前,我想测试一下 tomcat 的功能。我在 webapps/ 中创建了一个虚拟 webapp 文件夹,并在其中创建了一个 index.html 文件,并尝试通过网络浏览器进行连接,但没有成功。
启动 tomcat 会产生以下日志:
Apr 19, 2013 5:38:22 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/lib/jvm/java-\
1.6.0-sun-1.6.0.41.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-sun-1.6.0.41.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-sun-1.6.0.41.x86_64/jre/../lib/amd64:/\
usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Apr 19, 2013 5:38:22 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
Apr 19, 2013 5:38:23 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 19, 2013 5:38:23 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 19, 2013 5:38:23 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1364 ms
Apr 19, 2013 5:38:23 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 19, 2013 5:38:23 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Apr 19, 2013 5:38:23 AM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardCo\ntext[]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1100)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:782)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
... 7 more
Caused by: java.lang.UnsupportedClassVersionError: com/dell/oma/common/OMASessionListener : Unsupported major.minor version 51.0 (unable to load class com.dell.oma.com\mon.OMASessionListener)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2827) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1655)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
...以及其他一些非常相似的故障(子容器)。
这是我的 $TOMCAT/conf/server.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context debug="0" docBase="omsa" path="">
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
</Context>
</Host>
</Engine>
</Service>
</Server>
我对 servlet 和 xml 配置还是有点陌生。如果我遗漏了任何必要的信息,请告诉我,我将发布编辑。感谢大家的帮助。这让我困扰了一两天。