• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Tomcat 6] Class loader

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I have a web application (a portlet developed with IceFaces 1.8.2) deplyed through liferay 5.2.3 into tomcat 6.0,which deal with several web services.
To decouple presentation logic from the webservices domain objects I have created four different projects in eclipse:

1. ExampleWEB: is the Dynamic web projectm
2. ExampleFacade: is the 'middle tier' which interfaces with the web services client
3. ExampleDTO: data transfer object
4. ExampleWSClient: web services client

Ok,let's go to the problem .....

For business internal rules I have to externalize all libs from .war (so,I can't create ExampleFacade.jar,ExampleDTO.jar,ExampleWSClient.jar and put them into WEB-INF/lib):

If I put these jar into Tomcat lib directory,app deploy and start with success,but when i try to click on button to call a web service method nothing seems to happens. No Exceptions,No Errors,No output....nothing....

P.s.: Client uses axis lib (axis.jar etc etc)

Any idea?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i try to click on button to call a web service



If this was my problem I think I would use TCPMON or SOAPui or something similar to capture the exact text of the request - if any.

Are you executing this client from inside Eclipse or stand alone?

Bill
 
antonio each
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Client in it self is not the problem. In fact if I try to put all my jars into WEB-INF/lib of web-app all work very well.

This problem appair when i try to put all jars into Tomcat/lib,so i think at class loader problem.

P.s.: HOwever Thank you for your quick answer!
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That would cause problems if you expected a class in one of those jars to be able to load a class from your web application. The Tomcat system library is served by a class-loader which doesn't have access to any of the classes in any of the web applications running in the server.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:That would cause problems if you expected a class in one of those jars to be able to load a class from your web application. The Tomcat system library is served by a class-loader which doesn't have access to any of the classes in any of the web applications running in the server.



Also, it's extremely dangerous to dump jars into the Tomcat system library directory unless they were specifically designed to be usable there (like JDBC driver jars, for example). Not only are there classpath issues, but there are thread-safety considerations.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic