gpt4 book ai didi

java - 带有 EJB3 的 Weblogic 12c 中的 "JNDI name is already in use"

转载 作者:行者123 更新时间:2023-12-02 11:21:03 27 4
gpt4 key购买 nike

我尝试将以下代码作为 EJB 部署到 WebLogic 12c,但出现错误:

"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,加上接口(interface)和异常。 EAR 文件 Campaigner-ejb.ear 在主级别仅包含 EJB-JAR。它还有一个包含支持库的“lib”目录,但其中仅包含 DAO 和 DTO jar 以及第三方库。所以,对我来说,这似乎不是包装问题。

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

最佳答案

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

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

关于java - 带有 EJB3 的 Weblogic 12c 中的 "JNDI name is already in use",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31546768/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com