[jboss-user] [JNDI/Naming/Network] - NamingException with local interface

a.evoli do-not-reply at jboss.com
Tue Mar 20 14:39:06 EDT 2007


Hi all,
I built an entity EJB with only local interface and a Session stateless EJB with remote and local interface. After these I write a Java Application that lookup to the remote home of the session bean. The problem is that the session bean doesn't lookup to the local interface of the enity beans. I think that the problem is I don't know the gloabal jndi of a local interface. That's the code:

public int login(String idUtente, String password) {
        //TODO implement login
        
        AccessoBean1Local utente=null;
        AccessoBean1PK chiave = new AccessoBean1PK(idUtente,password);
        
        try{
            InitialContext iniCtx = new InitialContext();
            Context ejbCtx = (Context) iniCtx.lookup("java:comp/env/ejb");
            AccessoBean1LocalHome home = (AccessoBean1LocalHome) iniCtx.lookup("AccessoBean1LocalHome");
            utente=home.findByPrimaryKey(chiave);
            } 
        catch(FinderException e){return 1;}
        catch(NamingException e){return 3;}
        catch(Exception e){return 2;}
          
        return 0;

Infact it always return 3. Could someone help me? Thanks a lot.

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

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



More information about the jboss-user mailing list