The JNDI lookup failed.

- If you are using XDoclet, see tags @ejb:bean jndi-name="your_jndi_name" and similar for your EJB class.
... if you aren’t, revise the jndi name assigned for that bean in META-INF/jboss.xml


Example:

If jboss.xml says:

<jboss>
   <enterprise-beans>
      <session>
         <ejb-name>ejb/Test</ejb-name>
         <jndi-name>ejb/test/JTSession</jndi-name>
         <local-jndi-name>ejb/test/JTSession</local-jndi-name>
      </session>
        ...
   </enterprise-beans>
...
</jboss>

You should use :

Hashtable map = new Hashtable();
map.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
map.put(Context.PROVIDER_URL,"your_jboss_server:1099");
map.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
                        
InitialContext ctx = new InitialContext(map);
Object obj = ctx.lookup("ejb/test/JTSession");
...

The map is only necessary if you are working from a remote client.

Regards,



Trish Hartnett wrote:
Hello all,

 I am trying to pass some information from my EJB to my Applet. I've been
using the instruction in
"How to use Applets to access EJBs in JBoss" in the JBoss documentation.

 I keep on getting this error
"javax.naming.NameNotFoundException: SpatialInfoSessionImpl not bound"

Here's the source code that is trying to access the EJB:
"
Properties jndiProps = new Properties() ;
jndiProps.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory" ) ;
 jndiProps.setProperty("java.naming.provider.url", myServer ) ;
 jndiProps.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces" ) ;
SpatialInfoSessionEJBHome home =
(SpatialInfoSessionEJBHome)PortableRemoteObject.narrow( new
InitialContext(jndiProps).lookup(
"SpatialInfoSessionImpl" ),SpatialInfoSessionEJBHome.class) ;
 SpatialInfoSessionEJB remote = home.create() ;
  myGeometry = remote.getGeom(tableName);
"

Can anyone suggest anything please ?

Thanks in advance,
Trish.



-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user




------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to