[jboss-user] [JBoss Portal] - Re: How to access EJB3 beans from a portlet !???
je.a.le
do-not-reply at jboss.com
Thu Dec 13 09:48:26 EST 2007
in netbeans, right click on editor, "entreprise resources"->call entreprise bean
select your ejb, remote/local depending where you add your portlet.
netbean add a method to your portlet for you... except the jndi is wrong :-)
so too call an ejb "MediaDirSessionBean", from the application project "AC", with local interface, jndi is : "AC/MediaDirSessionBean/local"
the full function should look like this one :
private MediaDirSessionLocal lookupMediaDirSessionBean() {
try {
Context c = new InitialContext();
return (MediaDirSessionLocal) c.lookup("AC/MediaDirSessionBean/local");
} catch (NamingException ne) {
java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE, "exception caught", ne);
throw new RuntimeException(ne);
}
}
A+
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112588#4112588
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112588
More information about the jboss-user
mailing list