This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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
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?
Did you tried to generate the ejb client jar (containing only the local / remote interface) and then used that jar in your application classpath?
Marcelo Sousa Ancelmo - Brazil
Joined: Mar 09, 2010
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!)