File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2.1.6 & EJB3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2.1.6 & EJB3.1" Watch "Struts2.1.6 & EJB3.1" New topic

Struts2.1.6 & EJB3.1

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Just wondering very quickly, if anyone has any examples of Struts2 & EJB3.1 working together.

I have tried just Injecting a EJB bean into a Struts Action but I get a NullPointerException

I found another thread on this forum where someone said use somethink like this:

javax.naming.NamingException: Lookup failed for 'com.myproject.bear.session.ITestSessionBean' in SerialContext [Root exception is javax.naming.NameNotFoundException: com.myproject.bear.session.ITestSessionBean not found]|#]

Can it be done and if so, anyone know how?

Cheers in advance

Ankit Garg

Joined: Aug 03, 2008
Posts: 9465

Try this plugin to inject EJBs into your struts 2 actions. This tutorial on use of guice plug-in might also be helpful...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Cheers for that, will do.
Viji San
Ranch Hand

Joined: Aug 12, 2010
Posts: 35
Is this project dead or Am I checking in incorrect link ?? I find no downloads in the link

I agree. Here's the link:
subject: Struts2.1.6 & EJB3.1
It's not a secret anymore!