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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:32:05+00:00 2026-06-06T21:32:05+00:00

I have a bunch of dependencies written as fast binary web services (aka Ejb3.1).

  • 0

I have a bunch of dependencies written as fast binary web services (aka Ejb3.1). Here is the service delcaration:

@Remote
public interface MyService {...}

You would inject an EJB into a servlet or managed bean with the following syntax:

@EJB
MyService myService;

I don’t want to use the @EJB injection however. I’d like to use plain vanilla CDI:

@Inject
MyService myService;

One way to accomplish this would be to Create a @Produces method for every EJB:

@Produces MyService produceMyService(InjectionPoint ijp){
 //jndi lookup for MyService interface
}

However, InjectionPoint is capable of giving you all the information you need, such as the target class name (MyService in this case).

Is there a way in CDI to do something like this? I’d want to call this producer last, if the required injection point couldn’t be fulfilled in any other manner.

@Produces Object produce(InjectionPoint ijp){
 Class ejbInterface = ijp.getType();
 //jndi lookup for ejbInterface
}

This is a confusing post, so ask clarification questions. Thanks a ton!

  • 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-06T21:32:06+00:00Added an answer on June 6, 2026 at 9:32 pm

    Assuming that I understood your question (see comment): No, there is no API for this.

    Good news is that there is a way to achieve this – but you probably don’t want to do this at runtime, that’s rather a task for application startup.

    The CDI extension mechanism offers you some well defined hooks into bean processing at container startup. This is a perfect place for logic that decides about enabling / disabling of certain managed beans (probably based on static classpath information).

    Have a look at function and implementation of Seam Solder‘s @Requires. That should be pretty close to your use case…

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

Sidebar

Related Questions

I have a bunch of business class with autoproperties : public class A {
I have written a bunch of unit tests inside VS2010 Express and tests being
I have a bunch of classes that have a set of dependencies. Dependency Injection
I have a C# project with a bunch of dependencies, but I want to
i have a database that lists a bunch of applications and their dependencies. Some
I have a Visual Studio solution containing a web site project plus a bunch
I have a cmake build in which I'm searching for a bunch of dependencies,
I have a bunch of types registered with Autofac and some of the dependencies
I have bunch of strings, some of which are fairly long, like so: movie.titles
I have bunch of lists like this: out[3] [[3]] [1] forum=28&mid=11883 [2] forum=29&mid=11884 out[4]

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.