IBM Support

Calling getHandle() in a WebSphere Application Client Throws a CORBA MARSHAL Exception

Troubleshooting


Problem

A thin Java™ client accessing an EJB on a version 6.0.x WebSphere Application Server gets the following error as soon as it tries to call getHandle(): Caused by: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Custom marshaling (4) Sender's class does not match local class vmcid: IBM minor code: 896 completed: No NOTE: the org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge error is a fairly generic error that means some "underlying error" caused the CORBA processing to fail to send the full message. This particular technote is documenting one specific cause of this error.

Symptom

CORBA MARSHAL 0x4942f896 No; nested exception is:
org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Custom marshaling (4) Sender's class does not match local class vmcid: IBM minor code: 896 completed: No
java.rmi.MarshalException: CORBA MARSHAL 0x4942f896 No;
nested exception is: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge :
Custom marshaling (4) Sender's class does not match local class vmcid:
IBM minor code: 896 completed: No
at com.ibm.CORBA.iiop.UtilDelegateImpl.mapSystemException

(UtilDelegateImpl.java:204)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:84)
at com.ibm.websphere.samples.technologysamples.ejb.stateless.


basiccalculatorejb._BasicCalculator_Stub.getHandle
(_BasicCalculator_Stub.java:169)
at basic.calc.BasicCalculatorClientMain.main

(BasicCalculatorClientMain.java:45)
...
Caused by: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Custom marshaling (4) Sender's class does not match local class vmcid:

IBM minor code: 896 completed: No
at com.ibm.rmi.iiop.CDRInputStream.read_value

(CDRInputStream.java:1381)
at com.ibm.rmi.iiop.CDRInputStream.read_abstract_interface

(CDRInputStream.java:1353)
at com.ibm.websphere.samples.technologysamples.ejb.stateless.


basiccalculatorejb._BasicCalculator_Stub.getHandle
(_BasicCalculator_Stub.java:158)
... 1 more

Cause

The client environment is not set up properly to act as a client to a WebSphere Application Server. The error itself indicates that there is a class file that the current client environment is missing.

A common cause for the environment to be missing class files is for the script or batch file that runs the client to try to manually set up the classpath by picking JAR files up from the WebSphere Application Server runtime lib directory. Often this method leaves out JAR files that the developer did not realize were needed because the client compiles successfully with a hand-picked classpath.

Resolving The Problem

Make sure that the client environment contains everything needed by using an existing WebSphere Application Server script or batch file as a template (the dumpNameSpace.sh or dumpNameSpace.bat file works very well for this). The client script or batch file should contain at a minimum:

1. A call to setupCmdLine.sh or setupCmdLine.bat. This file resides in the bin directory where the WebSphere Application Server product is installed. For machines that are remote to the WebSphere Application Server where the EJB is located, install the WebSphere Application Client and call its setupCmdLine.sh or setupCmdLine.bat file. The WebSphere Application Client install is bundled in with the WebSphere Application Server install media.

2. A Java command line with all of the following properties set:


    a. com.ibm.CORBA.configURL (the setupCmdLine script sets up an environment variable called CLIENTSAS where this is already set; this property is only needed when the WebSphere Application Server has security enabled)

    b. ws.ext.dirs

    c. classpath containing the WAS_CLASSPATH environment variable and any client JAR files


3. The class that is invoked should be com.ibm.ws.bootstrap.WSLauncher and your client class file should be the first argument to the WSLauncher class

A sample batch file is attached to this technote.

MyClient.bat

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Application Client","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5.5;8.0;7.0","Edition":"Base;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}},{"Product":{"code":"SS7K4U","label":"WebSphere Application Server for z\/OS"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":" ","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"7.0;6.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21212129