JavaEE 6: javax.naming.NameAlreadyBoundException: Use rebind to override

前端 未结 5 1805
再見小時候
再見小時候 2020-12-17 17:39

I have a business interface being implemented by two EJBs.

UserManagementService

@Remote
public interface UserManagementService {
          


        
5条回答
  •  借酒劲吻你
    2020-12-17 17:53

    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

提交回复
热议问题