我在GlassFish中使用服务器的NetBeans实现无状态会话bean的EJB3。 第一次,它工作正常。 后来,我发现了异常,如下所示:
LDR5012: Jndi name conflict found in
[SampleEjb3]. Jndi name
[Lulu.HellostatelessRemote] for bean
[HellostatelessBean] is already in
use. LDR5013: Naming exception while
creating EJB container:
javax.naming.NameAlreadyBoundException:
Use rebind to override
at com.sun.enterprise.naming.TransientContext.doBindOrRebind(TransientContext.java:292)
at com.sun.enterprise.naming.TransientContext.bind(TransientContext.java:232)
at com.sun.enterprise.naming.SerialContextProviderImpl.bind(SerialContextProviderImpl.java:111)
at com.sun.enterprise.naming.LocalSerialContextProviderImpl.bind(LocalSerialContextProviderImpl.java:90)
at com.sun.enterprise.naming.SerialContext.bind(SerialContext.java:461)
at com.sun.enterprise.naming.SerialContext.bind(SerialContext.java:476)
at javax.naming.InitialContext.bind(InitialContext.java:404)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:237)
at com.sun.enterprise.naming.NamingManagerImpl.publishObject(NamingManagerImpl.java:190)
at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1015)
at com.sun.ejb.containers.StatelessSessionContainer.initializeHome(StatelessSessionContainer.java:232)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:654)
at com.sun.enterprise.server.AbstractLoader.loadEjbs(AbstractLoader.java:536)
at com.sun.enterprise.server.ApplicationLoader.doLoad(ApplicationLoader.java:188)
at com.sun.enterprise.server.TomcatApplicationLoader.doLoad(TomcatApplicationLoader.java:126)
at com.sun.enterprise.server.AbstractLoader.load(AbstractLoader.java:244)
at com.sun.enterprise.server.AbstractManager.load(AbstractManager.java:225)
at com.sun.enterprise.server.ApplicationLifecycle.onStartup(ApplicationLifecycle.java:217)
at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:442)
at com.sun.enterprise.server.ondemand.OnDemandServer.onStartup(OnDemandServer.java:120)
at com.sun.enterprise.server.PEMain.run(PEMain.java:411)
at com.sun.enterprise.server.PEMain.main(PEMain.java:338)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.server.PELaunch.main(PELaunch.java:412)
然后,我会从GlassFish服务器中删除EJB模块,我会重新启动服务器。 它会对你有帮助。 那么,如何解决这个问题..