Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Tomcat Restart

Posted on 2014-09-30
9
Medium Priority
?
720 Views
Last Modified: 2014-10-10
Hi

I am running Tomcat 7.0.35 on CentOS 5.6 64bit. java version "1.6.0_29". I am primarily running a Jasper report integration application to integrate Jasper reports with Oracle Apex.

Everything is working great except whenever I add/remove a data source in /apache-tomcat-7.0.35/conf/Catalina/localhost/JasperReportsIntegration.xml

I have to restart Tomcat otherwise it throws error Apache Tomcat/7.0.35 HTTP - 404 Error.

Can you please suggest a way to edit the datasource without having to restart it?

We have too many datasources in the file and it takes several minutes for a restart.

Thanks

Zulqarnain
0
Comment
Question by:sysautomation
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 36

Expert Comment

by:mccarl
ID: 40353909
I am primarily running a Jasper report integration application...
I would suggest that it is simply a case of this application not handling the changing of it's datasource while it's running. And therefore, I doubt there would be any fix for it other than the applications developers specific changing the application to support this use case.

Are you adding/removing data sources often enough that this is a problem?
0
 

Author Comment

by:sysautomation
ID: 40353923
This is a SAAS kind of setup here therefore the same tomcat is being used for many customer and wherever a new customer signs up we have to create a new data source therefore yes we have to do this quite often,
0
 
LVL 36

Accepted Solution

by:
mccarl earned 2000 total points
ID: 40353931
Well then, as I alluded to above, you would either have to contact the application developers to see if they could modify it to handle the dynamic changes to data sources, or otherwise if source code is available, you could look at doing this yourself.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 86

Expert Comment

by:CEHJ
ID: 40354120
If you're using the same Tomcat instance, why are you not using the same datasource, changing only the customer id?
0
 

Author Comment

by:sysautomation
ID: 40354204
> If you're using the same Tomcat instance, why are you not using the same datasource, changing only the customer id?

Each customer has database on a different machine or different schema/password in the same database. That's why we create separate datasource for each customer.
0
 

Author Comment

by:sysautomation
ID: 40370309
May be it helps. Whenever I make change to xml file catalina.out gets something link following:

Oct 9, 2014 6:18:33 AM org.apache.catalina.startup.HostConfig deleteRedeployResources
INFO: Undeploying context [/JasperReportsIntegration]
Oct 9, 2014 6:18:33 AM org.apache.catalina.core.StandardWrapper unload
INFO: Waiting for 1 instance(s) to be deallocated
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: The web application [/JasperReportsIntegration] appears to have started a thread named [http-bio-8090-exec-10] but has failed to stop it. This is very likely to create a memory leak.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/JasperReportsIntegration] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@2e7b2e05]) and a value of type [java.lang.Class] (value [class test_1282510960842_335563]) 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.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/JasperReportsIntegration] created a ThreadLocal with key of type [net.sf.jasperreports.engine.fonts.FontUtil$1] (value [net.sf.jasperreports.engine.fonts.FontUtil$1@27385846]) and a value of type [java.util.HashSet] (value [[]]) 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.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/JasperReportsIntegration] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@2e7b2e05]) and a value of type [java.lang.Class] (value [class test_1282510960842_335563]) 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.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/JasperReportsIntegration] created a ThreadLocal with key of type [net.sf.jasperreports.engine.fonts.FontUtil$1] (value [net.sf.jasperreports.engine.fonts.FontUtil$1@27385846]) and a value of type [java.util.HashSet] (value [[]]) 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.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/JasperReportsIntegration] created a ThreadLocal with key of type [net.sf.jasperreports.engine.fonts.FontUtil$1] (value [net.sf.jasperreports.engine.fonts.FontUtil$1@27385846]) and a value of type [java.util.HashSet] (value [[]]) 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.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/JasperReportsIntegration] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@2e7b2e05]) and a value of type [java.lang.Class] (value [class test_1282510960842_335563]) 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.
Oct 9, 2014 6:18:34 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 40370340
That log warning is unrelated to the main issue. Your problem is one of architecture. You need to restructure it (unless you can find some kludge to somehow add datasources to a running app - good luck with that)
0
 

Author Closing Comment

by:sysautomation
ID: 40372374
We have decided not to make live changes in the configuration file but in a file which is replica of the main config file. And in night we copy the replica file to the main config file and restart tomcat. This way the new customers have sometimes wait for up to 24 hours but that's manageable and the existing customers will face a daily restart in night which will also not impact much.
Anyhow thanks or your suggestions.
0
 
LVL 36

Expert Comment

by:mccarl
ID: 40372506
You're welcome!
0

Featured Post

Building an interactive eFuture classroom

Watch and learn how ATEN provided a total control system solution including seamless switching matrix switch, HDBaseT extenders, PDU, lighting control to build an interactive eFuture classroom.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question