• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Struts 2 EJB injection

 
Greenhorn
Posts: 26
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is It possible to inject a stateless session bean using @EJB annotation in a Struts 2 Action class.

Each time a execute my action class, I recieve a null pointer exception.

Is EJB injection possible in Struts 2 action class.

Is there any tutorial or link for this.

Thanks

Regards
Prateek
 
author & internet detective
Posts: 42003
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What version of JEE are you asking for? In JEE 5, you can only inject into JSF resources, servlets, etc. In JEE 6, things are more flexible. This thread explains it nicely.
 
Prateek Jauhari
Greenhorn
Posts: 26
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Thanks this link really solved my problem..
but I am now facing another one, The hibernate is not working in it now..
I am using JEE 6, hibernate 3.5, struts 2 and EJB3.0 with JBoss 6 application server and MySQL.
for my project.

IS there any tutorial to integrate all these into a single project.
I really fed working out with this


Thanks

Regards
Prateek
 
Prateek Jauhari
Greenhorn
Posts: 26
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am really thankful.
This link solved my problem...
but I didn't understand why this thing is not working with struts application.
 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am I right that JBoss Weld can be used to inject EJB into struts action:
@Inject ?
 
I don't even know how to spell CIA. But this tiny ad does:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic