my dog learned polymorphism
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes problem with client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "problem with client" Watch "problem with client" New topic

problem with client

sreedhar kumar

Joined: Aug 24, 2005
Posts: 3
I deployed Sessionbean on Weblogic successfully...

i have written a small client program for that, whenever i run that one i am getting the fallowing exception...

import javax.naming.*;
import javax.naming.InitialContext;
import java.util.*;
import javax.rmi.PortableRemoteObject;

public class MyClient

public static void main(String[] args) throws Exception


Hashtable h = new Hashtable();
Context ctx = new InitialContext(h);
Object objref = ctx.lookup("myjndi");
MyHome home = (MyHome)PortableRemoteObject.narrow(objref,MyHome.class);
MyRemote rm = home.create();

}catch(Exception e)



C:\nagraj\ejb\sessionBean>java MyClient

Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/AssertionError
at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at MyClient.main(

I greatly appreciate if I could get help ASAP.
Ranch Hand

Joined: Oct 03, 2003
Posts: 40
Are you using jdk 1.4? AssertionError was introduced in 1.4, so if u r trying to run your program with an earlier version of jdk you might get this error.
Surya Baabu

Joined: Aug 24, 2005
Posts: 12

Looks like you are using an earlier version of JDK. From the command window check which version of the JDK is in the the path first and if it is not the latest jdk then either set the path or run the program using the full directory path of jdk for example f:\jdk1.4\bin\MyClient

Surya Baabu
Surasak Leenapongpanit
Ranch Hand

Joined: May 10, 2002
Posts: 341
Check your Weblogic version, is it recommended JDK1.4?
sreedhar kumar

Joined: Aug 24, 2005
Posts: 3
Thanks for response...

i am using j2sdk1.4.0_02...
I agree. Here's the link:
subject: problem with client
It's not a secret anymore!