“JNDI名称已被使用”在带有EJB3的Weblogic 12c中 [英] "JNDI name is already in use" in Weblogic 12c with EJB3

查看:333
本文介绍了“JNDI名称已被使用”在带有EJB3的Weblogic 12c中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码,我正在尝试将其部署为WebLogic 12c的EJB,但我收到错误:

I have the following code that I'm trying to deploy as an EJB to WebLogic 12c, but I'm getting an error:


部署EJB GeopoliticalServiceBean时错误(应用程序:
campaigner-ejb,EJBComponent:campaigner-service.jar),JNDI名称
java:global / campaigner-ejb / campaigner-service / GeopoliticalServiceBean!com .dr_dee_sw.campaigner.service.GeopoliticalServiceLocal
已经在使用。您必须在
weblogic-ejb-jar.xml部署描述符或此EJB的相应批注
之前设置不同的JNDI名称它可以部署。

"Error deploying the EJB GeopoliticalServiceBean(Application: campaigner-ejb, EJBComponent: campaigner-service.jar), the JNDI name java:global/campaigner-ejb/campaigner-service/GeopoliticalServiceBean!com.dr_dee_sw.campaigner.service.GeopoliticalServiceLocal is already in use. You must set a different JNDI name in the weblogic-ejb-jar.xml deployment descriptor or corresponding annotation for this EJB before it can be deployed."



public interface GeopoliticalService
{
...
}

@Local
public interface GeopoliticalServiceLocal extends GeopoliticalService
{
}

@Remote
public interface GeopoliticalServiceRemote extends GeopoliticalService
{
}

@TransactionManagement(value = TransactionManagementType.CONTAINER)
@TransactionAttribute(value = TransactionAttributeType.REQUIRED)
@Stateless
public class GeopoliticalServiceBean implements GeopoliticalServiceLocal,GeopoliticalServiceRemote
{
...
}

更多信息:
我减少了EJB-JAR文件,Campaigner-service .jar,因此只有一个bean,加上接口和异常。如今,EAAR文件Campaigner-ejb.ear在主层只有EJB-JAR。它还有一个带有支持库的lib目录,但它只有DAO和DTO jar以及第三方库。所以,对我而言,它似乎不是一个包装问题。

More information: I've reduced the EJB-JAR file, campaigner-service.jar, so that there's only one bean in it, plus the interfaces and exceptions. the EAR file, campaigner-ejb.ear, has only the EJB-JAR in it at the main level. It also has a "lib" directory with supporting libraries, but it only has the DAO and DTO jars in it plus third-party libraries. So, to me, it doesn't seem like a packaging issue.

这是我的第一个使用所有注释的应用程序,但它看起来仍然相当简单。我缺少什么?

This is my first app using all annotations, but it still seems fairly straight-forward. What am I missing?

推荐答案

在从Weblogic 10迁移到Weblogic 12期间,我们遇到了同样的问题。
我们可以通过在没有正确配置数据源的新服务器上部署EAR来重现该问题;这会在部署期间导致NameNotFoundException。每次下一次部署EAR的尝试都会导致JDNI名称已经被使用,即使在重新启动,取消部署,重新部署之后也是如此。

During the migration from Weblogic 10 to Weblogic 12 we faced the same issue. We could reproduce the issue by deploying the EAR on a fresh server without the datasources configured properly; this would cause a NameNotFoundException during deployment. Every next attempt to deploy the EAR would result in the JDNI name is already in use, even after restarting, undeploying, redeploying.

解决问题的唯一方法是删除目标服务器的缓存(最重要的是EJBCompilerCache)和tmp文件夹。

The only thing that resolved the issue was removing the cache (and most importantly the EJBCompilerCache) and tmp folder of the target server.

这篇关于“JNDI名称已被使用”在带有EJB3的Weblogic 12c中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆