Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

InitialContext - Applet Problem

0 views
Skip to first unread message

Abdul Malik

unread,
Jun 20, 2001, 3:38:14 AM6/20/01
to
Hi,

When i try to get InitialContext from Applet ( running from appletviewer),
i'm hitting this error. Please help me to solve this problem

Exactly this line gives the error
InitialContext ic = new InitalContext ( hEnv )

Error:
javax.naming.NoInitialContextException: Cannot Instantiate class:
weblogic.jndi.WLInitialContextFactory

-regards
Abdul Malik

Abdul Malik

unread,
Jun 20, 2001, 5:13:59 AM6/20/01
to
>set classpath
CLASSPATH=c:\j2ee\lib\j2ee.jar;c:\weblogic\classes;c:\java2\lib\tools.jar;c:
\weblogic\lib\weblogicaux.jar

i have tried in another pc ( version 1.2.2 ) and hit another error (
confusing!!!!!!!!!)
>appletviewer JOracle.htm
java.lang.NoClassDefFoundError: javax/naming/InitialContext
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:241)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:517)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:453)
at sun.applet.AppletPanel.run(AppletPanel.java:291)
at java.lang.Thread.run(Thread.java:479)

classpath is same, but the java version is different ( earlier one is
version 1.3 )

Weblogic Version: 5.1 sp 7
"Daniel Hoppe" <ho...@sitewaerts.de> wrote in message
news:923A7281CDB7D4118A50...@samoa.sitewaerts...
Hi Abdul,

what is the classpath of your applet? You need to include the WebLogic
classes (or a certain subset of them - unfortunately there's not a
client jar so far) in your applet's classpath for this to work.

Daniel

> -----Ursprüngliche Nachricht-----
> Von: Abdul Malik [mailto:abd...@tp.edu.sg]
> Bereitgestellt: Mittwoch, 20. Juni 2001 09:38
> Bereitgestellt in: jndi
> Unterhaltung: InitialContext - Applet Problem
> Betreff: InitialContext - Applet Problem

Anthony A.

unread,
Jun 22, 2001, 12:09:54 PM6/22/01
to
As a test, try to place the j2ee.jar and weblogic.jar in your <archive tag>.
I have this code in my applet's init() method and it fails due to a JMS
Exception.
I'm using BEA's web server, jndi server, and app server on the same box as
the client.
Thanks,
Anthony


code:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://anthony01:7001");
System.out.println("creating context");
InitialContext ctx = new InitialContext(ht);

error:
JMSException: weblogic.jms.common.JMSException: java.rmi.MarshalException:
failed to marshal public abstract weblogic.jms.client.JMSConnection
weblogic.jms.frontend.FEConnectionFactoryRemote.createConnection(weblogic.rj
vm.JVMID,weblogic.jms.client.JMSCallbackRemote) throws
javax.jms.JMSException,java.rmi.RemoteException; nested exception is:
java.io.NotSerializableException: weblogic.jms.client.JMSCallback

"Abdul Malik" <abd...@tp.edu.sg> wrote in message
news:3b306aa1$1...@newsgroups.bea.com...

Abdul Malik

unread,
Jun 23, 2001, 3:44:31 AM6/23/01
to
Dear Friends,

After 5 days of struggle, somehow i was managed to access the EJB from
Applet. But very slow coz of Big Jar files ( can make it bit small by
identitfying required classes ). I dont know this is correct approach or
not, but works ( damn slow )

What i did was
1) Installed the Latest Plugin 1.3.1
2) Downloaded HTMLConverter tool from java.sun.com and converted my
html file to use plugin.
3) inlcuded few jar files in archive tag.

The files i added in archive tag is
1) myapplet.jar ( applet classes )
2) weblogicaux.jar ( !!!!!!!!!!!! quite big jar file )
3) weblogicclass.jar ( jarred all the classes from classes\weblogic folder
(!!!!!!!!!! so big jar file !!!!!! )
4) myejb.jar ( suppose to work with home and remote class, but not working
( looking for container generated files). so i added my EJB.jar file. dont
know why ?????????? )

then it works.

well, i am not happy with this kind of approach. if any body have efficient
one, please kindly post it.

Note: i tried in 1.2.2 plugin ( works )

Environment: Windows 2000 / Windows 98, Weblogic 5.1 Service pack 7

-regards
Abdul Malik

"Daniel Hoppe" <ho...@sitewaerts.de> wrote in message
news:923A7281CDB7D4118A50...@samoa.sitewaerts...

Anthony,

why should he place j2ee.jar in the applet classpath? Shouldn't be there
actually. Your problem seems to be related to a class which is not
serializable.

Daniel

> -----Ursprüngliche Nachricht-----
> Von: Anthony A. [mailto:anth...@hotmail.com]
> Bereitgestellt: Freitag, 22. Juni 2001 18:10


> Bereitgestellt in: jndi
> Unterhaltung: InitialContext - Applet Problem

> Betreff: Re: InitialContext - Applet Problem

minjiang

unread,
Jun 29, 2001, 3:59:50 AM6/29/01
to
why do you have to call your ejbs in applet directly? Why not use a servlet in
between?
The overhead of downloading so many so big jar files to the client machine will
kill/time out any broswer http session.

mj

Anthony A.

unread,
Jun 29, 2001, 8:35:42 AM6/29/01
to
What if you want to perform some type of 'realtime' push from the server?
Anthony

"minjiang" <minj...@fairex.com> wrote in message
news:3B3C3576...@fairex.com...

minjiang

unread,
Jul 2, 2001, 2:39:45 AM7/2/01
to
you can use applet to pull data periodically from the servlet.

mj

0 new messages