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 7950791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:22:21+00:00 2026-06-04T02:22:21+00:00

I have a stateless session bean, but I want to add a reference to

  • 0

I have a stateless session bean, but I want to add a reference to another bean in order to do some process. So if I add reference to another bean it shows up at instance level variable like this,

@Stateless
public class AccountFacade extends AbstractFacade<Account> implements AccountFacadeRemote         {
    @EJB
    private BillerFacadeRemote billerFacade;

    public AccountFacade() {
    super(Account.class);
    }

    ... all other methods...
}

Question

Now, by definition stateless bean should not have any instance level variables. So I am quite confuse about where to put this private BillerFacadeRemote billerFacade;?

  • 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-06-04T02:22:24+00:00Added an answer on June 4, 2026 at 2:22 am

    Your code is fine.

    The @EJB annotation is injecting the bean into your class, and the application server manages its lifetime.

    I recommend reading, or skimming the pretty long Java EE tutorial.

    “The EJB container typically creates and maintains a pool of stateless session beans, beginning the stateless session bean’s lifecycle. The container performs any dependency injection and then invokes the method annotated @PostConstruct, if it exists. The bean is now ready to have its business methods invoked by a client.”

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

Sidebar

Related Questions

I have an EJB3 stateless session bean that uses some other ejbs to do
I have Stateless Session Bean with Container-Managed Transactions. I want to return unmanaged entity
I have a stateless EJB-3.1 session bean containing an asynchronous method that does some
i have created a demo application Using JSF & EJB 3.0 (Stateless session bean
We have some JavaEE5 stateless EJB bean that passes the injected EntityManager to its
I have a stateless session bean and a standalone-java-program acting as a client. The
I have a stateless session bean which is exposed as webservice. There are two
I have a stateless session bean which needs access to a factory class. Is
I have a Stateless Session Bean (java ee 6, cdi) which throw events @Stateless
I have read this post and it doesn't answer my question. Stateless session bean

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.