OK,

I have an applet which calls a class which tries to get the connection to
the EJB.
The WebLogic server is running on port 7001 as usual. The codebase param in
the HTML file is set to "myclasses/" and I have a ClassFileServer (provided
by Sun, which only serves .class files) running on port 2001 and the
CLASSPATH in the ClasFileServer is set to c:\public_html\myclasses.
And when I call getCodeBase().getHost() it returns the name of my computer,
which I save in the variable 'host'.
Then I use the code below to set the InitialContext, but in the line

InitialContext ic = new InitialContext(p);

I get a NullPointerException with the following stack trace:

java.lang.NullPointerException
at weblogic.common.internal.ServerURL.findOrCreateRJVM(SeverURL.java:144)
at
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
ory.java, Compiled Code)
at
weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFact
ory.java, Compiled Code)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:771)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:169)
at javax.namingInitialContext.<init>(InitialContext.java:146)
at wbss.MyApplet.ConnectionClass
at wbss.MyApplet.start
at sun.applet.AppletPanel.run(AppletPanel.java:347)
at java.lang.Thread.run(Thread.java:479)

Thanks a lot for any help,
Noelia

-----Original Message-----
From: Nittle Gupta <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: 27 October 1999 05:04
Subject: Re: Connecting to an EJB from an applet


>Send the more details.I have succeded in invoking an EJBean through an
>applet.
>
>>----------
>>From:  noelia[SMTP:[EMAIL PROTECTED]]
>>Sent:  Wednesday, October 27, 1999 12:02 AM
>>To:    [EMAIL PROTECTED]
>>Subject:       Connecting to an EJB from an applet
>>
>>Hi,
>>
>>I have an EJB running in the WebLogic server, when I use an application
>>as a
>>client I can get a connection to the EJB no problem, but when I try to
>>get
>>the connection from an applet it throws a NullPointerException when
>>trying
>>to set the initial context.
>>
>>I have tried two different ways:
>>
>>Properties p = new Properties();
>>p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContex
>>tFac
>>tory");
>>p.put(Context.PROVIDER_URL, "t3://" + host + ":7001/");
>>InitialContext ic = new InitialContext(p);
>>System.err.println("looked up initial context");
>>MyEJBHome bh = (MyEJBHome) ic.lookup("MyEJBHome");
>>
>>and:
>>
>>Hashtable env = new Hashtable(5);
>>env.put(Context.INITIAL_CONTEXT_FACTORY,
>>           "weblogic.jndi.WLInitialContextFactory");
>>env.put(Context.PROVIDER_URL,
>>           "t3://weblogicServer:7001");
>>Context ic = new InitialContext(env);
>>System.err.println("looked up initial context");
>>MyEJBHome bh = (MyEJBHome) ic.lookup("MyEJBHome");
>>
>>in both cases I never get to see 'looked up initial context' in the
>>screen,
>>and I get a NullPointerException, I could provide more details about
>>the
>>trace of the exception if anyone would like to see them.
>>Thank you very much,
>>Noelia.
>>
>>========================================================================
>>===
>>To unsubscribe, send email to [EMAIL PROTECTED] and include in the
>>body
>>of the message "signoff EJB-INTEREST".  For general help, send email to
>>[EMAIL PROTECTED] and include in the body of the message "help".
>>
>>
>
>===========================================================================
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff EJB-INTEREST".  For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to