[jboss-user] [JNDI/Naming/Network] - AXIS Web Service Cannot Perform JNDI Lookup/Cast

cmpaul do-not-reply at jboss.com
Wed Nov 28 12:49:55 EST 2007


Hello,This is probably an AXIS-specific issue, in which case I apologize for wasting anyone's time here, but I hope that someone who's had experience with it might be able to help.I am attempting to performing a JNDI lookup of an EJB from within my AXIS web service class. This works successfully and returns me a $Proxy object! The jmx-console JNDIview shows me that I am performing this lookup with the correct path, and also shows me that the $Proxy class implements the correct interface. However when I attempt to cast the returned object to this interface, I am receiving a ClassCastException. I read the JBoss WIKI entry on this, and assumed the exception was caused by deploying two instances of my interface -- which is in fact the case -- even though a displayClassInfo() in the jmx-console reveals only one instance is getting created by the class loader: ### Instance0 found in UCL: org.jboss.mx.loading.UnifiedClassLoader3 at 3fa5ac{ url=null ,addedOrder=2}If I try remedy this by removing the duplicate .jar anyway, my AXIS web service class fails to compile.My deployment looks like this:mydeployment.earmydeployment.war (AXIS web app)WEB-INF/lib/myjar.jar (duplicate JAR to compile WebService.jws)WebService.jws (AXIS class that performs JNDI lookup of EJB)myjar.jar (EJB and interfaces here)As you can see, I have two copies of myjar.jar. If I remove the second from WEB-INF/lib, the WebService.jws fails to compile when invoked. If I leave it there, it compiles fine and is able to perform a JNDI lookup but is not able to cast it to the proper interface... sort of a "damned if you do, damned if you don't" situation.Does anyone know why WebService.jws can't pick up the classes in mydeployment.ear/myjar.jar from within mydeployment.ear/mydeployment.war if I remove the duplicate jar?Does anyone with experience in this area have suggestions as to how I could configure this deployment to work?Many thanks in advance --Chris

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4108627#4108627

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4108627




More information about the jboss-user mailing list