cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Dias <cd...@pontoc.pt>
Subject EJB access
Date Mon, 12 Sep 2005 19:08:23 GMT
I'm trying to access to a EJB with the following Action Class:
public class DBN1ModelAction extends AbstractAction {

    private static final Logger log = 
Logger.getLogger(DBN1ModelAction.class);   
   
    // Instance methods. 
******************************************************       
    /**
     * Construtor default.
     */
    public Map act (Redirector redirector, SourceResolver resolver,
            Map objectModel,
            String source,
            Parameters params) {
       
        try {
           
            //Get JNDI context
            Context naming = new InitialContext();
           
            // Look up the Home
            //Object obj = naming.lookup("DBN1Model");
            Object obj = naming.lookup("DBN1ModelLocal");
            if (obj != null)
                log.info("obj");
           
            //DBN1ModelHome home = (DBN1ModelHome) 
PortableRemoteObject.narrow(obj,
            //        DBN1ModelHome.class);
            DBN1ModelLocalHome home = (DBN1ModelLocalHome) 
PortableRemoteObject.narrow(obj,
                    DBN1ModelLocalHome.class);
            if (home != null)
                log.info("home");
           
            // Create a DBN1Model
            DBN1Model dbn1Model = home.create();
           
            Request request = ObjectModelHelper.getRequest(objectModel);
            log.info("dbn1Model.getHierarchies()=" + 
dbn1Model.getHierarchies().size());
            request.setAttribute("hierarchy", 
dbn1Model.getHierarchies());       
           
            dbn1Model.remove();           
       
        } catch(Exception e){
            log.error(e.getMessage(), e);
        }
   
        return EMPTY_MAP;
    }   
}

 From what I can see from jboss logs I can't reach the bean. What I'm 
doing wrong?

Thanks,
Carlos Dias

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message