This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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

Win a copy of Building Microservices this week in the Design forum!
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: 9405

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Struts2.1.6 & EJB3.1
It's not a secret anymore!