Re: Re: Re: Re: Re: Strange ClassCastException when looking up SLSB RemoteHome from "external" .war webapp
Guillaume Sauthier <[email protected]>
| Newsgroups | gmane.comp.java.objectweb.jonas |
|---|---|
| Organization | Objectweb Consortium |
| Message-ID | <[email protected]> |
Can you give us the full stack trace please ?
--G
Le 19/01/2011 16:42, Hans J. Prueller a écrit :
> tried it out, classcast problem gone but another error occurs:
>
> *javax.naming.NamingException: Cannot perform lookup [Root exception
> is javax.naming.NameNotFoundException: Guardian2Home]*
> at
> org.ow2.carol.jndi.intercept.spi.InterceptableContext.namingException(InterceptableContext.java:823)
> at
> org.ow2.carol.jndi.intercept.spi.InterceptableContext.lookup(InterceptableContext.java:126)
> at
> org.ow2.carol.jndi.spi.VirtualJNDILookup.lookup(VirtualJNDILookup.java:109)
> at javax.naming.InitialContext.lookup(InitialContext.java:392)
>
> hans
>
>
> Am Mittwoch, den 19.01.2011, 10:45 +0100 schrieb Guillaume Sauthier:
>> Can you try with local.registry set to false ?
>> --G
>>
>> Le 19/01/2011 10:32, Hans J. Prueller a écrit :
>>> Guillaume,
>>>
>>> thank you. I know about the fact you mentioned
>>>
>>> >>That means that you can have the same class (same name, same
>>> bytecode, same everything), loaded by 2 different classloaders
>>> >> but that will be incompatible (you cannot cast one of them into
>>> the other).
>>>
>>> and I already "suspected" a classloader issue being responsible for
>>> the classcast problem ;-) I already tried to remove the EJB API from
>>> the WEB-INF/lib of the axis2 webapp, but that didn't solve the
>>> problem but lead to a classnotfound or noclassdeffound error.
>>>
>>> I did not change carol.properites - I am simply using JOnAS 5.1.5
>>> with its default values!
>>>
>>> carol.jvm.rmi.local.call = false
>>> carol.jvm.rmi.local.registry = true
>>>
>>> regards,
>>> Hans
>>>
>>> Am Mittwoch, den 19.01.2011, 10:25 +0100 schrieb Guillaume Sauthier:
>>>> Hi Hans
>>>>
>>>> A Class object is defined by its name AND the ClassLoader that
>>>> loaded it.
>>>> That means that you can have the same class (same name, same
>>>> bytecode, same everything), loaded by 2 different classloaders but
>>>> that will be incompatible (you cannot cast one of them into the other).
>>>>
>>>> So in your case, you have 2 places where your EJB API is available:
>>>> inside the EAR and inside the WEB-INF/lib of the axis2 webapp. So
>>>> they are not sharing the same Class definition for your EJB API.
>>>> What seems to happen is that JNDI returns an instance coming from
>>>> your EAR.
>>>>
>>>> Did you change your carol.properties ?
>>>> Can you show me the value of the following properties:
>>>> * carol.jvm.rmi.local.call
>>>> * carol.jvm.rmi.local.registry
>>>>
>>>> --G
>>>>
>>>> Le 19/01/2011 08:10, Hans J. Prueller a écrit :
>>>>> Hi,
>>>>>
>>>>> we are still working on migrating our JOnAS 4.10 based Java EE 1.4
>>>>> EAR to JOnAS 5.1.5. One (seems really to be the last) open issue
>>>>> we have is the following:
>>>>>
>>>>> Our Java EE 1.4 Application is packaged as EAR, it contains the
>>>>> EjB-JAR.JAR containing the EJB 2.1 SLSB's. It also contains 2 or 3
>>>>> webapps as .WAR file (war files within the EAR file), which are
>>>>> looking up the remote homes and remote interfaces of the SLSB's
>>>>> which works fine.
>>>>>
>>>>> Then we have another webapp, based on AXIS2 which provides
>>>>> webservices to external clients. The axis2 war file provies
>>>>> web-services,
>>>>> which also lookup the Remote Homes and Remote Interfaces of some
>>>>> of the SLSB's contained in the ear mentioned above.
>>>>>
>>>>> Therefore the remote home and remote interface stubs are packaged
>>>>> as .jar file in web-inf/lib of the axis2.war webapp.
>>>>>
>>>>> Basically this is all as it is meant to be by the Java EE
>>>>> standard, this is what remote home and remote interfaces of EJB's
>>>>> are for, and it
>>>>> really works fine and smooth on JOnAS 4.10.X
>>>>>
>>>>> When we now deploy our .EAR file and the axis2.WAR on JOnAS
>>>>> 5.1.5 and make a test-invocation of the web-service, we get a
>>>>> really strange
>>>>> ClassCastException:
>>>>>
>>>>> *Cannot cast
>>>>> 'org.ow2.jonas_gen.com.lbslogics.ims.guardian.interfaces.JOnASGuardian2Bean1797447629Home'
>>>>> in 'com.lbslogics.ims.guardian.interfaces.Guardian2Home'*
>>>>>
>>>>> When I check the source file (JOnASGuardian2Bean1797447629Home)
>>>>> generated by GenIC, it explicitly says:
>>>>>
>>>>> public class JOnASGuardian2Bean1797447629Home extends JSessionHome
>>>>> *implements com.lbslogics.ims.guardian.interfaces.Guardian2Home *{
>>>>>
>>>>> // JOnAS version used to deploy
>>>>> public static final String JONAS_VERSION = "5.1.5";
>>>>>
>>>>> [ ..... ]
>>>>>
>>>>>
>>>>> ======> so, the cast has to be possible. (and btw this works
>>>>> fine with all other .WAR's contained in the EAR itself doing the
>>>>> same). So why or what
>>>>> is the problem here ???
>>>>>
>>>>> Any ideas are appreciated because we cannot migrate our production
>>>>> servers unless also the webservices are working!
>>>>>
>>>>> regards,
>>>>> Hans
>>>>>
>>>
Guillaume_Sauthier.vcf
(text/x-vcard, 398 B)
begin:vcard fn:Guillaume Sauthier n:Sauthier;Guillaume org:<a href="http://www.ow2.org"><img title="OW2" alt="OW2 Consortium" border="0" src="http://www.ow2.org/xwiki/bin/skin/XWiki/DefaultSkin/logoOW2.png" /></a> adr:;;;;;;France email;internet:[email protected] title:<a href="http://jonas.ow2.org">JOnAS Application Server</a> url:http://jonas.ow2.org version:2.1 end:vcard