-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I should add, that I have no problems running the program as a standalone client, the bug/whatever only appears inside applets. CT - -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 23. november 2000 17:06 To: Orion-Interest Subject: java:comp/env namespace is only available from within a J2EE com ponent Weird exception: Recently, I have been getting this error from my applet: 16:54:30 [unknown class] [ERROR] Exception caught. Stack trace follows: javax.naming.NamingException: java:comp/env namespace is only available from within a J2EE component at com.sun.enterprise.naming.java.javaURLContext.getComponentContext(java URLContext.java:392) at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.ja va:51) at javax.naming.InitialContext.lookup(Unknown Source) at com.telenor.mobil.planit.appit.util.AppitUtilities.getHome(AppitUtilit ies.java:254) at com.telenor.mobil.planit.appit.util.AppitUtilities.getSessionHome(Appi tUtilities.java:104) at com.telenor.mobil.planit.doping.applet.RnpAppletSharedProperties.<init >(RnpAppletSharedProperties.java:75) at com.telenor.mobil.planit.doping.applet.RnpAppletSharedProperties.getIn stance(RnpAppletSharedProperties.java:298) at com.telenor.mobil.planit.doping.applet.RnpApplet.init(RnpApplet.java:1 95) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Does anyone know what this means? If the java:comp/env namespace is only available from within a J2EE component, then how is it possible to program a client or applet which should communicate with my EJBs? The code creating the error is: private static final EJBHome getHome( String remoteInterfaceName, String moduleName, String beanType ) throws ClassNotFoundException, NamingException { if( DEBUG ) Log.debug( "getHome( " + remoteInterfaceName + " " + moduleName + " " + beanType + " )", instance ); final StringBuffer homeName = new StringBuffer( "com.telenor.mobil.planit." ); homeName.append( moduleName.replace('/', '.') ); homeName.append( ".ejb." ); homeName.append( beanType ); homeName.append( "." ); homeName.append( remoteInterfaceName ); homeName.append( "Home" ); if( context == null ) { if( env != null ) { context = new InitialContext( env ); } else { context = new InitialContext(); } } final Object homeObject = context.lookup("java:comp/env/ejb/" + moduleName + "/" + remoteInterfaceName ); yours, Christian Tellefsen -----BEGIN PGP SIGNATURE----- Version: PGP Personal Privacy 6.5.8 iQA/AwUBOh09jCZr3JnfcXIbEQJpZACgl+icXCyutsSgQTpvLmA9y0Fur6IAnRtp jd9LwkoeWFUeQmQ0n27fw4ET =nC4O -----END PGP SIGNATURE-----
