Contact EJB from Applet

Discussions

EJB programming & troubleshooting: Contact EJB from Applet

  1. Contact EJB from Applet (1 messages)

    Hi all!
    Need urgent help. We try to contact an session ejb ( deployed to the OC4J - Server ). but it hangs , while creating the InitialContext !!! No exception, the programm stops only, while creating the new initialContext...
    It works great, when connecting the ejb from an application, but NOT from an applet. Is there somebody out there, having a solution for that problem ?? Or Somebody know an example, where an applet connects an EJB ??

    Please help.

    For further information : the source code :

    System.out.println("BEGIN getInitialContext() ...");

    Hashtable env = new Hashtable();

    env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL, "ormi://***.***.***.***/Server");
    env.put(Context.SECURITY_PRINCIPAL, "******");
    env.put(Context.SECURITY_CREDENTIALS, "*****");

    try {

    System.out.println(" BEGIN Create InitialContext");

    javax.naming.InitialContext ic = new javax.naming.InitialContext(env);

    System.out.println(" END Create InitialContext");

    System.out.println("END getInitialContext() ...");

    return ic;

    } catch (Exception e) {

    throw e;
    }
    }




  2. Contact EJB from Applet[ Go to top ]

    Are the vendor's InitialContext implementation classes available to the applet? i.e is it in the applet's classpath? Instead of throwing the exception after catching it, you can try logging it somewhere ...

    Check out this link for some information on accessing an EJB from an applet:

    http://www.jguru.com/faq/view.jsp?EID=46410

    Hope this helps.
    --Das