• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running a Java client that connects to EJBs deployed on WAS 7 without stubs

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've a problem in connecting to EJBs (EJB 2.0) deployed on WAS 7.0. I'm connecting through a desktop client by using the jars located in %was_home%\runtimes but when I look up on the EJB deployed on the server I get the following exception:

java.lang.ClassCastException: Unable to load class: com.asset.jupiter.rm.ejb._RM
EJBHome_Stub
at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObjec
t.java:372)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)

after research I've found that the client looks for EJB stub classes but they are not found on the client jars so the exception is thrown. I've tried copying the jars containing the EJBs and their generated stubs from WAS deployment directory to my client directory and the application launched successfully. My question is, is there a way to connect to the EJBs from the local client WITHOUT having these stub classes in my client jars?

waiting for your support..many thanks
 
Ranch Hand
Posts: 498
Eclipse IDE Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Mohamed,

Did you tried to generate the ejb client jar (containing only the local / remote interface) and then used that jar in your application classpath?

Regards,
 
Mohamed Soliman
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Marcelo

This is the exact scenario I'm having

1. I deployed the EAR file of my application which contains the jar file of the EJBs (the jar file is generated by jdeveloper 10.0.0.1 without stubs)

2. I deploy the EAR file using Websphere deployment console and in the deployment directory, I found that webpshere injects the stub classes into the jar file of the ejbs (this jar WORKS when copied to the client application's classpath)

3. On the client classpath, I've the version of the jar BUT without stubs (this throws the exception)

4. I need to run the client with the version without the stubs (because I dont want to copy the deployed websphere jar to each client)

also I've a question, I've read that the j2ee EJB specification requires the stubs to be available in BOTH the client and the server as well, does JBOSS and OC4J (my application works on these containers WITHOUT the stubs being on either the client or the server!)

thanks alot for your reply!
 
Sheriff
Posts: 7136
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marcelo, please check your private messages regarding an important administrative matter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic