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

Related Questions

New to xml. Looking for XPath to search a xml file with python ElementTree
I'm just about to use the new EJB3 TimerService (as part of Java EE
I'm starting to learn EJB3 and I'm a bit lost when it comes to
I'm working on a new application using EJB3 -> BlazeDS -> Flex. I can't
I am new to JPA/Hibernate. Currently using EJB3, Hibernate/JPA. I have an inheritacnce structure
I'm experimenting with EJB3 I would like to inject a stateful session bean into
i have new problem with JPA in EJB3 my stacktrace are: Caused by: javax.persistence.NonUniqueResultException:
New class is a subclass of the original object It needs to be php4
New to javascript/jquery and having a hard time with using this or $(this) to
New to silverlight. Traditionally if I were to design a wizard-like process where a

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.