aspose file tools*
The moose likes Tomcat and the fly likes [Tomcat 6] Class loader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "[Tomcat 6] Class loader" Watch "[Tomcat 6] Class loader" New topic
Author

[Tomcat 6] Class loader

antonio each
Greenhorn

Joined: Apr 05, 2011
Posts: 9
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?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
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

Java Resources at www.wbrogden.com
antonio each
Greenhorn

Joined: Apr 05, 2011
Posts: 9
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!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18114
    
    8

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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Tomcat 6] Class loader
 
Similar Threads
Servlet and database
Any experiences with migration from Tomcat 5 to Tomcat 6?
how to write java web service client
Externally hosted Tomcat: How to use DB-Driver if not in %CATALINA-HOME%/lib ???
getting error as Dispatcher initialization failed Unable to load configuration