org.omg.CORBA.MARSHAL:Valuetype没有实现StreamableValue或CustomMarshal

时间:2016-12-06 19:14:47

标签: java websphere-liberty corba orb

我正在尝试使用Liberty配置文件16.0.0.3调用远程EJB服务(MDM服务)。我的查找代码如下所示。

ctx = new InitialContext();
Object obj = 
        ctx.lookup("corbaname:iiop:myhost:9810/NameServiceServerRoot#com/dwl/base/requestHandler/beans/DWLServiceController");
        dwlServiceControllerHome = (DWLServiceControllerHome)PortableRemoteObject.narrow(obj, DWLServiceControllerHome.class);
        dwlServiceController = dwlServiceControllerHome.create();
        HashMap<String, String> contextMap = createContextMap();

        String response = dwlServiceController.processRequest(contextMap, wccReqString).toString().trim();  
                            try {
                                StringReader reader = new StringReader(response);                   
                                StreamSource streamSource = new StreamSource(reader);
                                tcrmResp = (TCRMService) providerMarshaller.unmarshal(streamSource);
                            } catch (Exception e) {

                                e.printStackTrace();

                                throw e;
                            }

使用上面的代码,我可以调用远程EJB服务。正面方案正常运行。当我们使用负面方案数据测试服务时(当远程EJB服务抛出自定义有效异常时)低于错误。

[ERROR   ] MARSHAL "Valuetype does not implement StreamableValue or CustomMarshal", at pos=0x214
[err] org.omg.CORBA.MARSHAL: Valuetype does not implement StreamableValue or CustomMarshal:  vmcid: 0x0 minor code: 0x0  completed: No
[err]   at org.apache.yoko.orb.OB.ValueReader.unmarshalValueState(ValueReader.java:716)
[err]   at org.apache.yoko.orb.OB.ValueReader.access$300(ValueReader.java:54)
[err]   at org.apache.yoko.orb.OB.ValueReader$ClassCreationStrategy.create(ValueReader.java:196)
[err]   at [internal classes]
[err]   at java.lang.Throwable.readObject(Throwable.java:388)
[err]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[err]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
[err]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[err]   at java.lang.reflect.Method.invoke(Method.java:508)
[err]   at org.apache.yoko.rmi.impl.ValueDescriptor.readSerializable(ValueDescriptor.java:735)
[err]   at [internal classes]
[err]   at org.apache.yoko.orb.OB.ValueReader.access$200(ValueReader.java:54)
[err]   at org.apache.yoko.orb.OB.ValueReader$ClassCreationStrategy.create(ValueReader.java:189)
[err]   at [internal classes]
[err]   at com.dwl.base.requestHandler.beans._DWLServiceController_Stub.processRequest(_DWLServiceController_Stub.java:1001)

我们正在使用以下技术规格

  • Spring Boot 1.2.4 / 1.4.2
  • Liberty Profile 16.0.0.3
  • IBM JDK 8 / Sun JDK 8

1 个答案:

答案 0 :(得分:0)

“org.omg.CORBA.MARSHAL”说明了一切。两侧接口的定义(IDL)必须相同。如果不是,就会发生编组错误。可能你的代码没有返回异常的定义,或者定义与远程端的定义不同。