失败 - 无法启动上下文路径/ Healthlink中的应用程序

时间:2013-09-17 16:20:52

标签: java tomcat netbeans

我想用Windows中netbeans生成的.war文件部署它,我的项目是一个Web应用程序,我想在LINUX(LUBUNTU)中运行,但我无法启动它。我正在使用经理gui。

请帮我解决此错误。我是linux的新手。

Sep 18, 2013 12:01:45 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/i386:/lib:/usr/lib

Sep 18, 2013 12:01:46 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-bio-8080"]

Sep 18, 2013 12:01:47 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-bio-8009"]

Sep 18, 2013 12:01:47 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 3021 ms

Sep 18, 2013 12:01:47 AM org.apache.catalina.core.StandardService startInternal

INFO: Starting service Catalina

Sep 18, 2013 12:01:47 AM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.42

Sep 18, 2013 12:01:47 AM org.apache.catalina.startup.HostConfig deployWAR

INFO: Deploying web application archive /usr/tomcat/apache-tomcat-7.0.42/webapps/Healthlink.war

Sep 18, 2013 12:01:52 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart

Sep 18, 2013 12:01:52 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [147] milliseconds.
Sep 18, 2013 12:01:52 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Healthlink] startup failed due to previous errors
Sep 18, 2013 12:01:52 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Healthlink] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Sep 18, 2013 12:01:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/host-manager
Sep 18, 2013 12:01:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/ROOT
Sep 18, 2013 12:01:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/examples
Sep 18, 2013 12:01:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/docs
Sep 18, 2013 12:01:54 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/manager
Sep 18, 2013 12:01:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 12:01:54 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 18, 2013 12:01:54 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7183 ms
Sep 18, 2013 12:03:32 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/i386:/lib:/usr/lib
Sep 18, 2013 12:03:34 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 12:03:34 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 18, 2013 12:03:34 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 4193 ms
Sep 18, 2013 12:03:35 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 18, 2013 12:03:35 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 18, 2013 12:03:35 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /usr/tomcat/apache-tomcat-7.0.42/webapps/Healthlink.war
Sep 18, 2013 12:03:40 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Sep 18, 2013 12:03:51 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [10,839] milliseconds.
Sep 18, 2013 12:03:51 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Healthlink] startup failed due to previous errors
Sep 18, 2013 12:03:51 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Healthlink] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Sep 18, 2013 12:03:51 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/host-manager
Sep 18, 2013 12:03:51 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/ROOT
Sep 18, 2013 12:03:52 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/examples
Sep 18, 2013 12:03:52 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/docs
Sep 18, 2013 12:03:52 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/manager
Sep 18, 2013 12:03:52 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 12:03:52 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 18, 2013 12:03:52 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 17665 ms
Sep 18, 2013 12:04:09 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Sep 18, 2013 12:04:09 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Healthlink] startup failed due to previous errors
Sep 18, 2013 12:04:09 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Healthlink] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Sep 18, 2013 12:06:33 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/i386:/lib:/usr/lib
Sep 18, 2013 12:06:36 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 12:06:36 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 18, 2013 12:06:36 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 5065 ms
Sep 18, 2013 12:06:36 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 18, 2013 12:06:36 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
Sep 18, 2013 12:06:36 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /usr/tomcat/apache-tomcat-7.0.42/webapps/Healthlink.war
Sep 18, 2013 12:06:42 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
Sep 18, 2013 12:06:42 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/Healthlink] startup failed due to previous errors
Sep 18, 2013 12:06:42 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/Healthlink] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Sep 18, 2013 12:06:42 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/host-manager
Sep 18, 2013 12:06:42 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/ROOT
Sep 18, 2013 12:06:43 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/examples
Sep 18, 2013 12:06:43 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/docs
Sep 18, 2013 12:06:43 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /usr/tomcat/apache-tomcat-7.0.42/webapps/manager
Sep 18, 2013 12:06:43 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 18, 2013 12:06:43 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 18, 2013 12:06:43 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7305 ms

1 个答案:

答案 0 :(得分:2)

这是你过分冗长(和重复)日志中最重要的一行:

SEVERE: Error listenerStart

这基本上意味着由@WebListener注释在类上注册的ServletContextListener实现或<listener>中的web.xml条目已在其中抛出未处理的异常contextInitialized()方法。这通常是由开发人员的错误(一个错误)引起的,需要修复。例如,NullPointerException

如果您只是通过盯着contextInitialized()方法中的代码进行单元测试来解决原因,那么您需要在项目的logging.properties中创建一个src文件文件夹(在那里你有你的Java类;它至少应该最终在构建的WAR的/WEB-INF/classes文件夹中),其中包含以下内容:

org.apache.catalina.core.ContainerBase.[Catalina].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].handlers = java.util.logging.ConsoleHandler

这将告诉Tomcat在启动侦听器(和过滤器)期间将异常记录到控制台。