Solved

Tomcat Restart

Posted on 2014-09-30
9
637 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
There are numerous questions about how to setup an IBM HTTP Server to be administered from WebSphere Application Server administrative console. I do hope this article will wrap things up and become a reference for this task. You need three things…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This video teaches viewers about errors in exception handling.

746 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