users@glassfish.java.net

WebServices and ClassNotFoundException

From: <glassfish_at_javadesktop.org>
Date: Wed, 09 Jul 2008 12:49:40 PDT

My application is defined as an EAR file and it contains a single EJB project. I've defined at the root level of the EAR project a lib directory that contains all of my 3rd party libraries that my EJB's are dependent upon. I have 6 Stateless EJB's that are also defined as WebServices. I am able to successfully deploy my application to GlassFish and wsgen successfully exposes my web services. (I can see them in the admin console) My EJB's have defined an @Interceptors annotation so I can use Spring.

@Interceptors(SpringBeanAutowiringInterceptor.class)

The problem I have is when I attempt to access the web service I get ClassNotFoundException thrown pertaining to classes that are embedded within my 3rd party library files. The only solution that I have found currently is to copy each one of the libraries into the GlassFish/lib directory. (spring.jar, ibatis.jar, hibernate.jar, cglib.jar, commons-collections.jar, commons-logging.jar, aspectjweaver.jar, ...)

These libraries are contained within my ear file in the lib directory, so why can't GlassFish locate them and why must I copy them into the GLassFish/lib directory to get things to work? Do I have something incorrectly defined in my ear?

Thanks...
[Message sent by forum member 'cmathrusse' (cmathrusse)]

http://forums.java.net/jive/thread.jspa?messageID=285472