Tomcat fails to start and crash randomly - java

I need some help. Last week we've migrated to Git (and for now we're using fork as client) and I've started a new workspace into sts. Everything it's working well but I don't know why, completly randomly, tomcat crash, usually after a refresh (refreshed by me or by itself, without any command). I don't have the "build automatically" option actived of course, but still, it's like tomcat refresh itself and crash.
The starting log error is the following (first line, classloaderbase):
org.apache.catalina.loader.WebappClassLoaderBase modified
GRAVE: Resource '/WEB-INF/classes//it/sabacom/domain/amministrativo/IncassoDettaglioPartitario.class' is missing
lug 15, 2019 12:16:54 PM org.apache.catalina.core.StandardContext reload
INFORMAZIONI: Reloading Context with name [/easyplanweb] has started
12:16:54.166 INFO - - URL= - org.springframework.web.context.support.XmlWebApplicationContext.() - Closing Root WebApplicationContext: startup date [Mon Jul 15 11:52:47 CEST 2019]; parent: Root WebApplicationContext
lug 15, 2019 12:16:54 PM org.apache.catalina.core.ApplicationContext log
INFORMAZIONI: Destroying Spring FrameworkServlet 'reports'
12:16:54.180 INFO - - URL= - org.springframework.web.context.support.XmlWebApplicationContext.() - Closing WebApplicationContext for namespace 'reports-servlet': startup date [Mon Jul 15 11:52:48 CEST 2019]; parent: Root WebApplicationContext
lug 15, 2019 12:16:54 PM org.apache.catalina.core.ApplicationContext log
INFORMAZIONI: Destroying Spring FrameworkServlet 'magazzino'
12:16:54.182 INFO - - URL= - org.springframework.web.context.support.XmlWebApplicationContext.() - Closing WebApplicationContext for namespace 'magazzino-servlet': startup date [Mon Jul 15 11:52:48 CEST 2019]; parent: Root WebApplicationContext
lug 15, 2019 12:16:54 PM org.apache.catalina.core.ApplicationContext log
INFORMAZIONI: Destroying Spring FrameworkServlet 'rest'
12:16:54.184 INFO - - URL= - org.springframework.web.context.support.XmlWebApplicationContext.() - Closing WebApplicationContext for namespace 'rest-servlet': startup date [Mon Jul 15 11:52:48 CEST 2019]; parent: Root WebApplicationContext
lug 15, 2019 12:16:54 PM org.apache.catalina.core.ApplicationContext log
INFORMAZIONI: Destroying Spring FrameworkServlet 'maps'
Does someone has some ideas? Thank you!

Related

Tomcat: Additional JARs have been added - context reload [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
My development tomee automatically reloads the context when deployment is finished. The log indicates that new Jars have been added but I havent done anything.
Why is the Context reloading?
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.federated_search.search_utils.answer.SearchAnswerMessageBodyWriter#1722ba49
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.platform.restServices.MediaProviderJSON#118a5aca
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.platform.restServices.MediaProviderJSONP#64dec4ca
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JsonParseExceptionMapper#5d35cfc8
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JacksonJaxbJsonProvider#5f47c6d5
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JacksonJsonProvider#1c588bfd sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
com.dassault_systemes.platform.ven.jackson.jaxrs.json.JsonMappingExceptionMapper#eb2f428
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener configureFactory
INFO:
org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper#5d3567dc sep
03, 2018 8:29:35 FM org.apache.openejb.server.cxf.rs.CxfRsHttpListener
logEndpoints INFO: REST Application:
http://localhost:9311/3dspace/resources/PreCost
-> com.matrixone.apps.apr.costing.precost.service.PreCostServiceModular
sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints INFO:
Service URI:
http://localhost:9311/3dspace/resources/PreCost/PreCostServices
-> Pojo com.matrixone.apps.apr.costing.precost.service.PreCostService sep 03, 2018 8:29:35 FM
org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints INFO:
GET
http://localhost:9311/3dspace/resources/PreCost/PreCostServices/getChartData
-> Response getChartData(HttpServletRequest) throws Exception [2018-09-03 08:29:35,460] Artifact castor-webapp:war exploded:
Artifact is deployed successfully [2018-09-03 08:29:35,462] Artifact
castor-webapp:war exploded: Deploy took 266 999 milliseconds [TIMING]
[pool-8-thread-1] INFO 2018-09-03T08:29:37,266 - The call to
[com.hm.pdm.core.common.department.DepartmentLogicImpl.getAll()]
returned normally after 5933 ms. - {} [TIMING] [pool-8-thread-1] INFO
2018-09-03T08:29:37,267 - The call to
[com.hm.pdm.core.common.department.DepartmentLogicImpl.getAll()]
returned normally after 5935 ms. - {} sep 03, 2018 8:29:40 FM
org.apache.catalina.loader.WebappClassLoaderBase modified INFO:
Additional JARs have been added sep 03, 2018 8:29:40 FM
org.apache.catalina.core.StandardContext reload INFO: Reloading
Context with name [/3dspace] has started [SPRING]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,005 (AbstractApplicationContext.java:987) -
Closing WebApplicationContext for namespace 'SpringMVC-servlet':
startup date [Mon Sep 03 08:29:25 CEST 2018]; parent: Root
WebApplicationContext - {} [TVC-SYSTEM]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,024 (TVCServlet.java:179) - Shutdown in
progress... - {} [TVC-SYSTEM]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,061 (TVCServlet.java:182) - Heippa - {} [CASTOR]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
2018-09-03T08:29:41,126 (AjaxJSONTransactionFilter.java:101) -
Destroying AjaxJSONTransactionFilter... - {} [CASTOR]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,131 (Log.java:440) -
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy
called - {} [CASTOR]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
2018-09-03T08:29:41,131 (AjaxJSONServiceFilter.java:62) - Destroying
AjaxJSONServiceFilter... - {} [CASTOR]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG
2018-09-03T08:29:41,132 (AjaxJSONTransactionFilter.java:101) -
Destroying QaTransactionFilter... - {} [SPRING]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,171 (AbstractApplicationContext.java:987) -
Closing Root WebApplicationContext: startup date [Mon Sep 03 08:27:41
CEST 2018]; root of context hierarchy - {} [CASTOR]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,175 (AbstractExecutorsConfiguration.java:116) -
About to destroy executor: CORE_ASYNC_JOBS - {} [CASTOR]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,175 (AbstractExecutorsConfiguration.java:116) -
About to destroy executor: CORE_ASYNCHRONOUSLY_WITH_DELAY - {}
[SPRING] [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,175 (MBeanExporter.java:449) - Unregistering
JMX-exposed beans on shutdown - {} [SPRING]
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO
2018-09-03T08:29:41,175 (MBeanRegistrationSupport.java:241) -
Unregistering JMX-exposed beans - {} sep 03, 2018 8:29:41 FM
org.apache.openejb.assembler.classic.Assembler destroyApplication
INFO: Undeploying app:
C:\GIT\castor\castor-main\HM_PDM\src\castor-webapp\target\castor-webapp
sep 03, 2018 8:29:42 FM org.apache.openejb.util.OptionsLog info INFO:
Using 'openjpa.Log=org.apache.openejb.openjpa.JULOpenJPALogFactory'
sep 03, 2018 8:29:42 FM org.apache.openejb.assembler.classic.Assembler
destroyApplication WARNING: Log4j not installed. The following
properties will be ignored. sep 03, 2018 8:29:42 FM
org.apache.openejb.assembler.classic.Assembler destroyApplication
WARNING: Ignored Property overrides property 'log4j.skipJansi' sep 03,
2018 8:29:42 FM org.apache.openejb.assembler.classic.Assembler
destroyApplication INFO: Undeployed app:
C:\GIT\castor\castor-main\HM_PDM\src\castor-webapp\target\castor-webapp
sep 03, 2018 8:29:42 FM
org.apache.catalina.loader.WebappClassLoaderBase
clearReferencesThreads SEVERE: The web application [/3dspace] appears
to have started a thread named [Timer-0] but has failed to stop it.
This is very likely to create a memory leak. sep 03, 2018 8:29:42 FM
org.apache.catalina.loader.WebappClassLoaderBase
clearReferencesThreads SEVERE: The web application [/3dspace] appears
to have started a thread named
[oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser]
but has failed to stop it. This is very likely to create a memory
leak. sep 03, 2018 8:29:42 FM
org.apache.catalina.loader.WebappClassLoaderBase
clearReferencesThreads
I can't say for sure for TomEE, but Tomcat's algorithm is dead simple:
Scan the webapps folder for changed files (or folders if you work with Exploded WARs, it's quite the same in terms of the asked question).
The file is considered changed if its last modification/update time changes. Another option is that a file is completely new.
When such a file is detected, it triggers the undeploy of the old version of the application and deploys a new one.
Note, this algorithm doesn't analyze the file for internal changes, its just doesn't matter, if you changed the file, then probably you wanted it to redeploy.
So the answer is simple - just don't update the webapps folder if you don't want to redeploy.

Jenkins: stops execution of job abruptly

I have a scheduled pipeline which runs daily.
There was an error that I faced yesterday.One of my jobs in the pipeline failed abruptly.The console log didn't return any FAILURE status.But strangely the pipeline shows as SUCCESSFUL,despite the job failing.
My job uses chef to download files from object storage location.I checked the logs it is successful.But still somehow the job failed/interrupted.
One more thing I noticed is that though the job ran fully it still shows completed in 0ms
Started 23 hr ago
Took 0 ms
Below is the jenkins log at the time when the job started:
` **Nov 28, 2017 1:47:10 PM hudson.plugins.logparser.LogParserReader readLogPart
INFO: Start reading log part 0 in thread #0
Nov 28, 2017 1:47:10 PM hudson.plugins.logparser.LogParserReader readLogPart
INFO: Done reading log part 0
Nov 28, 2017 1:47:11 PM hudson.plugins.logparser.LogParserThread getLineStatuses
INFO: LogParserThread: Start parsing log part 0
Nov 28, 2017 1:47:11 PM hudson.plugins.logparser.LogParserThread getLineStatuses
INFO: LogParserThread: Done parsing log part 0
Nov 28, 2017 1:47:11 PM hudson.plugins.logparser.LogParserParser parseLogBody
INFO: LogParserParser: Parsing took 0 minutes (0) seconds.
Running from: /usr/lib/jenkins/jenkins.war
Nov 28, 2017 2:17:08 PM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file /tmp/winstone/jenkins.war
Nov 28, 2017 2:17:08 PM org.eclipse.jetty.util.log.Log initialized
INFO: Logging initialized #858ms to org.eclipse.jetty.util.log.JavaUtilLog
Nov 28, 2017 2:17:09 PM winstone.Logger logInternal
INFO: Beginning extraction from war file
Nov 28, 2017 2:17:09 PM org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath
Nov 28, 2017 2:17:09 PM org.eclipse.jetty.server.Server doStart
INFO: jetty-9.4.z-SNAPSHOT
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: DefaultSessionIdManager workerName=node0
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: No SessionScavenger set, using defaults
Nov 28, 2017 2:17:10 PM org.eclipse.jetty.server.session.HouseKeeper startScavenging
INFO: Scavenging every 660000ms
Jenkins home directory: /var/lib/jenkins found at: SystemProperties.getProperty("JENKINS_HOME")
Nov 28, 2017 2:17:11 PM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO: Started w.#d23e042{/,file:///var/cache/jenkins/war/,AVAILABLE}{/var/cache/jenkins/war}
Nov 28, 2017 2:17:11 PM org.eclipse.jetty.server.AbstractConnector doStart
INFO: Started ServerConnector#13d73f29{HTTP/1.1,[http/1.1]}{127.0.0.1:8081}
Nov 28, 2017 2:17:11 PM org.eclipse.jetty.server.Server doStart
INFO: Started #3487ms
Nov 28, 2017 2:17:11 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v4.0 running: controlPort=disabled
Nov 28, 2017 2:17:12 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Nov 28, 2017 2:17:13 PM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Nov 28, 2017 2:17:18 PM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Nov 28, 2017 2:17:18 PM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Nov 28, 2017 2:17:19 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
INFO: Failed to instantiate optional component org.biouno.unochoice.model.ScriptlerScript$DescriptorImpl; skipping
Nov 28, 2017 2:17:19 PM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator migrate
INFO: Migrating build records in /var/lib/jenkins/jobs/build_spark_repo/builds
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator doMigrate
WARNING: found unexpected dir lastSuccessfulBuild
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator doMigrate
WARNING: found unexpected dir lastStableBuild
Nov 28, 2017 2:17:20 PM jenkins.model.RunIdMigrator migrate
WARNING: Build record migration (https://jenkins.io/redirect/build-record-migration) is one-way. If you need to downgrade Jenkins, run: java -classpath "/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.73.2.jar:/var/cache/jenkins/war/WEB-INF/lib/commons-io-2.4.jar:/var/cache/jenkins/war/WEB-INF/lib/stapler-1.250.jar:/var/cache/jenkins/war/WEB-INF/lib/ant-1.8.4.jar:/var/cache/jenkins/war/WEB-INF/lib/commons-lang-2.6.jar" jenkins.model.RunIdMigrator "/var/lib/jenkins"
Nov 28, 2017 2:17:20 PM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Nov 28, 2017 2:17:20 PM hudson.model.AsyncPeriodicWork$1 run
INFO: Started Download metadata
Nov 28, 2017 2:17:20 PM jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext#479f04e6: display name [Root WebApplicationContext]; startup date [Tue Nov 28 14:17:21 CET 2017]; root of context hierarchy
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext#479f04e6]: org.springframework.beans.factory.support.DefaultListableBeanFactory#5eedf60f
Nov 28, 2017 2:17:21 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#5eedf60f: defining beans [authenticationManager]; root of factory hierarchy
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.web.context.support.StaticWebApplicationContext#4a772b39: display name [Root WebApplicationContext]; startup date [Tue Nov 28 14:17:21 CET 2017]; root of context hierarchy
Nov 28, 2017 2:17:21 PM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
INFO: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext#4a772b39]: org.springframework.beans.factory.support.DefaultListableBeanFactory#5e76549c
Nov 28, 2017 2:17:21 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#5e76549c: defining beans [filter,legacy]; root of factory hierarchy**`
This worked after I re-run the job.
Just wanted to know what could be the cause of the error?

How to write in spring application log?

My application is currently writing the following lines in Tomcat's localhost.log file.
Jan 09, 2017 4:52:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Destroying Spring FrameworkServlet 'reportDispatcher'
Jan 09, 2017 4:52:47 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
I want to dump these in application.log.
How to achieve this?

log4j: File getting created but not getting written

I am using Log4j file appender having the below configuration:
log4j.logger.com.atpl=INFO,ABW
log4j.appender.ABW=org.apache.log4j.DailyRollingFileAppender
log4j.appender.ABW.File=c://atpl-platform-web//atplABW.txt
log4j.appender.ABW.DatePattern='.' yyyy-MM-dd
log4j.appender.ABW.layout=org.apache.log4j.PatternLayout
log4j.appender.ABW.layout.ConversionPattern= [%d] [%t] [%-5p] [%c] ==> %m%n
The file is getting created at the given location all right. The file is getting locked once I start the server. But when I try to log data into that file, its not working.
private static final Logger FILE_LOGGER = Logger
.getLogger(TreeDemoAction.class);
FILE_LOGGER.info(gson.toJson(rootNode));
Also below is the server log on restart.
Nov 2, 2012 3:47:15 PM 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: C:\Program Files\Java\jdk1.6.0_03\bin;C:\Tomcat 6.0\bin
Nov 2, 2012 3:47:15 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
Nov 2, 2012 3:47:15 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 363 ms
Nov 2, 2012 3:47:15 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Nov 2, 2012 3:47:15 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
Nov 2, 2012 3:47:15 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Tomcat 6.0\webapps\atpl-platform-web\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
Nov 2, 2012 3:47:17 PM org.apache.catalina.core.ApplicationContext log
INFO: Set web app root system property: 'atpl-platform-web' = [C:\Tomcat 6.0\webapps\atpl-platform-web\]
Nov 2, 2012 3:47:17 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Log4J from [C:\Tomcat 6.0\webapps\atpl-platform-web\WEB-INF\log4j.properties]
Nov 2, 2012 3:47:17 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool#84f665)
LogAbandoned: false
RemoveAbandoned: true
RemoveAbandonedTimeout: 60
Nov 2, 2012 3:47:22 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
Nov 2, 2012 3:47:22 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Nov 2, 2012 3:47:22 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/15 config=null
Nov 2, 2012 3:47:22 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7177 ms
Can anyone guide me with what is wrong here? am i missing something?
Thanks.
Maybe you get the logger package wrong
log4j.logger.com.platform.web=INFO,ABW
log4j.logger.com.atpl=INFO,ABW is OK.
Try following code:
log4j.appender.ABW.File=/atpl-platform-web/atplABW.txt

Netbeans/Tomcat/Jersey loading Spring context twice

Jersey/Spring application debugged inside Netbeans and deployed to Netbean's Tomcat server has its application context loaded twice. It is loaded, unloaded, and loaded again.
BLOODY WHY?!?!
EDIT: It looks like if I comment out the servlet and servlet-mapping in web.xml, the application context is still loaded twice! If I delete /conf/web.xml file, it is STILL loaded twice. ###$#! Netbeans/Tomcat
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.PostReplaceFilter</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ServletAdaptor</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
</web-app>
Tomcat output:
Using CATALINA_BASE: "C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base"
Using CATALINA_HOME: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27"
Using CATALINA_TMPDIR: "C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.7.0_07"
Using CLASSPATH: "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\bootstrap.jar;C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\tomcat-juli.jar"
Listening for transport dt_shmem at address: tomcat_shared_memory_id
Sep 15, 2012 9:19:22 PM 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:
Sep 15, 2012 9:19:22 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-80"]
Sep 15, 2012 9:19:22 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2012 9:19:22 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 821 ms
Sep 15, 2012 9:19:22 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 15, 2012 9:19:22 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Sep 15, 2012 9:19:22 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\manager.xml
Sep 15, 2012 9:19:23 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\ROOT.xml
Sep 15, 2012 9:19:26 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Sep 15, 2012 9:19:26 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Sat Sep 15 21:19:26 EST 2012]; root of context hierarchy
Sep 15, 2012 9:19:26 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Sep 15, 2012 9:19:27 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#2829abfd: defining beans [...]; root of factory hierarchy
Sep 15, 2012 9:19:28 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Sep 15, 2012 9:19:28 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.6.Final}
Sep 15, 2012 9:19:28 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Sep 15, 2012 9:19:28 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator instantiateExplicitConnectionProvider
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://127.0.0.1:3306/...
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000046: Connection properties: {user=root, autocommit=true, release_mode=auto}
Sep 15, 2012 9:19:28 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000006: Autocommit mode: true
Sep 15, 2012 9:19:28 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Sep 15, 2012 9:19:28 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10]
Sep 15, 2012 9:19:29 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool...
Sep 15, 2012 9:19:29 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Sep 15, 2012 9:19:29 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
Sep 15, 2012 9:19:29 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
Sep 15, 2012 9:19:29 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
Sep 15, 2012 9:19:29 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
...
Sep 15, 2012 9:19:31 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 4806 ms
Sep 15, 2012 9:19:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-80"]
Sep 15, 2012 9:19:31 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Sep 15, 2012 9:19:31 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8866 ms
Sep 15, 2012 9:19:31 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet getContext
INFO: Using default applicationContext
Sep 15, 2012 9:19:31 PM com.sun.jersey.spi.spring.container.SpringComponentProviderFactory registerSpringBeans
INFO: Registering Spring bean, ...
Sep 15, 2012 9:19:31 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.13 06/29/2012 05:14 PM'
Sep 15, 2012 9:19:32 PM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing Root WebApplicationContext: startup date [Sat Sep 15 21:19:26 EST 2012]; root of context hierarchy
Sep 15, 2012 9:19:32 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#2829abfd: defining beans [...]; root of factory hierarchy
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [] 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 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [] appears to have started a thread named [java-sdk-http-connection-reaper] but has failed to stop it. This is very likely to create a memory leak.
Sep 15, 2012 9:19:32 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [] created a ThreadLocal with key of type [com.sun.xml.bind.v2.ClassFactory$1] (value [com.sun.xml.bind.v2.ClassFactory$1#911a094]) and a value of type [java.util.WeakHashMap] (value [{class javax.xml.bind.annotation.W3CDomHandler=java.lang.ref.WeakReference#64455932}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Sep 15, 2012 9:19:33 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context []
Sep 15, 2012 9:19:33 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor C:\Users\adubi_000\AppData\Roaming\NetBeans\7.2\apache-tomcat-7.0.27.0_base\conf\Catalina\localhost\ROOT.xml
Sep 15, 2012 9:19:36 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Sep 15, 2012 9:19:36 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Sat Sep 15 21:19:36 EST 2012]; root of context hierarchy
Sep 15, 2012 9:19:36 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
Sep 15, 2012 9:19:37 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#6b63d42f: defining beans [...]; root of factory hierarchy
Sep 15, 2012 9:19:37 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Sep 15, 2012 9:19:37 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.6.Final}
Sep 15, 2012 9:19:37 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Sep 15, 2012 9:19:37 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator instantiateExplicitConnectionProvider
INFO: HHH000130: Instantiating explicit connection provider: org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH010002: C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://127.0.0.1:3306/....
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000046: Connection properties: {user=root, autocommit=true, release_mode=auto}
Sep 15, 2012 9:19:38 PM org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider configure
INFO: HHH000006: Autocommit mode: true
Sep 15, 2012 9:19:38 PM com.mchange.v2.log.MLog <clinit>
INFO: MLog clients using java 1.4+ standard logging.
Sep 15, 2012 9:19:38 PM com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10]
Sep 15, 2012 9:19:38 PM com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoolManager
INFO: Initializing c3p0 pool...
Sep 15, 2012 9:19:38 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
Sep 15, 2012 9:19:38 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
INFO: HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
Sep 15, 2012 9:19:38 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
Sep 15, 2012 9:19:38 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
Sep 15, 2012 9:19:39 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
...
Sep 15, 2012 9:19:40 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 4264 ms
Sep 15, 2012 9:19:40 PM org.apache.catalina.util.LifecycleBase start
INFO: The start() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] after start() had already been called. The second call will be ignored.
Sep 15, 2012 9:19:41 PM com.sun.jersey.spi.spring.container.servlet.SpringServlet getContext
INFO: Using default applicationContext
Sep 15, 2012 9:19:41 PM com.sun.jersey.spi.spring.container.SpringComponentProviderFactory registerSpringBeans
INFO: Registering Spring bean, ...
Sep 15, 2012 9:19:41 PM com.sun.jersey.server.impl.application.WebApplicationImpl _initiate
INFO: Initiating Jersey application, version 'Jersey: 1.13 06/29/2012 05:14 PM'
It is the work of Netbean's maven deploy plugin, which waits for tomcat to start (and load the application as specified in Netbeans-generared ROOT.xml) then tells it to reload it (from a different temporary XML).
A workaround is to edit %CATALINA_BASE%/conf/tomcat-users.xml and change the password of user 'ide' (through which netbeans controls tomcat). Tomcat still loads fine, but deploy-on-save and probably other features won't work.
I'll try looking at the source code of netbeans to see if a better solution is available. This behavior of the deploy plugin is just bizare. Surely it could start Tomcat empty, and then load the app as it's doing in the second step.

Categories

Resources