Solved

Tomcat Restart

Posted on 2014-09-30
9
703 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 500 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
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

622 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