Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exception while running client of Stateless Bean  RSS feed

 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello sir, madam

I am getting the following exception when I run the client program for stateless session bean. I dont know how to get rid of this exception.. Can anyone please help me on this ?

"Advisor" is my JNDI name which I gave during deployment using the deploytool of RI. The bean gets deployed properly and no exceptions are raised during deployment.

Following is my client program
***************************************************************************

package headfirst;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;

public class AdviceClient
{
public static void main(String[] args)
{
new AdviceClient().go();
}

public void go()
{
try
{
Context ic = new InitialContext();
Object o = ic.lookup("Advisor");
IAdviceHome home = (IAdviceHome)PortableRemoteObject.narrow(o, IAdviceHome.class);
IAdviceComponent advisor = home.create();
System.out.println(advisor.getAdvice());
}catch(Exception e)
{
e.printStackTrace();
}
}
}

***************************************************************************

Following is the exception I get

***************************************************************************
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/JDKBridge
at com.sun.corba.ee.internal.core.IOR$LocalCodeBaseSingletonHolder.<clinit>(IOR.java:90)
at com.sun.corba.ee.internal.core.IOR.<init>(IOR.java:238)
at com.sun.corba.ee.internal.iiop.messages.LocateReplyMessage_1_2.read(LocateReplyMessage_1_2.java:137)
at com.sun.corba.ee.internal.iiop.IIOPInputStream.unmarshalHeader(IIOPInputStream.java:126)
at com.sun.corba.ee.internal.iiop.IIOPConnection.getResponse(IIOPConnection.java:671)
at com.sun.corba.ee.internal.iiop.IIOPConnection.send(IIOPConnection.java:778)
at com.sun.corba.ee.internal.corba.InitialNamingClient.locateObject(InitialNamingClient.java:786)
at com.sun.corba.ee.internal.corba.InitialNamingClient.getIORUsingHostInfo(InitialNamingClient.java:597)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveCorbaloc(InitialNamingClient.java:573)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolveUsingORBInitRef(InitialNamingClient.java:544)
at com.sun.corba.ee.internal.corba.InitialNamingClient.cachedInitialReferences(InitialNamingClient.java:1080)
at com.sun.corba.ee.internal.corba.InitialNamingClient.resolve_initial_references(InitialNamingClient.java:981)
at com.sun.corba.ee.internal.corba.ORB.resolve_initial_references(ORB.java:2425)
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:52)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at headfirst.AdviceClient.go(AdviceClient.java:31)
at headfirst.AdviceClient.main(AdviceClient.java:23)
***************************************************************************

Seeing this NoClassDefFoundError I tried to reinstall Reference Implementation server but even after doing that I was unable to get rid of this exception.

Can anyone please help me as to where I am going wrong.

Thanks and Regards
Rohit.
 
Rohit Bhagwat
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,

Problem is resolved. Was running the client with Java 1.5. Switched to 1.4 and everything is working fine !!

Thanks and Regards
Rohit.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!