Discussions

EJB programming & troubleshooting: problem with session Bean Client

  1. problem with session Bean Client (1 messages)

    Hi,

       I deployed Session(stateless)bean successfully deployed on weblogic 8.1.

    But i have probelm with my client, when i run my client program it is giving some exception..

    Client:
    import javax.naming.*;
    import javax.naming.spi.*;
    import java.util.*;
    import javax.rmi.PortableRemoteObject;
    import java.rmi.*;


    public class MyClient
    {

    public static void main(String[] args)
    {


       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("java:comp/env/ejb/myjndi2");

    MyHome home = (MyHome)PortableRemoteObject.narrow(objref,MyHome.class);

    MyRemote rm = home.create();

    rm.getName();


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


    }

    }

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

    C:\test>java MyClient
    Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/AssertionEr
    ror
            at weblogic.security.subject.DelegatingSubjectStack.<clinit>(DelegatingS
    ubjectStack.java:18)
            at weblogic.security.service.SubjectManagerImpl.<init>(SubjectManagerImp
    l.java:40)
            at weblogic.security.service.SubjectManagerImpl.ensureInitialized(Subjec
    tManagerImpl.java:286)
            at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialConte
    xtFactoryDelegate.java:144)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
    extFactory.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.m(MyClient.java:21)
            at MyClient.main(MyClient.java:46)


    Anybody please help me out....
  2. java.lang.AssertionError is a core class that's been part of Java since 1.4 (when assertions where introduced.)

    It looks like you have an old version of Java.