play2war / play2-war-plugin

WAR Plugin for Play framework 2.x
Apache License 2.0
443 stars 71 forks source link

War startup failure with 'Error listenerStart' - Tomcat 7.0.29 - Play2war 0.7 #83

Closed garytomorrow closed 12 years ago

garytomorrow commented 12 years ago

Hi,

Got the problem when deploy the war file to Tomcat 7.0.29. The war is generated via 0.7 plugin modules.

Any idea?

INFO: Deploying web application archive /usr/share/apache-tomcat-7.0.29/webapps/ROOT.war 2012-09-02 17:27:22,776 - [INFO] - from play in localhost-startStop-1 database [default] connected at jdbc:mysql://localhost:3306/testplay

2012-09-02 17:27:26,562 - [WARN] - from play in localhost-startStop-1 Your production database [default] needs evolutions!

!!! WARNING! This script contains DOWNS evolutions that are likely destructives

..... <here are the SQL schema/Queries> .....

2012-09-02 17:27:26,568 - [WARN] - from play in localhost-startStop-1 Run with -DapplyEvolutions.default=true if you want to run them automatically (be careful)

Sep 2, 2012 5:27:26 PM org.apache.catalina.core.StandardContext startInternal

SEVERE: Error listenerStart

Sep 2, 2012 5:27:26 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [] startup failed due to previous errors

dlecan commented 12 years ago

Nothing more in log files? Stacktrace or anything else?

I will need more informations in order to help you.

Are you using Play data source or Tomcat one? JPA or Anorm ?

garytomorrow commented 12 years ago

Thanks, but there are nothing more in the logs. I am using Play data source. It seems not database issue, the logs shows that DB connected. Any additional configuration required for Tc 7?

here is what I did:

I also did a try to remove those 2 play2war jar files and don't see errors during start up, however play serverlet doesn't work then without those 2 jar files.

Any success war file can download and I can try to deploy for a testing in my tomcat container?

Thanks, Gary

garytomorrow commented 12 years ago

here are the logs I didn't think the root cause of the error since they are after the listenerStart error. FYI below:

Sep 2, 2012 5:27:26 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart Sep 2, 2012 5:27:26 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [] startup failed due to previous errors Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [] registered the JDBC driver [play.utils.ProxyDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [] registered the JDBC driver [play.utils.ProxyDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [com.google.common.base.internal.Finalizer] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [BoneCP-release-thread-helper-thread] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [BoneCP-release-thread-helper-thread] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [BoneCP-release-thread-helper-thread] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [BoneCP-keep-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [BoneCP-max-alive-scheduler] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [BoneCP-pool-watch-thread] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [EbeanBackgroundThread] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [Ebean-default.0] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [] appears to have started a thread named [EbeanCacheWarmer] but has failed to stop it. This is very likely to create a memory leak. Sep 2, 2012 5:27:26 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /usr/share/apache-tomcat-7.0.29/webapps/host-manager Sep 2, 2012 5:27:26 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /usr/share/apache-tomcat-7.0.29/webapps/examples Sep 2, 2012 5:27:27 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /usr/share/apache-tomcat-7.0.29/webapps/manager Sep 2, 2012 5:27:27 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /usr/share/apache-tomcat-7.0.29/webapps/docs Sep 2, 2012 5:27:27 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /usr/share/apache-tomcat-7.0.29/webapps/ROOT-bar Sep 2, 2012 5:27:27 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Sep 2, 2012 5:27:27 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Sep 2, 2012 5:27:27 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 12658 ms Sep 2, 2012 5:44:25 PM org.apache.catalina.core.StandardServer await INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance. Sep 2, 2012 5:44:25 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8080"] Sep 2, 2012 5:44:25 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] Sep 2, 2012 5:44:25 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Sep 2, 2012 5:44:25 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8080"] Sep 2, 2012 5:44:25 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] Sep 2, 2012 5:44:25 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8080"] Sep 2, 2012 5:44:25 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"] Exception in thread "Thread-3" java.lang.NoClassDefFoundError: com/avaje/ebeaninternal/server/lib/sql/DataSourceGlobalManager at com.avaje.ebeaninternal.server.lib.ShutdownManager.shutdown(ShutdownManager.java:183) at com.avaje.ebeaninternal.server.lib.ShutdownHook.run(ShutdownHook.java:47) Caused by: java.lang.ClassNotFoundException: com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556) ... 2 more

dlecan commented 12 years ago

I also did a try to remove those 2 play2war jar files and don't see errors during start up, however play serverlet doesn't work then without those 2 jar files.

Sure. PLay2war jar provide Servlet and Context listener to start and link Play server with Tomcat. If you remove them, nothing happens :)

Any success war file can download and I can try to deploy for a testing in my tomcat container?

You can download Play2War sample built for Servlet 3.0 container here: https://play-war.ci.cloudbees.com/job/Play_2_War_-_on_push_-_with_integration_tests_-_on_develop_branch/ws/sample/servlet30/target/a-play2war-sample-servlet30-1.0-SNAPSHOT.war

It is packaged against Play2War 0.8-SNAPSHOT, without any database access.

here are the logs I didn't think the root cause of the error since they are after the listenerStart error. FYI below:

You are probably right, but ...

Caused by: java.lang.ClassNotFoundException: com.avaje.ebeaninternal.server.lib.sql.DataSourceGlobalManager

This is a weird exception. Does ebean jar exist in your WAR package/WEB-INF/lib folder ?

garytomorrow commented 12 years ago

Thanks Lecan.

I will download the sample and try. Btw, you may ignore the last except since that is cause when I stop tomcat service.

Is there any specific changes required to the tomcat default web.xml file in order to deploy as ROOT?

dlecan commented 12 years ago

Is there any specific changes required to the tomcat default web.xml file in order to deploy as ROOT?

Nothing to do.

garytomorrow commented 12 years ago

Thanks Lecan.

The issue is resolved. I guess it is caused by another testing class developed under the app path and extended GlobalSettings object. After remove this java file, it works perfect now.

zquintana commented 11 years ago

Which test caused this problem? I am having the same problem

SamJoan commented 11 years ago

After a few hours of investigation, it turns out "SEVERE: Error listenerStart" means "Got a fatal exception while trying to initialize your servlet. Please enable futher logging so that I show you the error please, if you would be so kind".

Further logging can be enabled by creating a file in my case at /var/lib/tomcat6/shared/classes/logging.properties (YMMV)

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

After that it threw a more insteresting error, like

SEVERE: Exception sending context initialized event to listener instance of class play.core.server.servlet25.Play2Servlet
Configuration error: Configuration error[Missing configuration [db.default.url]]

In my case. Sauce:

http://java.dzone.com/articles/tomcat-6-infamous-%E2%80%9Csevere