• Post Reply Bookmark Topic Watch Topic
  • New Topic

Classloader differences in a web service

 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I've got this application X. If I list the contents of the classloader to see what classes are part the application's classpath, I get a huge list of - well pretty much what I expected.

With the exact same bit of code listing the classpath, I try to list the contents of my app's classpath once it's exposed as an Axis 1.4 WS. And wow it's very different. Have a look below.

I'd greatly appreciate an explanation! Or possibly a link to some resources online.

The code used to list the classpath


The response from the application (when run as a standard Java 1.5 app):
I spared you the whole list.

And now for the other one when the very same app is now wrapped as an Axis 1.4 WS and deployed in Tomcat. It is then called from a JUnit test that uses a simple client stub.


So why??

This is puzzling me. In addition to that, I get different behaviors when I run the app as is or as a WS (but that's for another post I guess...)

Thanks guys.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't say I'm surprised, although I've never experimented with this. All that this tells you is that web apps use various additional classloaders to perform their duties, not all of which are provided access to all the classes that the root class loader uses. What's more, Axis may use still more classloaders for the various services it runs, in order to isolate them from each other, and to shield itself from anything one of the services might do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!