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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:38:59+00:00 2026-06-12T02:38:59+00:00

I have @Local interface @Local public interface IRepo { and two realisation, but only

  • 0

I have @Local interface

@Local
public interface IRepo
{  

and two realisation, but only 1 bean realisation

@Stateless(name = "RepoBean")
public class RepoBean implements IRepo
{  

second

public class SimpleRepo implements ILogRepositoryIRepo
{  

and inject it ti my Web service using

   @EJB(name = "RepoBean")
   private IRepo repository;  

And it’s works well on jboss and on WebLogic. But on GlassFish 3.1.1 I get Error (while deploying)

  Cannot resolve reference Local ejb-ref name=RepoBean,Local 3.x interface =com.company.IRepo,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session because there are 2 ejbs in the application with interface com.company.IRepo.  

But I have only 1 ejb realisation.
Any ideas? May be I can use some deployment-desriptor or something else.
EJB 3.0, Java EE 5

  • 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-12T02:39:01+00:00Added an answer on June 12, 2026 at 2:39 am

    I really didn’t understand what you’re trying to do, but if you have two beans that implement the same business interface, you’ll have to use the ‘beanName’ attribute as follows:

    @EJB(beanName = "RepoBean")
    private IRepo repository;
    

    — UPDATE

    Look at this: java.net/node/702013. There is a bug issue to this problem: java.net/jira/browse/GLASSFISH-11684

    Seems like this only occurs with EJB-in-WAR packaging. In ejb jar doesn’t happen.

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

Sidebar

Related Questions

Say I have the following EJB (using ejb3): @Stateless(name=Queries) @Remote(Queries.class) @Local(Queries.class) public final class
I have a EJB bean that exposed to two interface like below: Local interface
Imagine you have two implementations of a @Local interface @Local public interface LocalInterface {
I have an entity like this: public class Person { public string Name {
Have a look at following code: @Local public interface MyService { void printMessage(); }
I have a local repository. I created the whole application, but now I want
we have a local staging server running sql server 2000 and a remote public
Here is a very strange behavior using EJB beans: @Local public interface Provider {
I have a class that I have serialized to disk on local users machines.
When I compile something like this: public class MyClass { void myMethod(String name, String

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.