简体   繁体   English

SerialContext [myEnv = Glassfish 3.1.2.2中的异常]的通信异常

[英]Communication exception for SerialContext[myEnv= Exception in Glassfish 3.1.2.2

My application contains an implementation of the "Service Locator" pattern. 我的应用程序包含“服务定位器”模式的实现。 The ServiceLocator is a central component which performs (JNDI) lookups for Remote EJBs and is used by several of our applications/components (r6-core, Java-API, etc.). ServiceLocator是一个中央组件,它为远程EJB执行(JNDI)查找,并由我们的多个应用程序/组件(r6-core,Java-API等)使用。 The ServiceLocator has several configuration options and its main goal is to enable flexible (machine independent/application independent) deployments scenarios. ServiceLocator具有多个配置选项,其主要目标是实现灵活的(独立于机器/独立于应用程序)部署方案。 Another goal is to shield JNDI/EJB lookup boilerplate from business logic (code). 另一个目标是保护JNDI / EJB查找样板不受业务逻辑(代码)的影响。

If a specific EJB is configured to be called only via local calls, the ServiceLocator implementation first instantiates an empty InitialContext and performs a JNDI lookup: 如果将特定的EJB配置为仅通过本地调用来调用,则ServiceLocator实现首先实例化一个空的InitialContext并执行JNDI查找:

InitialContext ic = new InitialContext();
ic.lookup(jndiName);

The currently unexpected behavior is that we get the following exception upon executing this code: 当前意外的行为是执行此代码后,我们将获得以下异常:

lookup for jndi-name 'java:global/.../ar-common-impl/ArPropertiesDaoBean' failed: 'Communication exception for SerialContext[myEnv=
{java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory,
java.naming.corba.orb=com.sun.corba.ee.impl.orb.ORBImpl@4f92338d,
java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl,
java.naming.factory.url.pkgs=com.sun.enterprise.naming,
com.sun.appserv.ee.iiop.endpointslist=corbaloc:iiop:1.2@sprprd01:23700}

This exception shows that a remote call is tried! 此异常表明尝试了远程呼叫! Due to the fact that these (local only) EJBs are not configured to be remote beans (and thus not serializable) an exception is thrown. 由于这些(仅本地的)EJB未配置为远程bean(因此不可序列化),因此会引发异常。

The question is: Where does the endpointslist come from, even though we have not provided any of these parameters? 问题是:即使我们没有提供这些参数中的任何一个,endpointslist来自何处?

已通过使用EJB注入而不是本地查找解决了问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM