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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:56:04+00:00 2026-05-25T14:56:04+00:00

I have a business interface being implemented by two EJBs. UserManagementService @Remote public interface

  • 0

I have a business interface being implemented by two EJBs.

UserManagementService

@Remote
public interface UserManagementService {
    // ...
}

UserManagementServiceJpaImpl

@Stateless(name="userManagementServiceJpaImpl")
public class UserManagementServiceJpaImpl implements UserManagementService {

    @EJB(beanName="userManagementDaoJpaImpl")
    private UserManagementDao userManagementDao;

    // ...
}

UserManagementServiceMockImpl

@Stateless(name="userManagementServiceMockImpl")
public class UserManagementServiceMockImpl implements UserManagementService {   

    @EJB(beanName="userManagementDaoMockImpl")
    private UserManagementDao userManagementDao;

    // ...

}

When I deploy the application to Glassfish 3.1 I get the following error:

java.lang.RuntimeException: Error while binding JNDI name com.transbinary.imdb.service.UserManagementService for EJB : userManagementServiceMockImpl
    at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1550)
    at com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:202)
    at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:167)
    at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:234)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)
    at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:101)
    at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
    at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:249)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
    at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
    at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:370)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:360)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1067)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
    at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1247)
    at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:145)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:577)
    at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:463)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:395)
    at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:380)
    at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:213)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
Caused by: javax.naming.NameAlreadyBoundException: Use rebind to override
    at com.sun.enterprise.naming.impl.TransientContext.doBindOrRebind(TransientContext.java:333)
    at com.sun.enterprise.naming.impl.TransientContext.bind(TransientContext.java:268)
    at com.sun.enterprise.naming.impl.SerialContextProviderImpl.bind(SerialContextProviderImpl.java:98)
    at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.bind(LocalSerialContextProviderImpl.java:99)
    at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:672)
    at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:689)
    at javax.naming.InitialContext.bind(InitialContext.java:404)
    at javax.naming.InitialContext.bind(InitialContext.java:404)
    at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:208)
    at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:189)
    at com.sun.ejb.containers.BaseContainer$JndiInfo.publish(BaseContainer.java:5608)
    at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1535)
    ... 23 more

Could someone help me understand why am I getting this error and how to resolve 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-25T14:56:05+00:00Added an answer on May 25, 2026 at 2:56 pm

    By default GlassFish Server specific default JNDI names are applied automatically for backward compatibility. So com.transbinary.imdb.service.UserManagementService is the the default JNDI name for both the implementations of UserManagementService interface. Which was why I was gettting javax.naming.NameAlreadyBoundException exception.

    But because the EJB 3.1 specification defines portable EJB JNDI names, there is less need for GlassFish Server specific JNDI names.

    To disable GlassFish Server specific JNDI names for an EJB module, set the value of disable-nonportable-jndi-names element to true. The default is false.

    It solved the problem.

    Resource: http://wikis.oracle.com/display/GlassFish/Developer+Handoff+to+QA+for+EJB-8+%28Option+to+disable+GlassFish-specific+JNDI%29

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

Sidebar

Related Questions

I have the following idea: Business object implemented as interface or abstract class with
In my business model I have Entity class (IPoint interface ) that has a
I have a business object project, which contains composite structure: public class Tree {
I have an Enterprise Application with an EJB implementing a @Remote business interface that
I have a business class which I need to serialize to xml. It has
I have a business layer class that uses System.IO.File to read information from various
The situation is this: You have two classes that both implement the same interface
I have four project apart from Presentation layer Business Logic Layer Interface layer Object
I have this interface... public interface ICheckThatDocumentExistsCommand { bool Execute( string userId, string docId
We have business restriction in accessing the database only through stored procedure calls. Caching

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.