Friday, April 5, 2013

Solution for De-serialization problem in EJB entity from a remote client!

In my previous post , I had a problem in calling remote EJB entity from a remote client. The problem was, when retrieving an object from a data base and return to the client CORBA MARSHALING exception is being thrown. Because, may be the entity retrieved and returned to client can't be de-serialized in the same way as the server.  For overcoming this problem, I spent many hours. There are many posts available in web just mentioning the problem and suggesting their idea, but not really a solution.
Finally, I just separate the entity class as java application and add to all EJB session beans, Interfaces, and Client application (web application). With this, it works perfectly. Nevertheless, I don't think this is better solution. This gives access to entity beans for the client.
I am still searching for a better solution.:) 

Wednesday, April 3, 2013

De-Serialization problem in EJB remote client and server using JPA

When I try to retrieve an object passed as a list or so from session bean to a client side application say action class in struts 2 concept, De-Serialization problem occurred. I googled a lot, but no one has came with tangible solution.

Here below the full stack trace of the glass fish server.
WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream
org.omg.CORBA.MARSHAL: WARNING: IOP00810011: Exception from readValue on ValueHandler in CDRInputStream  vmcid: OMG  minor code: 11 completed: Maybe
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
 at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
 ......
 at org.mk.rc.intf.__PublicationBeanRemote_Remote_DynamicStub.searchPublication(org/mk/rc/intf/__PublicationBeanRemote_Remote_DynamicStub.java)
 at org.mk.rc.intf._PublicationBeanRemote_Wrapper.searchPublication(org/mk/rc/intf/_PublicationBeanRemote_Wrapper.java)
 at org.mk.rc.actions.PublicatonAction.searchPublication(PublicatonAction.java:43)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
......
 at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
 at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249)
 ......
atThreadPool$Worker.run(AbstractThreadPool.java:513)
 at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.NullPointerException
 at com.sun.corba.ee.impl.orbutil.ClassInfoCache$ClassInfo.(ClassInfoCache.java:156)
.....
 at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:274)
 at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readRMIIIOPValueType(CDRInputStream_1_0.java:1015)
 ... 96 more

I don't solved it yet. I hope soon :)