-
1. Re: How to access EJB3 beans from a portlet !???
stefnef Aug 16, 2007 6:21 AM (in response to stefnef)I found the solution myself. Bundle the helloworldjspportlet.war inside the .ear file and add this to the application.xml in the META-INF folder :
helloworldjspportlet.war
That's it !
Sorry for the premature post...;-) -
2. Re: How to access EJB3 beans from a portlet !???
stefnef Aug 16, 2007 6:29 AM (in response to stefnef)Sorry..I am new to these forums ... here should be the missing code lines :
<module id="HelloWorldJSPPortlet"> <java>helloworldjspportlet.war</java> </module>
If that didn't work then the idea is to add the module as a java module
in the application.xml file and not a war module ! -
3. Re: How to access EJB3 beans from a portlet !???
rododendro Dec 12, 2007 4:31 PM (in response to stefnef)Hi, I have the same problem you described, have you found a solution?
Thanks
Ivan -
4. Re: How to access EJB3 beans from a portlet !???
soon5 Dec 13, 2007 2:56 AM (in response to stefnef)Hy,
Why don't you use JNDI to get the EJBs and access them?
Greetings Soon5 -
5. Re: How to access EJB3 beans from a portlet !???
je.a.le Dec 13, 2007 9:48 AM (in response to stefnef)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+