从 10.3.6 升级到 Weblogic 12cR2 后,由于 NameAlreadyBoundException 而导致 Weblogic 部署问题
Weblogic Deployment issue due to NameAlreadyBoundException after upgrade from 10.3.6 to Weblogic 12cR2
我有一个 运行 应用程序,它是基于 Java 1.6 和 Weblogic 10.3.6 构建的。
现在我正在迁移到 Java 1.8 和 Weblogic 12cR2 (12.2.1.3)。
我有一个构建在 ANT 上并部署在 Weblogic 中的 EAR 文件。
我已经在我的系统中安装了 JDK 1.8 和 Weblogic 12cR2。我已经编译了我的代码库并成功地在 ANT 上构建了它。 .EAR 文件生成时没有任何错误。现在我试图在我最新的 Weblogic 中部署它,但出现以下错误:
weblogic.application.ModuleException:
Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home,
throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyz.admin.ejb.session.AdminServiceRemote to remote.
Another EJB has already bound an interface to that name.;
remaining name 'ejb/admin_service_jndi'.
NestedException Message is :
Unable to bind the interface to remote.
Another EJB has already bound an interface to that name. at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
<May 29, 2018 3:56:04,460 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "10661298941920" for task "0" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.; remaining name 'ejb/admin_service_jndi'. NestedException Message is :[EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name."
weblogic.application.ModuleException: Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.; remaining name 'ejb/admin_service_jndi'. NestedException Message is :[EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.
at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)
at weblogic.application.internal.flow.ModuleStateDriver.next(ModuleStateDriver.java:212)
at weblogic.application.internal.flow.ModuleStateDriver.next(ModuleStateDriver.java:207)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.; remaining name 'ejb/admin_service_jndi'. NestedException Message is :[EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.
at weblogic.ejb.container.deployer.Ejb3SessionBinder.bindToJNDI(Ejb3SessionBinder.java:144)
at weblogic.ejb.container.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:900)
at weblogic.ejb.container.deployer.EJBDeployer.activate(EJBDeployer.java:770)
at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:447)
at weblogic.application.internal.ExtensibleModuleWrapper$ActivateStateChange.next(ExtensibleModuleWrapper.java:317)
Truncated. see log file for complete stacktrace
我检查了我的代码,我没有使用任何重复的 ejb jndi 参考和所有。检查了我的 weblogic.xml,weblogic-ejb-jar.xml 一切正常。
请帮助我找出在迁移到新的 Weblogic 服务器时遗漏了什么。
另外,我想通知您,在我的本地机器上,旧的和新的 weblogic 服务器都存在。 Java 6 中的旧代码在旧的 weblogic 中 运行 很好,也通过重新部署进行了测试,一切都很好。它只是在我的新 weblogic 中它不是 运行。我已经升级了项目 class-path 中所有必需的 JAR 文件,并使用 Weblogic 12cR2 附带的相同文件。还有什么我想念的吗?请帮忙。
问题已解决。
解释:我的应用程序有多个 JAR 等依赖项。 JAR 依赖项正在从应用程序类路径中读取。因此在所有 JAR 清单文件中都存在相同的名称。
我现在在创建目标期间使用默认应用程序类路径以外的其他类路径:
<path id="mf.classpath">
<path refid="common.classpath" />
<fileset dir="${dist.dir}" includes="/**/*.jar" excludes="/**/*ejb*"/>
</path>
这解决了我的问题。
我有一个 运行 应用程序,它是基于 Java 1.6 和 Weblogic 10.3.6 构建的。 现在我正在迁移到 Java 1.8 和 Weblogic 12cR2 (12.2.1.3)。 我有一个构建在 ANT 上并部署在 Weblogic 中的 EAR 文件。
我已经在我的系统中安装了 JDK 1.8 和 Weblogic 12cR2。我已经编译了我的代码库并成功地在 ANT 上构建了它。 .EAR 文件生成时没有任何错误。现在我试图在我最新的 Weblogic 中部署它,但出现以下错误:
weblogic.application.ModuleException:
Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home,
throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyz.admin.ejb.session.AdminServiceRemote to remote.
Another EJB has already bound an interface to that name.;
remaining name 'ejb/admin_service_jndi'.
NestedException Message is :
Unable to bind the interface to remote.
Another EJB has already bound an interface to that name. at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
<May 29, 2018 3:56:04,460 PM IST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID "10661298941920" for task "0" on [partition-name: DOMAIN]. Error is: "weblogic.application.ModuleException: Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.; remaining name 'ejb/admin_service_jndi'. NestedException Message is :[EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name."
weblogic.application.ModuleException: Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.; remaining name 'ejb/admin_service_jndi'. NestedException Message is :[EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.
at weblogic.application.internal.ExtensibleModuleWrapper.activate(ExtensibleModuleWrapper.java:123)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:114)
at weblogic.application.internal.flow.ModuleStateDriver.next(ModuleStateDriver.java:212)
at weblogic.application.internal.flow.ModuleStateDriver.next(ModuleStateDriver.java:207)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
Truncated. see log file for complete stacktrace
Caused By: Unable to bind Business Interface to the JNDI name: myapp_admin_ejb_jarAdminServiceBean_Home, throw exception javax.naming.NameAlreadyBoundException: [EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.; remaining name 'ejb/admin_service_jndi'. NestedException Message is :[EJB:011224]Unable to bind the interface com.abc.xyzadmin.ejb.session.AdminServiceRemote to remote. Another EJB has already bound an interface to that name.
at weblogic.ejb.container.deployer.Ejb3SessionBinder.bindToJNDI(Ejb3SessionBinder.java:144)
at weblogic.ejb.container.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:900)
at weblogic.ejb.container.deployer.EJBDeployer.activate(EJBDeployer.java:770)
at weblogic.ejb.container.deployer.EJBModule.activate(EJBModule.java:447)
at weblogic.application.internal.ExtensibleModuleWrapper$ActivateStateChange.next(ExtensibleModuleWrapper.java:317)
Truncated. see log file for complete stacktrace
我检查了我的代码,我没有使用任何重复的 ejb jndi 参考和所有。检查了我的 weblogic.xml,weblogic-ejb-jar.xml 一切正常。
请帮助我找出在迁移到新的 Weblogic 服务器时遗漏了什么。
另外,我想通知您,在我的本地机器上,旧的和新的 weblogic 服务器都存在。 Java 6 中的旧代码在旧的 weblogic 中 运行 很好,也通过重新部署进行了测试,一切都很好。它只是在我的新 weblogic 中它不是 运行。我已经升级了项目 class-path 中所有必需的 JAR 文件,并使用 Weblogic 12cR2 附带的相同文件。还有什么我想念的吗?请帮忙。
问题已解决。
解释:我的应用程序有多个 JAR 等依赖项。 JAR 依赖项正在从应用程序类路径中读取。因此在所有 JAR 清单文件中都存在相同的名称。
我现在在创建目标期间使用默认应用程序类路径以外的其他类路径:
<path id="mf.classpath">
<path refid="common.classpath" />
<fileset dir="${dist.dir}" includes="/**/*.jar" excludes="/**/*ejb*"/>
</path>
这解决了我的问题。