users@glassfish.java.net

JNDI from signed applet

From: <glassfish_at_javadesktop.org>
Date: Tue, 03 Mar 2009 11:48:40 PST

I am currently using Glassfish as my application server.In my
application I have a signed applet and I need to perform a JNDI lookup
from that applet in order to access my database.The problem is that i
get the following exception- "javax.naming.NoInitialContextException: Need to specify class name
in environment or system property, or as an applet parameter,
or in an application resource file: java.naming.factory.initial"
.I have added the classes appserv-rt.jar,j2ee.jar to my
classpath.

Here is my Manifest.MF file
Manifest-Version: 1.0
Class-Path: appserv-rt.jar j2ee.jar
Created-By: 1.6.0_11 (Sun Microsystems Inc.)

Name: com/cff/util/SendEmail.class
SHA1-Digest: 2N2rjKFTln42B6lzPf6fdS31c6Y=

Name: usb/windows/Windows$HostImpl.class
SHA1-Digest: ONBjDOPJBwJZ//5U47RSoHuxvnQ=
..................etc......

Here is my stack trace for certain debugging information:

javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file:
java.naming.factory.initial
       at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
       at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at com.cff.model.DeviceDAO.<init>(DeviceDAO.java:38)
       at com.cff.model.DeviceService.<init>(DeviceService.java:18)
       at com.cff.pluggable.AppletUSBController.printUSBStack(AppletUSBController.java:81)
       at com.cff.pluggable.AppletUSBController.scanForUSBDevices(AppletUSBController.java:56)
       at com.cff.pluggable.AppletUSBController.start(AppletUSBController.java:29)
       at sun.applet.AppletPanel.run(Unknown Source)
       at java.lang.Thread.run(Unknown Source)


Please suggest me on what to add and how to do it.
Thanks a lot

Best regards
Sree Aurovindh
Sun Certified Web Component Developer
[Message sent by forum member 'sreeaurovindh' (sreeaurovindh)]

http://forums.java.net/jive/thread.jspa?messageID=334895