weblogic 12c - ALLOW_EXTERNAL_APP_LOOKUP的版本化应用程序访问不起作用

时间:2017-12-03 05:34:56

标签: java environment-variables weblogic jndi

我正在尝试从客户端访问版本化的应用程序EJB远程查找,也是版本化的。

但我得到了:

####<Dec 3, 2017, 4:06:36,267 PM AEDT> <Warning> <JNDI> <macdev.tweedheadstorage.com.au> <OzsscEJBServer> <[ACTIVE] ExecuteThread: '20' for queue: 'weblogic.kernel.Default (self-tuning)' for workmanager: null@null@weblogic.kernel.System> <<anonymous>> <BEA1-01242AED82D5> <26bc5a01-6653-4fec-9d85-75a7ca35e240-0000714f> <1512277596267> <[severity-value: 16] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-050006> <An attempt was made to look up the versioned object "java:global.OzsscEJB.EJB.EmailFacadeEJB" from an external client or another application. This can potentially cause in-flight work of the application version not being tracked properly, and thus, be retired prematurely.> 

抛出BEA-0500006错误,导致服务器对象&#34;过早退役&#34;。基于oracle异常信息:

BEA-050006:警告:试图查找版本化对象&#34; name&#34;来自外部客户或其他应用程序。这可能会导致应用程序版本的正在进行的工作未被正确跟踪,从而过早地退役。 描述 试图查找版本化对象&#34; name&#34;来自外部客户或其他应用程序。这可能会导致应用程序版本的正在进行的工作未被正确跟踪,从而过早地退役。 原因 试图查找版本化对象&#34; name&#34;来自外部客户或其他应用程序。这可能会导致应用程序版本的正在进行的工作未被正确跟踪,从而过早地退役。 行动 请确保可以容忍或正确处理应用程序版本过早退役的可能性。要禁用此检查,用户可以将weblogic.jndi.WLContext.ALLOW_EXTERNAL_LOOKUP指定的JNDI环境属性设置为&#34; true&#34;在执行版本化对象的查找时。

我在客户端查找过程中将JNDI环境属性设置为:

    Properties prop = new Properties();
    Environment env = new Environment();
    try{
        prop.load(((ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext()).getResourceAsStream("/WEB-INF/ozssc-clustered-ejb.properties"));
        env.setInitialContextFactory(prop.getProperty("java.naming.factory.initial"));
        env.setProviderUrl(prop.getProperty("java.naming.provider.url"));
        env.setSecurityPrincipal(prop.getProperty("java.naming.security.principal"));
        env.setSecurityCredentials(prop.getProperty("java.naming.security.credentials"));
        env.setProperty("weblogic.jndi.WLContext.ALLOW_EXTERNAL_LOOKUP",true);
        env.setProperty("weblogic.jndi.WLContext.ALLOW_GLOBAL_RESOURCE_LOOKUP",true);
        /*logger.info("Property file loaded.");*/
        Context ctx = env.getInitialContext();
        if (ctx !=null){
            return ctx;
        }else
            return null;
    } catch (NamingException e) {
        e.printStackTrace();
        return null;
    } catch (IOException e){
        e.printStackTrace();
        return null;
    }

将应用程序重建并重新部署到Web逻辑服务器。它仍然不起作用。

BEA-050006错误仍然存​​在。

我很困惑,因为在我的理解中,允许外部查找是JNDI对象的服务器端属性,为什么oracle说&#34;用户可以设置weblogic.jndi.WLContext.ALLOW_EXTERNAL_LOOKUP指定的JNDI环境属性&#34;真&#34;在执行版本化对象的查找时。&#34;?

根本没有办法在服务器端设置JNDI环境属性,是吗?如果有人有这样的经历,请与我分享。

1 个答案:

答案 0 :(得分:0)

weblogic.jndi.WLContext.ALLOW_EXTERNAL_APP_LOOKUP不是属性名称,而是WebLogic API的常量。

看看API Reference of Interface WLContext

使用字段值设置属性:

implementation "android.arch.persistence.room:runtime:1.1.1"
annotationProcessor "android.arch.persistence.room:compiler:1.1.1"

但这只会禁用BEA-050006警告,在此情况下不能解决任何问题或错误。