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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:13:24+00:00 2026-05-11T22:13:24+00:00

I am new to EJB3 and am missing something when it comes to accessing

  • 0

I am new to EJB3 and am missing something when it comes to accessing a @Remote @Stateless bean deployed as an ejb module inside an ear file. I want to access a remote bean in lima.ear from soup.ear.

Here is what I am doing now (somewhat abbreviated):

//deployed under lima.ear
@Remote
@Stateless
public interface LimaBean {
    String sayName();
}

I want to put LimaBean in the Soup:

//deployed in soup.ear
@Stateless
public class Soup implements SoupLocal {

    @EJB
    private LimaBean limaBean;

    public String taste() {
        return limaBean.sayName();
    }

 }

When I start JBoss I get the following error:

java.lang.RuntimeException: could not resolve global JNDI name for @EJB for container Soup: reference class: com.example.LimaBean ejbLink: not used by any EJBs

I have had a hard time finding out what this ejbLink is about, if that is the right path to go down.

If I deploy LimaBean as a jar file in jboss then everything works great!

I ran accross an article that had a section called “2.5.3. References between beans in different jars and different ears”

(http://jonas.ow2.org/doc/howto/jboss2_4-to-jonas3_0/html/x111.html)

Example of jboss.xml file for SB_BrowseRegions:

<jboss>
    <session>
        <ejb-name>SB_BrowseRegions</ejb-name>
        <ejb-ref>
            <ejb-ref-name>ejb/Region</ejb-ref-name>
            <jndi-name>protocol://serverName/directory/RegionHome</jndi-name>
        </ejb-ref>
    </session>
</jboss>

If I touch the soup.ear, after JBoss starts up then it deploys fine, so I am assuming I need to specify a dependency like the above article says.

But even after it deploys then I get an error when accessing the remote LimaBean:

Caused by: java.lang.IllegalArgumentException: Can not set com.soup.LimaBean field com.soup.Soup.limaBean to $Proxy147
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:63)
at java.lang.reflect.Field.set(Field.java:657)
at org.jboss.injection.JndiFieldInjector.inject(JndiFieldInjector.java:115)
… 49 more

I have tried a few things but, if anyone can point me in the right direction about this I would appreciate it.

  • 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-11T22:13:24+00:00Added an answer on May 11, 2026 at 10:13 pm

    It looks like the JNDI properties need to be set as if it were a remote client outside of the app server because of the ear isolation we have setup.

        properties.put(Context.PROVIDER_URL, url);
        InitialContext ctx = new InitialContext(properties);
    

    Just specify the URL for the InitialContext and that should do the trick.

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

Sidebar

Ask A Question

Stats

  • Questions 118k
  • Answers 118k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you using the 'load' event to initialize the page?… May 11, 2026 at 11:39 pm
  • Editorial Team
    Editorial Team added an answer _collection.RemoveAll(user => !user.IsApproved()); If you're still on 2.0: _collection.RemoveAll(delegate(User u)… May 11, 2026 at 11:39 pm
  • Editorial Team
    Editorial Team added an answer Whenever I hear timer job, I can't help but think… May 11, 2026 at 11:39 pm

Related Questions

How to create a project in WebLogic Workshop (version 10.3) with support for JPA
I have a legacy database, which I am using EJB3 to model. The database
I'm working on a project which is just about to start, and since I
I am very new to the whole J2EE architecture. Could somebody help me out?

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.