File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Very frustrating....please help (Weblogic 5.1.0) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Very frustrating....please help (Weblogic 5.1.0)" Watch "Very frustrating....please help (Weblogic 5.1.0)" New topic

Very frustrating....please help (Weblogic 5.1.0)

Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
Hi friends
I am a newbie to the world of EJB/Weblogic. I have successfully deployes a entity bean with cmp in Weblogic5.1.0 (or at least the EJB Deployer and console says so!!!). However, I am not able to access it with the client. given below is the relevant code of the client:
import javax.naming.*;
import javax.rmi.*;
import java.util.*;
import javax.ejb.*;
import java.rmi.*;
import com.sanjeev.ejb.*; //The package where all bean classes reside. This jar file is placed in the classpath.
public class CabinClient
public static void main(String args[])
Hashtable p=new Hashtable();
Context jndiContext=new InitialContext(p);
Object ref=jndiContext.lookup("Cabin");//<--HERE
/*CabinHome home=(CabinHome)PortableRemoteObject.narrow(ref,CabinHome.class);
Cabin cabin_1=home.create(1);
cabin_1.setName("Master Suite");
System.out.println("Completed Entry");*/
catch(Exception e)
System.out.println("Sorry: "+e);
When i run this client, an exception is reported at the line commented (Here) in the code. The message is as follows
Sorry: javax.naming.ConfigurationException [Root exception is weblogic.rmi.ServerException: A remote exception occurred while executing the method on the remote object - with nested exception:[weblogic.rmi.MarshalException: error marshalling return - with nested exception:[weblogic.rmi.server.ExportException: A description for com.sanjeev.ejb.CabinBeanHomeImpl was found but it could not be read due to: [Failed to find a stub for [class com.sanjeev.ejb.CabinBeanHomeImpl] implements at least one interface [interface com.sanjeev.ejb.CabinHome] which extends Remote.] weblogic.rmi.StubNotFoundException: Failed to find a stub for [class com.sanjeev.ejb.CabinBeanHomeImpl] implements at least one interface [interface com.sanjeev.ejb.CabinHome] which extends Remote. at weblogic.rmi.extensions.BasicDescriptor.<init>(
at weblogic.rmi.extensions.BasicRuntimeDescriptor.<init>(
at weblogic.rmi.internal.DescriptorManager.resolveClass(
at weblogic.rmi.internal.DescriptorManager.getDescriptor(
at weblogic.rmi.internal.DescriptorManager.getDescriptor(
at weblogic.rmi.internal.OIDManager.getRequestDispatcher(
at weblogic.rmi.internal.OIDManager.getReplacement(
at weblogic.rmi.internal.OIDManager.replaceObject(, Compiled Code)
at weblogic.common.internal.WLObjectOutputStreamBase.replaceObject(, Compiled Code)
at weblogic.common.internal.WLObjectOutputStreamBase.writeObject(, Compiled Code)
at weblogic.common.internal.WLObjectOutputStreamBase.writeObjectWL(, Compiled Code)
at weblogic.rmi.extensions.AbstractOutputStream2.writeObject(
at weblogic.jndi.toolkit.BasicWLContext_WLSkel.invoke(
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(, Compiled Code)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(
at weblogic.rmi.internal.BasicExecuteRequest.execute(
at, Compiled Code)]]]
Could someone please help. It has frustrated me for one full day and i don't like to move forward w/o clearing my concepts
Thanx in advance
PS: BTW, is the wrox book on EJB with Weblogic server 5.1.0 good?
Jim Baiter
Ranch Hand

Joined: Jan 05, 2001
Posts: 532
If it failed to find the stub then you may not have all the necessary classes in the jar. I would look at the Weblogic samples they give you and make sure you follow the same steps they have in their examples.
Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
Hi Jim
I'm not saying I'm not wrong, cz definately I am. But I have followed the example code ditto. I have posted it so that anyone can see and comment on it.
Thanx for the reply anyway
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1868
We have a forum dedicated to Weblogic in the products section. Please post your queries regarding Weblogic there not here. This forum is dedicated to EJB and J2EE.
mohit joshi
Ranch Hand

Joined: Sep 23, 2000
Posts: 243
Make sure that that stubs(including all the bean classes) and all helper classes are available on the client machine and are on the classpath( from where you are trying to remotely access the bean ). Also make sure that the objects that you are trying to pass as arguments are implementing the serializable interface.
This problem shouldnt be difficult to solve.
Mohit Joshi
Sanjeev Verma
Ranch Hand

Joined: Aug 24, 2000
Posts: 87
Hi Mohit
Thanx for the reply.
Nope, all u said is already there and doesn't help. BTW, i tried to implement the same client code as a servlet running inside weblogic, and that is working fine!!!??? Any pointers!!!
Thanx again
Shaibaz Gadhwala

Joined: Jan 22, 2001
Posts: 11
See there is some problem with EJB Deployer of Weblogic 5.1..
Just do onething...
execute the following command to generate the stub for the client in the directory where you have the JAR file present. Actually the graphical EJB deployer doesn't generate the client stubs to do so issue the following command
java weblogic.ejbc OldEJB.jar NewEJB.jar
where NewEJB.jar is the new file with the stubs generated..
then register this file in the file and you would be able to execute it from the client
[This message has been edited by Shaibaz Gadhwala (edited June 26, 2001).]
[This message has been edited by Shaibaz Gadhwala (edited June 26, 2001).]
I agree. Here's the link:
subject: Very frustrating....please help (Weblogic 5.1.0)
It's not a secret anymore!