我正在将应用程序从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.>
Summary.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
几个对我有用的变通方法,任一个都摆脱了例外:
导航到环境->群集->->配置选项卡->消息传递选项卡->消息传递模式:组播,您需要按Lock&Edit并将更改从Multicast更改为Unicast,然后保存然后释放Lock。
更新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>