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

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.

Related

Tomcat fails to start and crash randomly

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!

Apache Tomcat hang after "Initializing started..."

Following are the startup log messages:
Check if Algo ant logger exists
Found Algo logger, starting with Algo ant logging
Buildfile: $ALGOWEBAPPS_HOME/bin/algowebapps-control.xml
Deleting:$ALGO_TOP/algowebapps/webapps/
acm.war,acm470help.war,awl.war,dmcfg.war,Navigator.war,mdc.war,Visualizer.war
Copying 7 file to $ALGO_TOP/algowebapps/webapps
Deleting directory $ALGO_TOP/algowebapps/webapps/awl
Copying 1 file to $ALGO_TOP/algowebapps/webapps/ROOT
Sep 26, 2017 10:18:25 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 26, 2017 10:18:25 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-12001
Sep 26, 2017 10:18:26 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8888
Sep 26, 2017 10:18:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1145 ms
Sep 26, 2017 10:18:26 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Sep 26, 2017 10:18:26 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
Sep 26, 2017 10:18:26 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Navigator.war
Load details in $ALGO_TOP/algowebapps/webapps/Navigator//MetaTables.xml
Loaded 11 tables & views
Load details of db jdbc:oracle:thin:#UAT4
Load details of db jdbc:oracle:thin:#UAT4
Sep 26, 2017 10:18:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive mdc.war
Sep 26, 2017 10:18:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive acm.war
INFO: GridServlet - ==> initializing GridServlet processing
INFO: TreeServlet - ==> initializing TreeServlet processing
==> initializing LoaderServlet
INFO: AjaxStoreServlet - ==> initializing AjaxStoreServlet processing
INFO: ConfigStoreServlet - ==> initializing ConfigStoreServlet processing
INFO: ActionDataServlet - ==> initializing Ricos HTTP Servlet Executer
INFO: ExecuterServlet2 - ==> initializing Ricos HTTP Servlet Executer
INFO: ValidationServlet - ==> initializing ValidationServlet processing
Sep 26, 2017 10:18:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive acm470help.war
Sep 26, 2017 10:18:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive awl.war
Sep 26, 2017 10:18:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive dmcfg.war
2017-09-26 22:18:33,525 DEBUG [dmcfg] Installing into composite=com.algorithmics.log.provider.DailyLogFileProvider com.algorithmics.log.provider.CompositeLogProvider
2017-09-26 22:18:33,533 DEBUG [dmcfg] File path 'log' is relative - prepending ALGO_TOP=/opt/bns/alreu4/Algo/ALGO_TOP com.algorithmics.log.provider.DailyLogFileProvider
2017-09-26 22:18:33,534 DEBUG [dmcfg] Opening file '$ALGO_TOP/log/dmcfg-default-sbuvvrwm471-2017-09-26.log' om.algorithmics.log.provider.DailyLogFileProvider
2017-09-26 22:18:33,541 DEBUG [dmcfg] Installing into composite=com.algorithmics.log.provider.ConsoleLogProvider com.algorithmics.log.provider.CompositeLogProvider
Sep 26, 2017 10:18:36 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Visualizer.war
Initializing started...
<<<It hangs here indefinitely>>>
Below is what is expected to follow in a normal startup:
[[
Initializing finished...
Sep 26, 2017 10:37:48 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Sep 26, 2017 10:37:48 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-12001
Sep 26, 2017 10:37:48 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8443
Sep 26, 2017 10:37:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7637 ms
]]
Is downloading Tomcat cource code and enable Tomcat debug mode the only choice to identify the root cause of such issue? But I have no access to the source code of those applications running in Tomcat (I can decompile the jar files in war files though it's a tedious). or there might be better way to figure out the cause?
This seems to be an issue with the deployed application start up. You would have to enable debug logging for the application and see the root cause.
You might also check the context.xml for the webapp and see if it's connecting to an external resource, e.g., a database. The log message explicitly mentions an Oracle jdbc driver, it may be hanging while trying to create a database connection pool.
the problem is now mitigated by a upgrade of NFS server to V4.

Apache Tomcat will not complete startup after a certain .war File is deployed

I have a Java web application that I am trying to deploy to our company's application server. It uses spring and spring-security. Everything works correctly when I run the application in Tomcat from Eclipse but when I try and deploy the .war file into a standalone Tomcat instance the server does not even finish starting up.
These are the catalina logs from the last attempt:
Jan 30, 2014 1:16:39 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.23 using APR version 1.4.6.
Jan 30, 2014 1:16:39 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Jan 30, 2014 1:16:39 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized with version OpenSSL 1.0.0g 18 Jan 2012
Jan 30, 2014 1:16:40 PM org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 30, 2014 1:16:40 PM org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
Jan 30, 2014 1:16:40 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2567 ms
Jan 30, 2014 1:16:40 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 30, 2014 1:16:40 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
Jan 30, 2014 1:16:41 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor host-manager.xml
Jan 30, 2014 1:16:41 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor manager.xml
Jan 30, 2014 1:16:41 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive MyApp.war
And then startup stops.
These are the localhost logs:
Jan 30, 2014 1:16:46 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
And then nothing...
All of the other log files for this last attempt are blank.
Any insight you guys might have would be greatly appreciated!
This problem was caused by not setting the JAVA_OPTS property to point to my .ini files.
I included this in my startup script:
set JAVA_OPTS= -DLOGCONFIG=%CATALINA_HOME%\conf\logging.ini -DINIFILE=%CATALINA_HOME%\conf\webapps.ini
and it ran succesfully

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