Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6973709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:08:34+00:00 2026-05-27T17:08:34+00:00

I am using JBoss 6.1 and its not fully EJB 3.1 compliant. As of

  • 0

I am using JBoss 6.1 and its not fully EJB 3.1 compliant. As of now, I can’t inject an EJB into my Struts action classes (or in any non-Java EE Container-managed class) via @EJB, but will this be possible when the EJB 3.1 specification is fully implemented?

If not, will it be too infeasible to have that due to performance reasons in the foreseeable future?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:08:34+00:00Added an answer on May 27, 2026 at 5:08 pm

    No container will ever be able to inject anything into a non-managed object.

    To be able to to inject into an object, the container needs to manage the object’s lifecycle, or at least to participate in the management of its lifecycle, so it can get hold of the object at an early stage to do the injection. If an object is created and used without ever being exposed to the container (as i imagine Struts action beans are), then the container never has a chance to inject anything into it. The container is not magic – it can’t just detect objects being created all over the JVM and do things to them.

    Mikko’s answer has a good list of the kinds of objects that will be injectable. Unless actions beans are one of those, no dice, i’m afraid.

    Now, having said all that, there is a light at the end of the tunnel: it may well be possible to write an extension for Struts that handles injection. @EJB and @Resource injections correspond fairly straightforwardly to particular JNDI lookups; an extension could reflectively look for annotated fields, then perform the corresponding JNDI lookups and inject the results. CDI injection is even easier, because it has an API specifically aimed at writing extensions. For an example of doing all this, have a look at the Stripes injection enricher, which adds support for @EJB, @Resource, and @Inject to the Stripes web framework.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is using JBoss Cache as distributed state repository a good idea? Can JBoss Cache
We are using JBoss 6, the jna tmp files are created but not deleted.
I am using jboss 4.2.3 with metro. I deploy an EJB 3.0 web service
We're using Jboss, but we are really only using its JMS stuff. So, is
Using Jboss portal , how do I retrieve the page properties in a jsp?
Using JBoss AS 6.1.0 Final with default deployment profile. I like to send a
I'm using Jboss 7.1.1.final and i have an application with heavy use of JMS.
I'm using JBoss AS 7.1 and Hibernate in Eclipse 3.7.2 to build a Dynamic
We are using JBoss 4.2. We would like to customize the session id which
I'm using JBoss 5.1.0.GA (for JDK6), and jaxws 2.2.6. When I invoke the webservice,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.