Why is Tomcat 8.5 reloading context - java

It seems like since we upgraded tomcat to version 8+ we aways get a context reload on startup. However it only seems to happen in our development environments (windows OS with eclipse and tomcat 8.5). Our production environments (linux OS with tomcat 8.5) do not have this issue. Ill post it below but I do not see any indication of why this is happenign from the tomcat logs. I know this is normally behavior with something in the web apps directory is changed, but for the life of me i cannot figure out what is doing it. There must be some way to track it down though.
This first chunk of log is it fully starting
Feb 18, 2017 9:53:41 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Stackoverflow-commproxy' did not find a matching property.
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/8.5.11
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jan 10 2017 21:02:52 UTC
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 8.5.11.0
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jdk1.8.0_91\jre
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_91-b14
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\CodeRepos\work\EclipseWorkspace.metadata.plugins\org.eclipse.wst.server.core\tmp0
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\tomcat\apache-tomcat-8.5.11
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\CodeRepos\work\EclipseWorkspace.metadata.plugins\org.eclipse.wst.server.core\tmp0
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\tomcat\apache-tomcat-8.5.11
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\CodeRepos\work\EclipseWorkspace.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\tomcat\apache-tomcat-8.5.11\endorsed
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
Feb 18, 2017 9:53:41 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
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.8.0_91\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_121/bin/server;C:/Program Files/Java/jre1.8.0_121/bin;C:/Program Files/Java/jre1.8.0_121/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Users\dever.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;c:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files\Microsoft SQL Server\110\Tools\Binn\;c:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Live\Shared;C:\WINDOWS\system32\config\systemprofile.dnx\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\Emscripten\emscripten\1.35.0;C:\Program Files\Emscripten;C:\Program Files\Emscripten\clang\e1.35.0_64bit;C:\Program Files\Emscripten\node\0.12.2_64bit;C:\Program Files\Emscripten\python\2.7.5.3_64bit;C:\Program Files\Emscripten\java\7.45_64bit\bin;C:\Program Files\Emscripten\crunch\1.03;C:\Program Files\Emscripten\mingw\4.6.2_32bit;C:\Program Files\TortoiseSVN\bin;C:\JavaProgramFiles\jdk1.8.0_91\bin;C:\Ruby193\bin;C:\program files\apache-maven-3.3.9\bin;c:\Program Files\MongoDB\Server\3.2\bin;C:\JavaProgramFiles\apache-ant-1.9.7\bin;C:\JavaProgramFiles\xmlbeans-1.0.3\bin;C:\Users\dever\AppData\Local\Microsoft\WindowsApps;C:\Users\dever\AppData\Roaming\npm;C:\Program Files\eclipse\jee-neon\eclipse;;.
Feb 18, 2017 9:53:41 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
Feb 18, 2017 9:53:41 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feb 18, 2017 9:53:41 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
Feb 18, 2017 9:53:41 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feb 18, 2017 9:53:41 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 610 ms
Feb 18, 2017 9:53:41 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 18, 2017 9:53:41 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.11
Feb 18, 2017 9:53:44 AM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 18, 2017 9:53:44 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Feb 18, 2017 9:53:44 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2017-02-18 09:53:45.755 [localhost-startStop-1] INFO com.stackoverflow.util.common.AppConfigPostProcessor - Setting system property: org.jboss.logging.provider=slf4j
2017-02-18 09:53:45.757 [localhost-startStop-1] INFO com.stackoverflow.util.common.AppConfigPostProcessor - Setting default timezone to: UTC
2017-02-18 09:53:47.990 [localhost-startStop-1] INFO com.stackoverflow.util.concurrent.ThreadPoolTaskScheduler - Initializing ExecutorService 'taskScheduler'
2017-02-18 09:53:47.997 [localhost-startStop-1] INFO com.stackoverflow.service.commproxy.LoggingServiceImpl - Logging Service: init successfully
2017-02-18 09:53:48.011 [localhost-startStop-1] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: initializing Stackoverflow Device Service...
2017-02-18 09:53:48.314 [localhost-startStop-1] INFO com.stackoverflow.cache.mapdb.MapDBCacheManager - Opened StackoverflowCommProxyCacheV4 MapDB store. File location C:\Users\dever\AppData\Local\Temp\StackoverflowCommProxyCacheV4.DeviceMetaDataCache
2017-02-18 09:53:48.314 [localhost-startStop-1] DEBUG com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: loading local DeviceMetaData cache
2017-02-18 09:53:48.316 [taskScheduler-1] DEBUG com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: starting device pool refresh task
Feb 18, 2017 5:53:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [http-nio-8080]
Feb 18, 2017 5:53:48 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [ajp-nio-8009]
Feb 18, 2017 5:53:48 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 6928 ms
2017-02-18 09:53:49.774 [taskScheduler-1] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: received list of device metadata with 15 items from Stackoverflow Cloud Services
2017-02-18 09:53:49.775 [taskScheduler-1] DEBUG com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: device metadata cache contains 15 items
2017-02-18 09:53:49.806 [taskScheduler-1] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: performed refresh cycle. Time spent: 1490 ms
Feb 18, 2017 5:53:58 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/stackoverflow-commproxy] has started
Notice how there is no error and none of the operations which took place would have touched the disk. With a slight exception for logging. Which does log to file however with our settings like this it really shouldnt be touching the web apps directory:
log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration monitorInterval="180">
<Properties>
<!-- change the path to conference logs below to fit your system -->
<Property name="LOG_DIR">C:\CodeRepos\logs\</Property>
And the rest of the log file:
Feb 18, 2017 5:53:58 PM org.apache.catalina.core.ApplicationContext log
INFO: Closing Spring root WebApplicationContext
2017-02-18 09:53:58.514 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: destroying Stackoverflow Device Service...
2017-02-18 09:53:58.543 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.cache.mapdb.MapDBCacheManager - Closed StackoverflowCommProxyCacheV4.DeviceMetaDataCache MapDB store
2017-02-18 09:53:58.545 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.util.concurrent.ThreadPoolTaskScheduler - Shutting down ExecutorService 'taskScheduler'
Feb 18, 2017 5:53:58 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads
WARNING: The web application [Stackoverflow-commproxy] appears to have started a thread named [Log4j2-Log4j2Scheduled-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
Feb 18, 2017 5:54:00 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 18, 2017 5:54:00 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Feb 18, 2017 5:54:00 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
2017-02-18 17:54:01.637 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.util.common.AppConfigPostProcessor - Setting system property: org.jboss.logging.provider=slf4j
2017-02-18 17:54:01.639 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.util.common.AppConfigPostProcessor - Setting default timezone to: UTC
2017-02-18 17:54:03.732 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.util.concurrent.ThreadPoolTaskScheduler - Initializing ExecutorService 'taskScheduler'
2017-02-18 17:54:03.739 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.service.commproxy.LoggingServiceImpl - Logging Service: init successfully
2017-02-18 17:54:03.751 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: initializing Stackoverflow Device Service...
2017-02-18 17:54:04.024 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] INFO com.stackoverflow.cache.mapdb.MapDBCacheManager - Opened StackoverflowCommProxyCacheV4 MapDB store. File location C:\Users\dever\AppData\Local\Temp\StackoverflowCommProxyCacheV4.DeviceMetaDataCache
2017-02-18 17:54:04.024 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: loading local DeviceMetaData cache
2017-02-18 17:54:04.025 [taskScheduler-1] DEBUG com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: starting device pool refresh task
Feb 18, 2017 5:54:04 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/Stackoverflow-commproxy] is completed
2017-02-18 17:54:04.987 [taskScheduler-1] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: received list of device metadata with 15 items from Stackoverflow Cloud Services
2017-02-18 17:54:04.987 [taskScheduler-1] DEBUG com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: device metadata cache contains 15 items
2017-02-18 17:54:05.020 [taskScheduler-1] INFO com.stackoverflow.service.commproxy.DeviceServiceImpl - Device Service: performed refresh cycle. Time spent: 995
We can see an error regarding some thread that log4j started and couldnt stop but other than that there is no indication of what caused the context reload, and the error regarding log4j is only happening because of the reload.
How can I track down the cause of context reload. We have several projects suffering for this issue some it seems something more global than a specific process or class.
Haven't received any answers so I just wanted to reiterate the fact that Im really looking for my next step in troubleshooting this? Some other log to look at or some way to find out what is triggering the context reload

You may try the following settings:
Open your server configuration from Eclipse Servers View
then make sure that in this editors Server Options section "Modules auto reload by default" is unchecked
also make sure that in that editors Publishing section "Never publish automatically" is selected
Open context menu of your server in Eclipse Servers View
select "Add and Remove..."
in the dialog make sure that "If server is started, publish changes immediately" is unchecked and Finish (you might also have to remove all webapps first and add them again in another step)

It's hard to tell from current info, so I can just only give some suggestions to help you:
Checking conf/context.xml, you may see whether the your watchedResources is changed.
<!--Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reload.-->
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>
You may specify the tag in context.xml as <Context reloadable="false"> to try to stop this issue.
More logging: localhost.date.log, host-manager.date.log
From this thread, it says it may related with Eclipse and it si suggested to check jars in Eclipse vs the jars used by the installed tomcat:
There are sometimes problems when a jar (in Eclispe) has a future timestamp, or is loaded after Tomcat starts, which results in Tomcat reloading the context.
Implement your ServletContextListener and check ServleConextEvent to find info about pre context status.

Go to server.xml file by search with ctrl+shift+R
Under give value as false for reloadable as follows.
<Context docBase="YourAppName" path="/YourApp" reloadable="false" source="org.eclipse.jst.j2ee.server:YourAppName"/>

Related

Tomcat v9.0 Server at localhost [Started,Synchronized] but the eclipse browser is not opening

I have installed Eclipse Oxygen ( Version: Oxygen Release Milestone 6
(4.7.0 M6))
I have installed Apache Tomcat v9.0 .
I have installed java jdk and jre1.8.0_131 and have set classpath.
First I installed JST Adapters and Extensions then I was able to add Apache Tomcat server.
The server says started synchronized but doesn't open Eclipse browser.
When I again click on the green run button it says the following:
Several ports (8005, 8080, 8009) required by Tomcat v9.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
My Tomcat server is running as shown:
I added Apache Tomcat v9.0 by Window->Preferences->Server->Runtime Environments then clicked on Add then selected Apache Tomcat v9.0 then clicked Next then browsed the path to C:\Program Files\Apache Software Foundation\Tomcat 9.0 and selected jre1.8.0_131 then clicked on finish
I also tried to change port numbers previously but it didn't help.
Then following an answer on stackoverflow I did the following :
i clicked on Window->Show View->Other->Server->Servers then clicked OK
Then servers Tab appeared .I opened Tomcat v9.0 Server at localhost .
Then I opened Open launch configuration ,then selected tomcat-juli.jar from Tomcat's bin folder and clicked OK.
When I run server this appears in console tab:
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/9.0.0.M21
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: May 4 2017 22:42:36 UTC
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 9.0.0.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Windows 10
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 10.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: C:\Program Files\Java\jre1.8.0_131
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_131-b11
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: C:\Users\aakri\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 9.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=C:\Users\aakri\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 9.0
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dwtp.deploy=C:\Users\aakri\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 9.0\endorsed
May 15, 2017 2:51:05 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dfile.encoding=Cp1252
May 15, 2017 2:51:05 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
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\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_131\bin;C:\eclipse;;.]
May 15, 2017 2:51:05 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8080"]
May 15, 2017 2:51:05 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 15, 2017 2:51:05 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-8009"]
May 15, 2017 2:51:05 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
May 15, 2017 2:51:05 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1339 ms
May 15, 2017 2:51:05 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
May 15, 2017 2:51:05 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/9.0.0.M21
May 15, 2017 2:51:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8080"]
May 15, 2017 2:51:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-8009"]
May 15, 2017 2:51:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 951 ms
edit:
i tried to reach http://localhost:8080/UserHome:
edit 2:I could not deploy assembly of the jar files and servlet api using the above mentioned versions of eclipse so I changed eclipse current version to Version: Oxygen Release Milestone 5 (4.7.0 M5) also i changed the tomcat v9 to v8.5.Then successfully assembly was deployed and now both are running fine.

Tomcat7 takes too much time to start

I am using tomcat7 as application server to run my java web application (.war) when I restart tomcat it take 20-25 mins to deploy may war file.
i get this log when i restart tomcat :
Sep 24, 2016 9:45:29 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 24, 2016 9:45:29 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68 (Ubuntu)
Sep 24, 2016 9:45:29 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/tnu.war
Sep 24, 2016 9:45:30 AM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/tnu/WEB-INF/lib/javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Sep 24, 2016 9:45:33 AM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Sep 24, 2016 9:46:51 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
Sep 24, 2016 9:46:51 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
Sep 24, 2016 9:46:51 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
Sep 24, 2016 9:46:51 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
Sep 24, 2016 9:46:51 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
Sep 24, 2016 9:46:51 AM org.apache.catalina.startup.ClassLoaderFactory validateFile
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false]
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.68 (Ubuntu)
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 27 2016 18:13:17 UTC
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.68.0
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 4.4.0-36-generic
INFO: Server version: Apache Tomcat/7.0.68 (Ubuntu)
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jun 27 2016 18:13:17 UTC
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.68.0
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 4.4.0-36-generic
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_91-8u91-b14-3ubuntu1~16.04.1-b14
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /var/lib/tomcat7
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /usr/share/tomcat7
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/var/lib/tomcat7/conf/logging.properties
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.awt.headless=true
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xmx128m
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:+UseConcMarkSweepGC
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/usr/share/tomcat7/endorsed
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/var/lib/tomcat7
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/usr/share/tomcat7
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp
INFO: Command line argument: -Djava.io.tmpdir=/tmp/tomcat7-tomcat7-tmp
Sep 24, 2016 9:46:52 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 744 ms
Sep 24, 2016 9:46:52 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Sep 24, 2016 9:46:52 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.68 (Ubuntu)
Sep 24, 2016 9:46:52 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/tnu.war
Sep 24, 2016 9:46:53 AM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
INFO: validateJarFile(/var/lib/tomcat7/webapps/tnu/WEB-INF/lib/javax.servlet-api-3.0.1.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Sep 24, 2016 9:46:56 AM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Sep 24, 2016 10:03:01 AM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [965,010] milliseconds.
log4j:WARN No such property [maxBackupIndex] in org.apache.log4j.DailyRollingFileAppender.
log4j:WARN No such property [maxFileSize] in org.apache.log4j.DailyRollingFileAppender.
24 Sep 2016 10:03:01,669 - [localhost-startStop-1] DEBUG [org.jboss.logging] [] - Logging Provider: org.jboss.logging.Log4jLoggerProvider
24 Sep 2016 10:03:01,694 - [localhost-startStop-1] DEBUG [logging.loggers.YWLogger] [] - Sat Sep 24 10:03:01 UTC 2016 - [ ConstantReader ] File Found
File Found
24 Sep 2016 10:03:01,697 - [localhost-startStop-1] DEBUG [reqfilter.interceptor.MobReqFilter] [] - MobRequestFilter : init + webapp path : /var/lib/tomcat7/webapps/tnu/
24 Sep 2016 10:03:01,698 - [localhost-startStop-1] DEBUG [reqfilter.interceptor.MobReqFilter] [] - init params : WEB-INF/classes/log4j.properties
Sep 24, 2016 10:03:05 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/tomcat7/webapps/tnu.war has finished in 973,344 ms
Sep 24, 2016 10:03:05 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /var/lib/tomcat7/webapps/ROOT
Sep 24, 2016 10:03:05 AM org.apache.catalina.core.StandardContext setPath
WARNING: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
Sep 24, 2016 10:03:06 AM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Sep 24, 2016 10:03:06 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /var/lib/tomcat7/webapps/ROOT has finished in 331 ms
Sep 24, 2016 10:03:06 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Sep 24, 2016 10:03:06 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 973768 ms
I have to wait for 20-25 mins after i restart tomcat7.Any solution for this?
Note : OS - ubuntu 14.04 on digitalocean cloud.
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [965,010] milliseconds.
This is the process that takes a lot of server time.
Creation of SecureRandom itself takes 16.0835 Minutes.
Fortunately, Apache wiki has a workaround for this:
Tomcat 7+ heavily relies on SecureRandom class to provide random values for its session ids and in other places. Depending on your JRE it can cause delays during startup if entropy source that is used to initialize SecureRandom is short of entropy. You will see warning in the logs when this happens, e.g.:
<DATE> org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [5172] milliseconds.
There is a way to configure JRE to use a non-blocking entropy source by setting the following system property: -Djava.security.egd=file:/dev/./urandom
In case of headless servers, Haveged is a possible solution for tomcat being too slow to start due to low entropy. One important advantage of using Haveged over urandom is, you don't have to compromise on security to speed up the tomcat start up. I had a similar post.
Tomcat takes too much time to start - Java SecureRandom.
Read this Tomcat takes too long to start

Tomcat 7 server won't start within eclipse with error `Starting Tomcat v7.0 Server at localhost (2) has encountered a p‌r‌o‌b‌l‌e‌m`

While executing my simple hello world program I am getting a the Tomcat Server error as
“Starting Tomcat Server v7.0 at localhost (2) has encountered a problem”
I am using jdk7 nd spring 3.1.0 and I have not yet introduced hibernate or maven. Can Anyone help me fix the error. The Console output is as follows:
Aug 21, 2014 10:15:31 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: C:\Program Files (x86)\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre8/bin/client;C:/Program Files (x86)/Java/jre8/bin;C:/Program Files (x86)/Java/jre8/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\VisualSVN\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Java\jre8\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\VisualSVN\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin\;C:\Program Files (x86)\Java\jre8;C:\Program Files (x86)\Java\jre8\lib;D:\Program Files\apache-ant-1.9.4\bin;C:\Program Files (x86)\Java\jre8\bin;D:\Softwares\Eclipse Dump\EclipseForSpring;;.
Aug 21, 2014 10:15:31 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:HelloWorld' did not find a matching property.
Aug 21, 2014 10:15:31 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Aug 21, 2014 10:15:31 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Aug 21, 2014 10:15:31 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1082 ms
Aug 21, 2014 10:15:31 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Aug 21, 2014 10:15:31 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.55
Aug 21, 2014 10:15:32 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [203] milliseconds.
Aug 21, 2014 10:15:34 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Aug 21, 2014 10:15:34 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'HelloWorld'
Aug 21, 2014 10:15:34 AM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'HelloWorld': initialization started
Aug 21, 2014 10:15:34 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'HelloWorld-servlet': startup date [Thu Aug 21 10:15:34 IST 2014]; root of context hierarchy
Aug 21, 2014 10:15:34 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/HelloWorld-servlet.xml]
Aug 21, 2014 10:15:35 AM org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider registerDefaultFilters
INFO: JSR-250 'javax.annotation.ManagedBean' found and supported for component scanning
Aug 21, 2014 10:15:35 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#4258426: defining beans [helloWorldController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.web.servlet.view.InternalResourceViewResolver#0,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy
Aug 21, 2014 10:15:35 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/hello] onto handler 'helloWorldController'
Aug 21, 2014 10:15:35 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/hello.*] onto handler 'helloWorldController'
Aug 21, 2014 10:15:35 AM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/hello/] onto handler 'helloWorldController'
Aug 21, 2014 10:15:35 AM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'HelloWorld': initialization completed in 936 ms
Aug 21, 2014 10:15:35 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Aug 21, 2014 10:15:35 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Aug 21, 2014 10:15:35 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4138 ms
Its seems this problem doesn't have anything to do with spring, hibernate or maven. As it is saying
its expecting an native library which it cant find. You can find that native library in Tomcat Native
and store it in position as tomcat expect it
This Thread discuss the same problem as yours.
As you are using windows i recommend you to use tomcat installer to avoid unnecessary problems.
The message you are getting is normal. You can ignore it as i think its not creating any issue
But still you want or solve this you need to compile the source package that comes as Tomcat Native
Which i haven't tried yet. It is said in tomcat site Use MS Visual Studio to open the workspace of the APR sources and build the library (libapr). and further instruction also given.
You can change the eclipse tomcat server configuration. Open the server view, double click on you server to open server configuration. Then click to activate "Publish module contents to separate XML files". Finally, restart your server, the message must disappear.
This time page will come without any issues.

Tomcat Server Timeout in Eclipse

I'm having problems with my Tomcat Server in eclipse. I get the following timeout error:
Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds.
If the server requires more time, try increasing the timeout in the server editor.
And this is what I get in the console:
Nov 03, 2013 11:59:57 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: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;.
Nov 03, 2013 11:59:58 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Gift Registry Application' did not find a matching property.
Nov 03, 2013 11:59:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Nov 03, 2013 11:59:59 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Nov 03, 2013 11:59:59 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 3088 ms
Nov 03, 2013 11:59:59 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 03, 2013 11:59:59 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.47
Nov 03, 2013 12:00:03 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Nov 03, 2013 12:00:03 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Nov 03, 2013 12:00:03 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3796 ms
Could someone please help me?
Thanks in advance
In Eclipse goto
Servers view => double click tomcat => drop down the Timeouts section.
Update time as per your requirement.
Also refer to this URL for in detail steps.
Go to Windows option -> select Preference.
Than Select General -> Network Connection.
Than select the Active Provider as Manual.
Then restart the tomcat. It will works.
Hope it will help you.
For me changing Start Time from 45 sec to 10 min and wait for 5 minutes after starting the server solved the problem.

Deployed to Tomcat 7 OK but cannot access application

I have a CI-deployed Java Wicket application using Jenkins -> Tomcat 7 on a server. All seems fine up until the point I try to access the application through a browser (via the listing of the deployed application in the manager app). Then I get a 404 error. In the logs, I can see from the tomcat7-stdout-.log that the application starts up fine - the spring beans I set up are outputting init debug statements from my code, so it looks ready to go with no errors.
My dev machine is 32-bit win7. The server is 64-bit Win Server 2008 R2
Thinking it might have been the way Jenkins builds the war file, or an incompatibility between 32/64-bit versions, I installed Tomcat 7 locally so it's all on the same machine, and I get the same result when I deploy from the manager application.
When I shut down tomcat and try to access localhost:8080, nothing appears so there is no other apps competing for that port that I can see
Creating a META-INF/context.xml with <Context path="/system4" /> inside doesn't affect the deployment either (ie it still says it's at the path specified by the war name).
I followed the instructions here to remove some error listenerStart issues, but the log file created is empty
Running locally via mvn jetty:run starts the app with no problems. I can then navigate to the app successfully on localhost:8080
There are no errors in the log files. Below is the total output from each file from a (local) deployment.
localhost..log:
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache#46128d')
localhost_access_log.log:
127.0.0.1 - tomcatgui [01/Jul/2013:11:48:11 +0100] "GET /manager/html/list?org.apache.catalina.filters.CSRF_NONCE=DBBBE417970CCAAB039E98C236CB177A HTTP/1.1" 200 15822
127.0.0.1 - tomcatgui [01/Jul/2013:11:48:11 +0100] "GET /manager/images/asf-logo.gif HTTP/1.1" 304 -
127.0.0.1 - tomcatgui [01/Jul/2013:11:48:11 +0100] "GET /manager/images/tomcat.gif HTTP/1.1" 304 -
127.0.0.1 - tomcatgui [01/Jul/2013:11:48:16 +0100] "GET /manager/html/list?org.apache.catalina.filters.CSRF_NONCE=634AA4131BBA0B7368023C32CD653FC8 HTTP/1.1" 200 15822
127.0.0.1 - tomcatgui [01/Jul/2013:11:48:34 +0100] "POST /manager/html/upload?org.apache.catalina.filters.CSRF_NONCE=AA80212A2557D18475CB621F165BD24E HTTP/1.1" 200 17716
host-manager..log (empty)
catalina..log:
Jul 01, 2013 11:47:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.
Jul 01, 2013 11:47:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1152 ms
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.41
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\docs
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\examples
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\host-manager
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\manager
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\ROOT
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 440 ms
Jul 01, 2013 11:48:25 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive C:\apache-tomcat-7.0.41\webapps\system4-ui-0.0.1-SNAPSHOT.war
servlet-examples..log (the one suggested in the link) (empty - the logging level is set to ALL)
manager..log:
Jul 01, 2013 11:48:11 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost'
Jul 01, 2013 11:48:11 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: init: Global resources are available
Jul 01, 2013 11:48:11 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
Jul 01, 2013 11:48:16 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
Jul 01, 2013 11:48:34 AM org.apache.catalina.core.ApplicationContext log
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost'
Output from the tomcat window:
Jul 01, 2013 11:47:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4
.6.
Jul 01, 2013 11:47:57 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], ra
ndom [true].
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.AprLifecycleListener initializ
eSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1d 5 Feb 2013)
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1152 ms
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 01, 2013 11:47:58 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.41
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\docs
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\exampl
es
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\host-m
anager
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\manage
r
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\apache-tomcat-7.0.41\webapps\ROOT
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8080"]
Jul 01, 2013 11:47:58 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Jul 01, 2013 11:47:58 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 440 ms
Jul 01, 2013 11:48:25 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive C:\apache-tomcat-7.0.41\webapps\system4-
ui-0.0.1-SNAPSHOT.war
Jul 01, 2013 11:48:31 AM org.apache.catalina.core.StandardContext listenerStart
FINE: Sending application start events
Jul 01, 2013 11:48:31 AM org.apache.catalina.core.StandardContext filterStart
FINE: Starting filters
Jul 01, 2013 11:48:31 AM org.apache.catalina.core.StandardContext filterStart
FINE: Starting filter 'wicket.system4-ui'
INFO - WebXmlFile - web.xml: url mapping found for filter with
name wicket.system4-ui: [/*]
INFO - Application - [wicket.system4-ui] init: Wicket core libra
ry initializer
INFO - RequestListenerInterface - registered listener interface [RequestListe
nerInterface name=IBehaviorListener, method=public abstract void org.apache.wick
et.behavior.IBehaviorListener.onRequest()]
INFO - RequestListenerInterface - registered listener interface [RequestListe
nerInterface name=IFormSubmitListener, method=public abstract void org.apache.wi
cket.markup.html.form.IFormSubmitListener.onFormSubmitted()]
INFO - RequestListenerInterface - registered listener interface [RequestListe
nerInterface name=ILinkListener, method=public abstract void org.apache.wicket.m
arkup.html.link.ILinkListener.onLinkClicked()]
INFO - RequestListenerInterface - registered listener interface [RequestListe
nerInterface name=IOnChangeListener, method=public abstract void org.apache.wick
et.markup.html.form.IOnChangeListener.onSelectionChanged()]
INFO - RequestListenerInterface - registered listener interface [RequestListe
nerInterface name=IRedirectListener, method=public abstract void org.apache.wick
et.IRedirectListener.onRedirect()]
INFO - RequestListenerInterface - registered listener interface [RequestListe
nerInterface name=IResourceListener, method=public abstract void org.apache.wick
et.IResourceListener.onResourceRequested()]
INFO - Application - [wicket.system4-ui] init: Wicket extensions
initializer
INFO - sPathXmlApplicationContext - Refreshing org.springframework.context.supp
ort.ClassPathXmlApplicationContext#19b35e1: startup date [Mon Jul 01 11:48:32 BS
T 2013]; root of context hierarchy
INFO - XmlBeanDefinitionReader - Loading XML bean definitions from class pat
h resource [META-INF/applicationContext-data.xml]
INFO - sPathBeanDefinitionScanner - JSR-330 'javax.inject.Named' annotation fou
nd and supported for component scanning
INFO - nnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation fo
und and supported for autowiring
INFO - sPathXmlApplicationContext - Bean 'org.springframework.orm.jpa.vendor.Hi
bernateJpaVendorAdapter#5d2d9b' of type [class org.springframework.orm.jpa.vendo
r.HibernateJpaVendorAdapter] is not eligible for getting processed by all BeanPo
stProcessors (for example: not eligible for auto-proxying)
INFO - sPathXmlApplicationContext - Bean 'org.springframework.instrument.classl
oading.InstrumentationLoadTimeWeaver#f003c0' of type [class org.springframework.
instrument.classloading.InstrumentationLoadTimeWeaver] is not eligible for getti
ng processed by all BeanPostProcessors (for example: not eligible for auto-proxy
ing)
INFO - erEntityManagerFactoryBean - Building JPA container EntityManagerFactory
for persistence unit 'com.sw.system4.core.persistence'
INFO - Version - HCANN000001: Hibernate Commons Annotations
{4.0.1.Final}
INFO - Version - HHH000412: Hibernate Core {4.2.0.Final}
INFO - Environment - HHH000206: hibernate.properties not found
INFO - Environment - HHH000021: Bytecode provider name : javassi
st
INFO - Ejb3Configuration - HHH000204: Processing PersistenceUnitInfo [
name: com.sw.system4.core.persistence
...]
INFO - agerConnectionProviderImpl - HHH000402: Using Hibernate built-in connect
ion pool (not for production use!)
INFO - agerConnectionProviderImpl - HHH000115: Hibernate connection pool size:
20
INFO - agerConnectionProviderImpl - HHH000006: Autocommit mode: true
INFO - agerConnectionProviderImpl - HHH000401: using driver [com.mysql.jdbc.Dri
ver] at URL [jdbc:mysql://localhost:3306/system4_live]
INFO - agerConnectionProviderImpl - HHH000046: Connection properties: {user=sys
tem4_user, password=****, autocommit=true, release_mode=auto}
INFO - Dialect - HHH000400: Using dialect: org.hibernate.dia
lect.MySQL5Dialect
INFO - ransactionFactoryInitiator - HHH000268: Transaction strategy: org.hibern
ate.engine.transaction.internal.jdbc.JdbcTransactionFactory
INFO - ASTQueryTranslatorFactory - HHH000397: Using ASTQueryTranslatorFactory
INFO - SchemaUpdate - HHH000228: Running hbm2ddl schema update
INFO - SchemaUpdate - HHH000102: Fetching database metadata
INFO - SchemaUpdate - HHH000396: Updating schema
INFO - TableMetadata - HHH000261: Table found: system4_live.user
INFO - TableMetadata - HHH000037: Columns: [id, enabled, username,
preferences_id, lastlogin, lastname, firstname, password, changepasswordrequire
d]
INFO - TableMetadata - HHH000108: Foreign keys: [fk285feb559233ea]
INFO - TableMetadata - HHH000126: Indexes: [primary, fk285feb55923
3ea]
INFO - TableMetadata - HHH000261: Table found: system4_live.userpr
eferences
INFO - TableMetadata - HHH000037: Columns: [id]
INFO - TableMetadata - HHH000108: Foreign keys: []
INFO - TableMetadata - HHH000126: Indexes: [primary]
INFO - SchemaUpdate - HHH000232: Schema update complete
INFO - sPathXmlApplicationContext - Bean 'entityManagerFactory' of type [class
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] is not eligi
ble for getting processed by all BeanPostProcessors (for example: not eligible f
or auto-proxying)
INFO - DefaultListableBeanFactory - Pre-instantiating singletons in org.springf
ramework.beans.factory.support.DefaultListableBeanFactory#66d804: defining beans
[entityManagerFactory,transactionManager,org.springframework.orm.jpa.support.Pe
rsistenceAnnotationBeanPostProcessor#0,org.springframework.aop.config.internalAu
toProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionA
ttributeSource#0,org.springframework.transaction.interceptor.TransactionIntercep
tor#0,org.springframework.transaction.config.internalTransactionAdvisor,persiste
nceExceptionTranslationPostProcessor,org.springframework.context.annotation.inte
rnalConfigurationAnnotationProcessor,org.springframework.context.annotation.inte
rnalAutowiredAnnotationProcessor,org.springframework.context.annotation.internal
RequiredAnnotationProcessor,org.springframework.context.annotation.internalCommo
nAnnotationProcessor,org.springframework.context.annotation.internalPersistenceA
nnotationProcessor,userJpaDAO,user-service,encryption-service,org.springframewor
k.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root
of factory hierarchy
INFO - MD5EncryptionStrategy - EncryptionStrategy: Using MD5 for encryptio
n
INFO - WebApplication - [wicket.system4-ui] Started Wicket version
6.8.0 in DEVELOPMENT mode
********************************************************************
*** WARNING: Wicket is running in DEVELOPMENT mode. ***
*** ^^^^^^^^^^^ ***
*** Do NOT deploy to your live server(s) without changing this. ***
*** See Application#getConfigurationType() for more information. ***
********************************************************************
If I click on the link for the app in the tomcat manager application, I get:
type Status report
message /system4%2Dui%2D0.0.1%2DSNAPSHOT/
description The requested resource is not available.
and this appears in localhost-access..log:
127.0.0.1 - - [01/Jul/2013:11:54:38 +0100] "GET /system4%2Dui%2D0.0.1%2DSNAPSHOT/ HTTP/1.1" 404 1015
Please can anyone help?
OK, well this is strange.
It was all down to the name of the WAR file, and thus the URL of the site. I renamed the war file to just system4.war, and tried to deploy that, and I could navigate to the URL just fine.
I say it's strange, because I ran the wicket quickstart project some months ago on the very same server, and the war file was named very similarly (ie wickettestproject-1.0-SNAPSHOT.war) and this worked ok, although after redeploying this project now, that no longer works either.
I'm at a loss as to why, because AFAIK dots and dashes are ok in a URL - maybe it's a tomcat quirk or something.
To fix the problem:
In the pom.xml I use to generate the WAR, I've included this line under the build tags:
<finalName>system4</finalName>
Now the war is renamed, it's built and deployed under system4.war, and accessed via <server>:<port>/system4

Categories