A lookup operation of an object from a server-side client (application, service, library) returns an unexpected object type.
Scenario Type: Error analysis
SAP NetWeaver Component: Application Server Java (AS Java)
Example:
Context jndiCtx = new InitialContext(); Object object = jndiCtx.lookup(“objectName”); LookedUpObjectInterface result = (LookedUpObjectInterface) PortableRemoteObject.narrow (object, LookedUpObjectInterface.class);
|
Throws:
java.lang.ClassCastException: com.sap.engine.interfaces.cross.ObjectReferenceImpl at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:154) at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24) ...............
|
or:
java.lang.ClassCastException: com.sap.engine.services.naming.persistent.UnsatisfiedReferenceImpl at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:154) at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24) ...............
|
To be able to load the looked-up object, the client must have a class loader reference to the component that has bound this object.
Check if the client has a class loader reference to the component that has bound the object. If it does not, put a class loader reference.