Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

class with same name conflicts?

Status
Not open for further replies.

oceandeep

IS-IT--Management
Jul 6, 2000
69
GR
Hi,

It is really a weird problem...
I am now trying to debug a system which is running on tomcat-4.1.24 and using struts. Our solution is to seperate the application into two, eg. the current one is /aaa, and we make another one /bbb with only miner changes.
I have changed log file for bbb to be something like eventlog_bbb.log, if i only run bbb under tomcat, everything is fine, but the problem happened when I put back aaa, everything has been logged to eventlog_aaa.log even though the requests were actually pointed to application /bbb
I am not sure if this is a bug for tomcat-4.1.24 or something related to struts.
Can anybody here please give me some suggestions? I would be highly appreciate!
 
When you say "I have changed the log file" , what exactly do you mean ?

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hi sedj,

There is one class in charge of logging in the application. In the original system (/aaa), it was logged to event_aaa.log file, but the new application (/bbb), I have changed it to event_bbb.log. It was alright when I only loaded bbb in tomcat, but when I put aaa back, all events have been logged to event_aaa.log, which I thinking for this version's tomcat might have bugs when loading classes with the same names.
 
Sounds like you have a JVM static class which is loaded in Tomcat's common class loader, not the webapp's separate class loader.

So when webapp "aaa" loads, then it is logging to "aaa.log", but then when webapp "bbb" loads, the log is overridden to "bbb.log".

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Hi Sedj,

Thanks for your suggestion! But could you please give me more details on how can I check if there are JVM static classes in my application and the tomcat common class loader? Thanks!
 
If the class you are using are in shared/lib or common/lib I believe they will be instantiated using the common class loader. If they are in the WEB-INF/lib directory, it will be instantiated using the webapp specific loader.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Tomcat is used by JBoss by default, so I would guess so.

--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top