While it may work in the built-in container, other containers definitely
need the stub classes to be able to manipulate the references to the remote
objects...
Hunter
> From: "Ghislain Gadbois" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Mon, 10 Sep 2001 17:05:17 -0400
> To: <[EMAIL PROTECTED]>
> Subject: RE: Call EJB in OC4J from Tomcat
>
> Actually, it seems that OC4J doesn't need stub classes at all!! It doesn't
> seem to generate any client classes when an EJB is deployed in the server.
> I ran a sample Java application and my servlet from within JDeveloper wihout
> needing any stub class at all. But, when I try to run the exact same
> servlet in another servlet container (I have the same behavior in JRun BTW),
> I keep getting ClassCastExceptions...
>
> This puzzles me...
>
> Thanks for your help.
>
> Cheers
>
> Ghis
>
>
> -----Message d'origine-----
> De : Lin, Zhongwu [mailto:[EMAIL PROTECTED]]
> Envoy� : 10 septembre, 2001 16:53
> � : '[EMAIL PROTECTED]'
> Objet : RE: Call EJB in OC4J from Tomcat
>
>
> Looks like you don't have stub classes of your ejbHome in your tomcat. Try
> put those in your application's
> \web-inf\lib (your ejb jar file)
> or \web-inf\classes ( classese file)
>
> it should work then.
>
> regards
>
>
> zlin
>
>> -----Original Message-----
>> From: Ghislain Gadbois [SMTP:[EMAIL PROTECTED]]
>> Sent: Monday, September 10, 2001 3:42 PM
>> To: [EMAIL PROTECTED]
>> Subject: RE: Call EJB in OC4J from Tomcat
>>
>> Sure, here it is...
>>
>> BTW, I used the same kind of code to call EJBs in Oracle JVM and in
>> Websphere and it always worked...
>>
>> try
>> {
>> Hashtable oEnv = new Hashtable(5); // Max needed + 1
>>
>> oEnv.put(Context.INITIAL_CONTEXT_FACTORY,
>>
>> "com.evermind.server.ApplicationClientInitialContextFactory");
>> oEnv.put(Context.PROVIDER_URL, "ormi://saturne:23791/Demo");
>> oEnv.put(Context.SECURITY_PRINCIPAL, "admin");
>> oEnv.put(Context.SECURITY_CREDENTIALS, "admin");
>>
>> InitialContext oContext = new InitialContext(oEnv);
>>
>> U2007ML_UsersHome oHome;
>>
>> // This is where I get the ClassCastException...
>> oHome = (U2007ML_UsersHome) oContext.lookup("U2007ML_UsersRemote");
>>
>> ...
>> }
>> catch(Exception ex)
>> {
>> ex.printStackTrace();
>> }
>>
>> Thanks for your help!
>>
>>
>> -----Message d'origine-----
>> De : Lin, Zhongwu [mailto:[EMAIL PROTECTED]]
>> Envoy� : 10 septembre, 2001 16:27
>> � : '[EMAIL PROTECTED]'
>> Objet : RE: Call EJB in OC4J from Tomcat
>>
>>
>> Can you show us how you make call to ejb? otherwise on one can help you
>>
>> zlin
>>
>>> -----Original Message-----
>>> From: Ghislain Gadbois [SMTP:[EMAIL PROTECTED]]
>>> Sent: Monday, September 10, 2001 3:25 PM
>>> To: Tomcat-User list (E-mail)
>>> Subject: Call EJB in OC4J from Tomcat
>>>
>>> Hi,
>>>
>>> I have a servlet deployed in Tomcat 3.2.1 on SunOS 5.6. My servlet
>> works
>>> fine.
>>>
>>> I have EJB components deployed in Oracle Containers for J2EE (OC4J)
>> which
>>> are J2EE compliant containers. I can call my EJB components from my
>>> servlet
>>> if I run my servlet from my IDE (Oracle JDeveloper 3.2.2), but, when I
>> try
>>> to call my EJB components from the servlet runn in Tomcat, I have a
>>> ClassCastException (java.lang.ClassCastException: __Proxy5).
>>>
>>> Can anyone help me on this one?
>>>
>>> What is going on?
>>>
>>> Why can't I call my EJB components when my servlet runs in Tomcat?
>>>
>>> Thanks for your help