[jboss-user] [EJB/JBoss] - Re: Problem when trying to access an EJB bean in an Enterpri

ANDRIA-NTOANINA do-not-reply at jboss.com
Thu Nov 9 08:53:55 EST 2006


When running the jar
I change my jboss-client.xml as you indicated.
And I got : MySession not bound

Now I reput BeanSessionBean into my jndiname and change

  | @RemoteBinding(jndibinding="MySession")
  | 
  | to
  | 
  | @Remote
  | 

In my main application, I try to see what's in the InitialContext by :

  | Context c = new InitialContext();
  |                     Context ce = (Context)c.lookup("java:comp/env/ejb");
  |                     //Object b = c.lookup("java:comp/env/ejb/BeanSessionBean");
  |                     
  |                     NamingEnumeration li = ce.list("");
  |                     while(li.hasMore())
  |                     {
  |                         NameClassPair a= (NameClassPair)li.next();
  |                         System.out.println("ClassName="+a.getClassName()+" Name="+a.getName());;
  |                     }
  | 

in the output, I got:
anonymous wrote : 
  | ClassName=javax.naming.LinkRef Name=BeanSessionBean
  | 

there's my BeanSessionBean in the InitialContext.
But when I retry to get my Beans by:

  | Context c = new InitialContext();
  |                     Context ce = (Context)c.lookup("java:comp/env/ejb");
  |                     Object b = c.lookup("java:comp/env/ejb/BeanSessionBean");
  | 

I got something like:
BeanSessionBean not bound

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

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



More information about the jboss-user mailing list