I'm trying to deploy a war file that I put in the webapps directory. The logfile seems to indicate that everything goes OK until this step:
2015-08-10 16:33:25,944 INFO [MBeanExporter.java:412] : Registering beans for JMX exposure on startup
And it just hangs there until the server startup timeout hits. I have no idea what could be causing this or where to look since no error gets thrown.
The hangup was related to some issue other than JMX. See this userlist discussion: https://groups.google.com/forum/#!topic/onebusaway-developers/RDX1n8zVl4U
Related
After using mvn appengine:deploy, we receive a BUILD SUCCESSFUL message... but when you navigate to the URL... the following message is received:
Error 404 - Not Found.
No context on this server matched or handled this request.
Contexts known to this server are:
/ ---> o.e.j.w.WebAppContext#4566e5bd{/,file:///var/lib/jetty/webapps/root/,UNAVAILABLE}{/root.war} [failed]
Powered by Jetty:// 9.4.5.v20170502
I almost feel like the WAR is being deployed to the wrong directory on the AppEngine, causing Jetty to not be able to locate. Any ideas?
It turns out Jetty requires two configuration files (web.xml and applicationContext.xml), web.xml defines the DispatcherServlet and it's configuration location, applicationContext.xml indicates that spring should use component-scanning and annotation-driven configuration.
I am new to servlets and using Tomcat version 7.0.34 (we were instructed to use this version only). My problem is that the Tomcat seems to restart at some point of time, this occurs when I don't interact with the servlet for some time. I see the following:
.
Further when I tried debugging through eclipse I see the following entries in the debug window:
Daemon Thread [http-bio-80-exec-1] (Suspended (exception RuntimeException))
ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: not available
ThreadPoolExecutor$Worker.run() line: not available
TaskThread(Thread).run() line: not available
And this in console:
SEVERE: The web application [/csj] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.
Okt 03, 2016 1:39:39 AM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/csj] is completed
I want to know the reason why Tomcat is restarting. If I keep clicking the buttons with no delays, then this problem is not seen.
I tried looking here: Tomcat showing this error "This is very likely to create a memory leak". How to resolve this issue? and here: The web application [ROOT] is still processing a request that has yet to finish. [Tomcat] but I am at loss to understand.
It seems this problem is solved in newer version of Tomcat as per this:http://wiki.apache.org/tomcat/MemoryLeakProtection . Nevertheless I would like to understand what is this problem about.
Edit: Using eclipse-mars
Your tomcat is configured for "hot deploy" i.e. if you change code, tomcat will incorporate new code without a server restart. This can be configured on tomcat, or in eclipse. You can go there and disable this as it is actually a headache and consumes more time, and sometimes doesn't work correctly.
Tomcat loads each webapp using a separate classloader. It monitors your files for changes, and if a change happens, it unloads your webapp by destroying the classloader, and loads again using a new class loader. When this is happening, you will see all kinds of logs as you mentioned.
For eclipse configuration, see here
For tomcat configuration, see here
Also, from Tomcat docs, read this
In server.xml, set reloadable="false".
From https://tomcat.apache.org/tomcat-5.5-doc/config/context.html
Set to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
i have this error while launching tomcat
log from catalina.out
Unable to load specified config location file:/ .... startup failed:
Is there a way to make my java code cath this error and stop my tomcat ?
Tomcat will start up no matter what happens with the applications you expected to deploy. There is no feature to cause Tomcat to fail to start if your application fails to start properly.
You certainly do not what that feature - at least other Tomcat users do not want it. A ServletContainer can host multiple web applications, and I would not use a container that would stop simply because a deployment failed.
If a deployment fails, that perticular application is not started but others continue to run. It is up to you to fix the configuration problem and redeploy or manually stop the tomcat.
I am trying a spring MVC application on tomcat server..
I am always getting the error as resource not found(please see the question if you have time)..I think there is some problem with the view resolver..
I want debug this application to know where i am doing wrong...
Is that possible?
I don't know if it is a lame question for senior developers :)
I would set the logging level of DispatcherServlet to DEBUG and see what it says. Spring contains mostly good logging at DEBUG level to tell you what's going on (despite that it's INFO level is nigh-useless).
If DispatcherServlet's logging doesn't say much, try some of the other classes you have configured in your application (do one at a time or you'll get overwhelmed with log messages)
If you are using Eclipse, you can add Tomcat runtime in preferences and add new server in servers view in eclipse. Then you can run the server in debug mode.
Also you can attach source code for jar files(in your case spring jars) in eclipse so that when you debug it will load proper source files.
Could anyone please tell me, what the meaning of the word "Deploy" and "Redeploy" in context of Tomcat in the following line:
ServletConfig parameters won't change
for as long as this servlet is
deployed an running. To change them,
you'll have to redeploy the servlet
Thanks very much in advance.
When it says "deployed" that means Tomcat read the Servlet definition (usually a web.xml inside a war) and started the Servlet, which is now available for use. This is when ServletConfig parameters are passed to the Servlet.
When it says "redeploy", it means any way you force it to re-read the Servlet definition (which will re-read the ServletConfig parameters).
The easiest way to redeploy a Servlet is to stop Tomcat and start it again. When Tomcat stops, it undeploys everything that was deployed. When Tomcat starts, it deploys everything again.
Restarting the server may be overkill for you if all you want is to have one Servlet re-read its configuration. A faster way (in server time, not necessarily the time it takes you to figure out how to do it) to redeploy a Servlet is called hot deploy. Hot deploying is when you redeploy a Servlet when Tomcat is still running. See the Tomcat documentation for more info on how to do it in Tomcat.
This means that if your server is deployed and running (i.e. working) then your changes will not show up until you redeploy (i.e. stop the server and deploy the code and start again).