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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:58:37+00:00 2026-05-23T01:58:37+00:00

Note that I’m mirroring the example given here very closely. In fact, my situation

  • 0

Note that I’m mirroring the example given here very closely.

In fact, my situation is somewhat simpler as I’m not even testing with a persistence unit at this point. My test project provides a simple MDB and a session bean; both the MDB and the session bean are getting loaded as normal, and can be successfully tested (in a constrained fashion) without injection.

The suggested injection with the @LocalClient annotation on my unit tests is failing with the known error:

javax.naming.NamingException: Unable to find injection meta-data for [your-class]. Ensure that class was annotated with @org.apache.openejb.api.LocalClient and was successfully discovered and deployed. See http://openejb.apache.org/3.0/local-client-injection.html

When I visit this page it informs me that I may need to add an extra property to my test case context setup. So that now looks like:

@Override
public void setUp() throws Exception {
    initializeContext();
}
public void initializeContext() {
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
    // the property i've added
    p.put("openejb.tempclassloader.skip", "annotations");

    try {
        InitialContext initialContext = new InitialContext(p);
        initialContext.bind("inject", this);
    } catch (Throwable throwable) { 
        throwable.printStackTrace();
        throw new RuntimeException(throwable);
    }
}

But it’s still failing. I really like this idiom and would be very excited if I could successfully use it in my projects.

A few other notes:

  • I am providing an ’empty’ ejb-jar.xml (in src/main/resources) and an application-client.xml (in src/test/resources) as suggested by Apache to tell OpenEJB to scan the classpath [UPDATE: as it turns out, I was doing this wrong. See my answer below for the suggestion that worked for me.]
  • The test cases annotated with @LocalClient aren’t identified by the OpenEJB engine as actually getting picked up and processed properly (as my MDBs are, for example)

Thanks in advance for any help or guidance.

  • 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-23T01:58:38+00:00Added an answer on May 23, 2026 at 1:58 am

    This issue is likely caused by improper location of the descriptors which hint OpenEJB which sorts of modules are available.

    To ensure the test-classes get picked up properly, make sure you’re placing a file named application-client.xml at src/test/resources/META-INF with the following content:

    <application-client/>

    This should force OpenEJB to scan and react to the presence of @LocalClient annotations.

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

Sidebar

Related Questions

Note that I am not asking which to choose (MVC or MVP), but rather
Note that this function does not have a { and } body. Just a
How do I load a Python module given its full path? Note that the
Has anyone seen this type of IE display problem? Example http://xs133.xs.to/xs133/08465/ie_problem910.jpg.xs.jpg Note that it
We're seeing the error message ORA-00936 Missing Expression for the following SQL: Note that
The attached screenshot is from OS X/Firefox 3. Note that the center tab (an
When I go to create my status bar overlay, I note that I can
Can someone explain me the reason of overflow in variable a? Note that b
We all know that having a good note taking tool is important as a
Note: I've tried posting on the coderush/devexpress forums and as is usual for that

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.