Meaningless Drivel is fun!*
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
Author

problem with client

sreedhar kumar
Greenhorn

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...


Client:
--------
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
{

try
{


Hashtable h = new Hashtable();
h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx = new InitialContext(h);
Object objref = ctx.lookup("myjndi");
MyHome home = (MyHome)PortableRemoteObject.narrow(objref,MyHome.class);
MyRemote rm = home.create();
rm.getName();


}catch(Exception e)
{
System.out.println(e);
}



}
}


Exception:::
------------

C:\nagraj\ejb\sessionBean>java MyClient

Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/AssertionError
at weblogic.security.subject.DelegatingSubjectStack.<clinit>(DelegatingSubjectStack.java:18)
at weblogic.security.service.SubjectManagerImpl.<init>(SubjectManagerImpl.java:40)
at weblogic.security.service.SubjectManagerImpl.ensureInitialized(SubjectManagerImpl.java:277)
at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:137)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:131)
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(MyClient.java:26)


I greatly appreciate if I could get help ASAP.
Arun
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
Greenhorn

Joined: Aug 24, 2005
Posts: 12
Hi

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
Greenhorn

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


i am using j2sdk1.4.0_02...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with client
 
Similar Threads
Error In EJB
Error in EJB
Urgent....Runtime error when running client
javax.ejb.EJBException: Could not instantiate bean
need help run to first programme