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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:52:08+00:00 2026-06-13T06:52:08+00:00

First I will describe what I am trying to accomplish here. I have a

  • 0

First I will describe what I am trying to accomplish here. I have a Java application that periodically reads data and calls stateless EJB on JBoss AS 7.1.1 for further operations (computing data and saving it into the DB). Then I have front end which uses JSF 2.0. In controller which is a @ApplicationScoped CDI bean and resides in JSF project I inject EJB into it. Now I need EJB for getting data from the DB. I am using @ApplicationScoped CDI bean because of this reason:

The application context is shared between all servlet requests, web service invocations, EJB remote method invocations, EJB asynchronous method invocations, EJB timeouts and message deliveries to message-driven beans that execute within the same application. The application context is destroyed when the application is shut down.

I want only one CDI bean for all the clients, because the data is independent of the user.

Now I want to update data in @ApplicationScoped CDI bean, which is defined under JSF project with the help of EJB bean, which method is executed when new data arrives. I have already successfully used @Inject in @ApplicationScoped CDI bean, where I have injected EJB from EJB project. Now I want to do the other way around. I tried to inject ApplicationScoped CDI bean from JSF project into EJB bean. But when I wrote this I got @Inject underline as warning:

@Inject
private CurrentDataController currentDataController;

The warning is:

No bean is eligible for injection to the injection point [JSR-299 §5.2.1]

When I try to publish project I get error about class not found exception for CurrentDataController.

Caused by: java.lang.ClassNotFoundException: controllers.CurrentDataController from [Module “deployment.TestEAR.ear.TestEJB.jar:main” from Service Module Loader]

It seems that the EJB project can’t reference class in JSF project. Also it is looking for CurentDataController class in TestEJB.jar instead of in the TestJSF.jar. What I am missing here?

The structure of my whole project is as follow:

  • TestEAR
    • TestEJB
    • TestEJBClient
    • TestJPA
    • TestJSF

Now I reckon that after I will fix the error about no class definition found I will have another problem connected with the warning I have posted.

  • 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-13T06:52:10+00:00Added an answer on June 13, 2026 at 6:52 am

    In an EAR the EJB modules (jar) don’t have visibility on the Web modules (war). EJB module is UI agnostic so it’s normal to have this layer decoupling.
    To resolve you issue you have two options.

    1. Move the bean that need to be injected in your EJB in one EJB module (the war would also be able to inject that bean)
    2. Refactor your app to have only a war (yes you can have EJB in war now). Architecture would be simplier and full EJB will work under JBoss (remote EJB too)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two desktop applications. After closing the first application, the first application will
I am trying to develop a web application that will do the following: Collect
First I will explain what I am trying to do. I am trying to
I want to define that the first element will be of a specific type,
I have a CSV file. The first row will always contain column headers. Depending
I want to display a UITableView with Multiple Columns. The first column will have
I will be writing my first daemon in php and I have a couple
I'm trying to write a CGI program that will output a PNG image to
This is my first time running a project using git, so I will describe
I'm trying to write a simple application that finds out who liked your page.

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.