users@glassfish.java.net

Dynamic proxies as result of a mehod call on an SSB

From: <glassfish_at_javadesktop.org>
Date: Sat, 03 Jul 2010 03:10:25 PDT

Hi All,

I have a client server application where the server sends POJOs to the client using standard remote calls to a stateless session bean. We reached a point where the data sent out should filtered according to the user's privileges. The easiest way was to create a dynamic proxy around our POJO, which knows and controls that which getter can return real values for the client (otherwise it simply returns nulls).

The proxy is created on serverside using an Interceptor over the SSB. The serialization seems to be successfull but when the proxy reaches the client an exception is thrown:

Jul 2, 2010 9:25:24 PM com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 checkForNegativeLength
WARNING: "IOP00810218: (MARSHAL) String or wstring with a negative length -1<<Context:ReaderWriter[value(java.util.List)]:java.util.ArrayList.size>>"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 218 completed: Maybe
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.negativeStringLength(ORBUtilSystemException.java:8716)
        at com.sun.corba.ee.impl.logging.ORBUtilSystemException.negativeStringLength(ORBUtilSystemException.java:8731)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.checkForNegativeLength(CDRInputStream_1_0.java:544)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readStringOrIndirection(CDRInputStream_1_0.java:562)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_string(CDRInputStream_1_0.java:636)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_string(CDRInputStream.java:263)
        at com.sun.corba.ee.impl.ior.IORImpl.<init>(IORImpl.java:192)
        at com.sun.corba.ee.spi.ior.IORFactories.makeIOR(IORFactories.java:109)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_Object(CDRInputStream_1_0.java:778)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:888)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:880)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:511)
        at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectDelegate(IIOPInputStream.java:389)
        at com.sun.corba.ee.impl.io.IIOPInputStream.readObjectOverride(IIOPInputStream.java:548)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:345)
        at java.util.ArrayList.readObject(ArrayList.java:593)
        at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.corba.ee.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1714)
        at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1215)
        at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:427)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:364)
        at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:330)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:966)
        at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1052)
        at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:475)
        at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:382)
        at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:483)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:195)
        at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
        at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(BCELStubBase.java:225)

I am using the standard java.lang.reflect.Proxy and my InvocationHandler implements the Serializable interface and has a no-arg constructor.

Any ideas are welcome :). Thnx in advance

Br,

B. Peter
[Message sent by forum member 'reluxa']

http://forums.java.net/jive/thread.jspa?messageID=476713