什么'org.omg.CORBA.MARSHAL:vmcid:0x0次要代码:0完成:也许'是的意思?

时间:2012-01-25 12:45:02

标签: java ejb weblogic weblogic-10.x

在调用 weblogic 10.3.5 服务器上部署的 EJB bean时,我遇到了非常神秘的错误。

错误是:

javax.ejb.EJBException: CORBA MARSHAL 0 Maybe; nested exception is: 
    org.omg.CORBA.MARSHAL:   vmcid: 0x0  minor code: 0 completed: Maybe; nested exception is: org.omg.CORBA.MARSHAL:   vmcid: 0x0  minor code: 0 completed: Maybe
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:121)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:103)
    at $Proxy0.getOrder(Unknown Source)
    at test.EjbTest.main(EjbTest.java:37)
Caused by: org.omg.CORBA.MARSHAL:   vmcid: 0x0  minor code: 0 completed: Maybe
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:897)
    at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:99)
    at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:572)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:430)
    at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:326)
    at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:129)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
    at service._OrderSession_fb3odc_OrderSessionRIntf_Stub.getOrder(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:85)
    ... 2 more

使用 wlclient.jar 创建ejb绑定:

public static <T> T getRemoteEJB(String jndi, Class<T> clazz){
    try {
        Properties props = new Properties();
        props.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
        props.put(Context.PROVIDER_URL, "t3://localhost:7001");

        InitialContext ctx = new InitialContext(props);

        T ejb = (T) ctx.lookup(jndi);
        PortableRemoteObject.narrow(ejb, clazz);
        return ejb;

    } catch (Exception e) {
        logger.error("Unable to lookup object of class {} through jndi name {}", clazz, jndi);
    }
    return null;
}

我找不到这个神秘的vmcid: 0x0 minor code: 0 completed: Maybe意味着什么,所以请至少知道这意味着什么。请求在服务器端完成,因为那里没有错误。

2 个答案:

答案 0 :(得分:6)

快速搜索错误指向此link。其中一项建议是不使用wlclient.jar,而是使用weblogic.jar。引用链接,

  

请尝试在客户端使用weblogic.jar,或者甚至更好   使用jarBuilder实用程序创建“wlfullclient.jar”的选项   作为WebLogic的一部分提供

问题似乎在于使用WebLogic的t3协议时对对象进行编组。请查看this链接。

答案 1 :(得分:3)

您可以在客户端尝试的另一件事是使用wlthint3client.jar。它随WebLogic 10.3.5(在wlserver_10.3.5 \ server \ lib中)一起提供。它比wlclient.jar大,但比wlfullclient.jar小得多。如果您使用此警告:如果Swing客户端从iiop切换到t3,则需要在其webstart包中包含smclientclasses.jar,否则会出错。如果客户端没有使用Swing,那么它应该不是问题。