Solved

Tomcat Restart

Posted on 2014-09-30
9
653 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
  • 4
  • 3
  • 2
9 Comments
 
LVL 35

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 35

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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 35

Expert Comment

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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java Loop 6 59
Why method in Java which is called from Runnable run() doesn't need to be 'static'? 1 24
expectj telnet failing 5 35
null output 3 24
Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

786 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