Solved

Tomcat Restart

Posted on 2014-09-30
9
647 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
 
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

930 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now