I'm using Java EE 5 with GlassFish to create an enterprise app where
the web client is created with GWT. But I'm having trouble accessing
my EJB 3 bean that's running on the same appserver.
I used GWT to create a war file, but I couldn't access my EJB3 session
bean (implements local interface) running on the same appserver. I
heard that to access EJB 3 using a local interface with annotations, I
need to use Web app version 2.5 (that version showed-up in a web.xml
file). When I crack-open the war file that was generated by GWT, it
doesn't show the web app version so I don't know if GWT can access
EJB3 beans in this case.
Do you know how I can make a war file (using GWT) that is web app
version 2.5? Can I manually add the web app version to my current war
file?
Thanks,
Cindy
You can't access an EJB3 session bean directly from a GWT application.
You have to create a servlet that will talk to your EJB3 beans and
use GWT's RPC mechanism to talk to the servlet.
The documentation on RPC is here:
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.RemoteProcedureCalls.html
I don't know if there are any working RPC examples out there, but the
docs should get you started. Just be sure to realize that GWT's RPC
implementation is asynchronous, not synchronous like Java's RMI.
Ian
--
Tired of pop-ups, security holes, and spyware?
Try Firefox: http://www.getfirefox.com
http://unrealities.com/gwtjsf/20070406
There is more that needs to be done, but it is now possible for a
(Seam) EJB3 component to implement a GWT service interface, and for
GWT to call that service interface through JSF, with all the servlet
plumbing taken care of for you. Michael Neale of JBoss has also just
landed a non-JSF GWT RPC integration in the Seam trunk.
Cheers!
Rob
On Apr 20, 6:26 am, "Ian Petersen" <ispet...@gmail.com> wrote:
> Cindy,
>
> You can't access an EJB3 session bean directly from a GWT application.
> You have to create a servlet that will talk to your EJB3 beans and
> use GWT's RPC mechanism to talk to the servlet.
>
> The documentation on RPC is here:http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.De...