I write a simple session session bean and a java client that access the bean. here is 
the client:


  | import javax.naming.InitialContext;
  | import javax.rmi.PortableRemoteObject;
  | 
  | class InterestClient
  | {
  |    public static void main(String[] args)
  |    {     
  |       try
  |       {
  |          // Get a naming context
  |          InitialContext jndiContext = new InitialContext();
  |          System.out.println("Got context");
  |          Object ref  =  
jndiContext.lookup("java:comp/env/ejb/rdcs/checkin/TestServiceSession");
  |          System.out.println("Got reference");
  |          
  |       }
  |       catch(Exception e)
  |       {
  |          System.out.println(e.toString());
  |       }
  |    }
  | }
  | 

Here is the java:comp namespace of the session bean:

java:comp namespace of the TestServiceSession bean:
  + env (class: org.jnp.interfaces.NamingContext)
  |   + ejb (class: org.jnp.interfaces.NamingContext)
  |   |   + rdcs (class: org.jnp.interfaces.NamingContext)
  |   |   |   + checkin (class: org.jnp.interfaces.NamingContext)
  |   |   |   |   + TestServiceSession[link -> ejb/rdcs/checkin/TestServiceSession] 
(class: javax.naming.LinkRef)

Here is the jndi.properties file content:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces

And here is the result:
Got context
javax.naming.NameNotFoundException: comp not bound

I don't understand these result, where could be the error?. If I replace the 
java:comp/env with the direct root jndi path (ejb/rdcs/checkin/TestServiceSession) to 
the bean it works. 

Anyone with an answer, please?



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3851853#3851853

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3851853


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to