java - 启动托管服务器 WebLogic 12.2.1.4 时尝试同步群集 JNDI 树时出错

标签 java ejb weblogic cluster-computing jndi

我正在将应用程序从 WebLogic 12.1.3 更新到 12.2.1.4。我们的 Web 应用程序位于具有 2 个节点的集群上。当我们启动 2 个托管服务器时,无论哪一个最后完成都会抛出以下异常:

<Notice> <Cluster> <BEA-000138> <Listening for announcements from cluster WEBCluster on 239.255.0.102:10034.>
<Notice> <Cluster> <BEA-000133> <Waiting to synchronize with other running members of WEBCluster.>
<Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<Notice> <Cluster> <BEA-000142> <Trying to download cluster JNDI tree from server web-dev01.>
<Error> <Cluster> <BEA-000140> <Failed to deserialize statedump from server web-dev01 with
weblogic.application.ClassLoaderNotFoundException: com.app.ejb.SummaryRemote is not found due to missing GenericClassLoader.annotation:app-ejb@.
weblogic.application.ClassLoaderNotFoundException: com.app.ejb.SummaryRemote is not found due to missing GenericClassLoader.annotation:app-ejb@
    at weblogic.application.internal.AppClassLoaderManagerImpl.loadApplicationClass(AppClassLoaderManagerImpl.java:229)
    at weblogic.common.internal.ProxyClassResolver.resolveProxyClass(ProxyClassResolver.java:77)
    at weblogic.common.internal.WLObjectInputStream.resolveProxyClass(WLObjectInputStream.java:88)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1854)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1802)
    Truncated. see log file for complete stacktrace

首先完成的服务器显示以下内容,没有任何问题:

<Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.>
<Notice> <Cluster> <BEA-000138> <Listening for announcements from cluster WEBCluster on 123.123.0.102:10034.>
<Notice> <Cluster> <BEA-000133> <Waiting to synchronize with other running members of WEBCluster.>
<Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.>
<Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.>
<Notice> <Cluster> <BEA-000162> <Starting "async" replication service with remote cluster address "null">
<Notice> <WebLogicServer> <BEA-000330> <Started the WebLogic Server Managed Server "web-dev01" for domain "domain" running in production mode.>

摘要.java

package com.app.ejb;

@Stateless(mappedName = "Summary")
public class Summary implements SummaryRemote {
    @Inject
    private SummaryLocal summaryLocalBean;

SummaryRemote.java

package com.app.ejb;

@Remote
public interface SummaryRemote {

查找

private void getSummaryFacade() throws NamingException {
    Context context = new InitialContext();
    summaryRemote = (SummaryRemote) context
            .lookup("Summary#com.app.ejb.SummaryRemote");
}

为什么在第一个之后启动的集群节点上抛出 ClassLoaderNotFoundException?顺便说一下,我没有为我的项目设置 weblogic-ejb-jar.xml 或 ejb-jar.xml。

查看 weblogic 控制台中的 JNDI 树,当我只有一台服务器时,我看到相同的类加载器未找到异常。我认为当我启动服务器 2 时,它正在尝试从服务器 1 复制/下载 JNDI 树,但由于错误而无法执行。 See link for image of the JNDI tree exception

最佳答案

有几个对我有用的解决方法,其中任何一个都消除了异常:

  1. 在 WebLogic 管理控制台中将集群消息传递模式从多播更改为单播

导航到环境 -> 集群 -> -> 配置选项卡 -> 消息选项卡 -> 消息模式:多播,您需要按锁定和编辑并将多播更改为单播并保存,然后释放锁定。

  • 更新 weblogic-ejb-jar.xml 以使 Bean 不可集群。

    <wls:weblogic-enterprise-bean>
        <wls:ejb-name>Summary</wls:ejb-name>
        <wls:stateless-session-descriptor>
            <wls:stateless-clustering>
                <wls:home-is-clusterable>false</wls:home-is-clusterable>
                <wls:stateless-bean-is-clusterable>false</wls:stateless-bean-is-clusterable>
        </wls:stateless-clustering>
    </wls:stateless-session-descriptor>
    

  • 关于java - 启动托管服务器 WebLogic 12.2.1.4 时尝试同步群集 JNDI 树时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60516289/

    相关文章:

    java - 一个 java UDP 套接字可以处理多少个请求?

    java - 如何使 JUnit 测试用例按顺序运行?

    java - 网页的 HTML 和 Jsoup 响应不一样

    java - Weblogic 应用程序服务器在 Servlet 映射到 HTML 文件时记录 JSP 错误

    docker - 找不到startNodeManager.sh

    java - 如何在 weblogic.xml 中为虚拟目录映射的 <local-path> 设置动态路径

    java - 我可以将 Realm 用作 postgres ORM 吗?

    java - EJB调度中如何设置定时器值?

    java - EJB 3 编辑数据库记录

    ejb - 微服务架构模式是否类似于 EJB 1.0?