tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lin, Zhongwu" <Zhongwu_...@AFCC.com>
Subject RE: Call EJB in OC4J from Tomcat
Date Mon, 10 Sep 2001 21:39:47 GMT
If I remember correctly Jdeveloper is really a Jbuilder repackage, then it
uses corba iiop.

You have to have stubs in client(tomcat) to make it to work. 

if you just put whole ejb jar file in your application's
web-inf\lib
or all of your ejb classese files under
web-inf\classese

I know by doing so you are copying extra classes to your tomcat dir (but
this would not hurt you besides a few megs of disk space )

I am pretty sure it will work 

regards

zlin

> -----Original Message-----
> From:	Ghislain Gadbois [SMTP:ghislain.gadbois@cognicase.com]
> Sent:	Monday, September 10, 2001 4:05 PM
> To:	tomcat-user@jakarta.apache.org
> 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:Zhongwu_Lin@afcc.com]
> Envoyé : 10 septembre, 2001 16:53
> À : 'tomcat-user@jakarta.apache.org'
> 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:ghislain.gadbois@cognicase.com]
> > Sent:	Monday, September 10, 2001 3:42 PM
> > To:	tomcat-user@jakarta.apache.org
> > 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:Zhongwu_Lin@afcc.com]
> > Envoyé : 10 septembre, 2001 16:27
> > À : 'tomcat-user@jakarta.apache.org'
> > 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:ghislain.gadbois@cognicase.com]
> > > 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

Mime
View raw message