I try to call an .ear on my websphere 6. it 's deployed with the following properties:
Module | EJB | EJB URI | Nom JNDI ------------------------------------------------------------------- T9AS | CallServer | t9as-fw.jar,META-INF/ejb-jar.xml | T9AS
and I have the following problem:
java.lang.ClassCastException: Unable to load class: com.itnsa.fw.server.interfaces._CallServerHome_Stub at com.ibm.rmi.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:366) at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:157) at TestAppelEjb.<init>(TestAppelEjb.java:153) at TestAppelEjb.main(TestAppelEjb.java:30)
(I don't understand why I have a stub problem with the EJB abstraction: why the ibm can do that to me ;-) other information: -I use JDK 1.5 -I have configured a "JDBC provider" on my websphere and it's working (the websphere 's console 's test is good)
It looks as if the stub class (generated by Websphere) of CallServerHome is not on the client's classpath.
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Joined: Mar 27, 2006
Thanks for your help Roger . " import com.itnsa.fw.server.interfaces.*; " unfortunately it doesn't solve the problem.
I don't understand a fundamental process: when we work with the RMI IIOP protocol (in the last versions of java's standard) , we have to create just a Stub for the client with the rmic command (is it true?).
I have written a little application in RMI this weekend and I had just to add a stub on the client side (if I have a good memory) and I succed.
But the problem with the EJB (I deploy an .ear on my websphere) is the following: I build an .ear and I deploy it on my websphere. I build a .jar for my client (for the dependencies). this process don't allowed me to put an stub anywhere.
to solve my pb I create stub from my class in my eclipse workspace " set ROOT_DIR=. set JAVA_HOME=C:\Program Files\IBM\WebSphere\AppServer\java\jre set CLASSPOT = .; %ROOT_DIR%\Coplib\activation.jar; %ROOT_DIR%\Coplib\bsf.jar; %ROOT_DIR%\Coplib\bsh-2.0b2.jar; %ROOT_DIR%\Coplib\Common.jar; %ROOT_DIR%\Coplib\commons-collections-3.0.jar; %ROOT_DIR%\Coplib\commons-dbcp-1.2.1.jar; %ROOT_DIR%\Coplib\commons-io-1.0.jar; %ROOT_DIR%\Coplib\commons-lang-2.0.jar; %ROOT_DIR%\Coplib\commons-mail.jar; %ROOT_DIR%\Coplib\commons-pool-1.2.jar; %ROOT_DIR%\Coplib\db2fs.jar; %ROOT_DIR%\Coplib\db2java.jar; %ROOT_DIR%\Coplib\db2jcc.jar; %ROOT_DIR%\Coplib\db2jcc_javax.jar; %ROOT_DIR%\Coplib\db2jcc_license_cisuz.jar; %ROOT_DIR%\Coplib\db2jcc_license_cu.jar; %ROOT_DIR%\Coplib\db2policy.jar; %ROOT_DIR%\Coplib\groovy-all-1.0-jsr-03.jar; %ROOT_DIR%\Coplib\iText.jar; %ROOT_DIR%\Coplib\jakarta-oro-2.0.8.jar; %ROOT_DIR%\Coplib\jboss-j2ee.jar; %ROOT_DIR%\Coplib\jdom.jar; %ROOT_DIR%\Coplib\jt400.jar; %ROOT_DIR%\Coplib\jtds-1.1.jar; %ROOT_DIR%\Coplib\mail.jar; %ROOT_DIR%\Coplib\mysql-connector-java-3.0.15-ga-bin.jar; %ROOT_DIR%\Coplib\objectprofiler.jar; %ROOT_DIR%\Coplib\ojdbc14.jar; %ROOT_DIR%\Coplib\ooffice.jar; %ROOT_DIR%\Coplib\QuickServer.jar; %ROOT_DIR%\Coplib\xerces.jar; rmic -iiop -classpath %CLASSPOT% com.itnsa.fw.server.interfaces.CallServerHome " (I works good)
I build my .jar and I put the "_CallServerHome_Stub.class" in the path referenced by the ERROR with Winrar (near the "CallServerHome")
It doesn't solve my problem. The ejb client want the stub
It is incredible: I had deployed (in januar) my .ear in Oracle Application Server and after a little work , it was good....
What can i do? Thanks for your help .
Joined: Mar 27, 2006
My boss solve the problem :
when you deploy your .ear in websphere , it modifies the .jar included in the .ear with the stub class.
The pb is the following: My client point on my locally .jar I have modify the solution is to point on the .jar on websphere