Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question
0

problem in gigaspaces.write(POJO)

Hi, Right now I have built an addin extension for openoffice in java and such extension contains a function to write a POJO to the space, (simply gigaSpace.write(template)). I found that it is successful to use gigaSpace.write(template) running in Netbeans but I encountered an error when I was calling the function in openoffice:

org.openspaces.core.EntrySerializationException: Failed to deserialize Entry GigaSpaces.Examples.Template; nested exception is com.j_spaces.core.EntrySerializationException: Failed to deserialize Entry GigaSpaces.Examples.Template

even I implement Serializable in Template class, the problem is still existing btw, I have included the needed gigapspace classpaths for client in openoffice already

{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2837]{quote}

asked 2009-02-01 20:34:22 -0500

twinsenc gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

6 Answers

Sort by ยป oldest newest most voted
0

Are you sure are all GigaSpaces.Examples.Template fields are serializable?
Shay

answered 2009-02-01 21:04:02 -0500

shay hassidim gravatar image
edit flag offensive delete link more
0

For more detail, the error will not occur if it is an embedded space.

openOffice JRE 1.5.0_16

Gigaspace (shown in console) : java version "1.5.0_16" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02) Java HotSpot(TM) Server VM (build 1.5.0_16-b02, mixed mode)

answered 2009-02-02 21:26:16 -0500

twinsenc gravatar image
edit flag offensive delete link more

Comments

How the remote space is started? Do you deploy the space using a PU? Can you post the relevant client code? Shay

shay hassidim gravatar imageshay hassidim ( 2009-02-02 23:31:04 -0500 )edit
0

private Integer stockId = null; private Double spot = null; private Double volatility = null; private Boolean processed = null;

private Date dataTimestamp = null;

properties as the above, indeed, is it necessary to implement Serializable for the class?

I found a situation is once I injected a POJO in the space (thru Java IDE indeed), the functions in openoffice work fine as the Template class name with package/namespace is in the space while there is the error if the Template class name not in the space.

Edited by: cc cc on Feb 1, 2009 11:10 PM

answered 2009-02-01 21:29:04 -0500

twinsenc gravatar image
edit flag offensive delete link more
0

Btw, even I dont call the java function thru macro in openoffice spreadsheet, say =write(10, "jini://...sth...") in a cell
the problem still exists.

answered 2009-02-03 20:12:00 -0500

twinsenc gravatar image
edit flag offensive delete link more
0

For more detail, I traced the LRMI log and I have the following result.

For a normal situation, using Java App to write object into the space, the read/write packet request on getClassDefinition is functioning:

On the other hand, while writing object from the java api calling in Openoffice spreadsheet: GSC got a null in the ReplyPacket packet.

Apparently GigaSpace is falling to getClassDefinition from Openoffice client. I am concerning whether there is security setting about gigaSpace required in client side. (P.S Windows XP, Firewall is off)

I attached with the logs of both situations in GSC console.


  • normal java App.

Feb 4, 2009 5:13:37 PM FINE [com.gigaspaces.lrmi]: Thread[LRMI Connection-pool-2-thread-3,5,main] DynamicSmartStub prepared connection: DynamicSmartStub [ImplObjClass:

com.gigaspaces.lrmi.classloading.DefaultClassProvider, ConnectionURL: NIO:///192.168.128.74:3509/1149860480196423_0, MaxConnPool: 1024 ] ^M Feb 4, 2009 5:13:37 PM, Class: com.gigaspaces.lrmi.nio.Writer, Method: writePacket FINEST [com.gigaspaces.lrmi]: --> Write Packet [RequestPacket: getClassDefinition(java.lang.String com.example.MyClass), isOneWay = false, isCallBack = false] ^M Feb 4, 2009 5:13:37 PM, Class: com.gigaspaces.lrmi.nio.Reader, Method: bytesToPacket FINEST [com.gigaspaces.lrmi]: <-- Read packet [ReplyPacket: result = [B@19e421e] ^M Feb 4, 2009 5:13:37 PM, Class: com.gigaspaces.lrmi.nio.Writer, Method: writePacket FINEST [com.gigaspaces.lrmi]: --> Write Packet [RequestPacket: getClassDefinition(java.lang.String com.example.MyClassBeanInfo), isOneWay = false, isCallBack = false] ^M Feb 4, 2009 5:13:37 PM, Class: com.gigaspaces.lrmi.nio.Reader, Method: bytesToPacket FINEST [com.gigaspaces.lrmi]: <-- Read packet [ReplyPacket: exception = null] ^M Feb 4, 2009 5:13:38 PM, Class: com.gigaspaces.lrmi.nio.Writer, Method: writePacket FINEST [com.gigaspaces.lrmi]: --> Write Packet [RequestPacket: getClassDefinition(java.lang.String com.example.MyClassGigaspacesCtor0), isOneWay = false, isCallBack = false] ^M Feb 4, 2009 5:13:38 PM, Class: com.gigaspaces.lrmi.nio.Reader, Method: bytesToPacket FINEST [com.gigaspaces.lrmi]: <-- Read packet [ReplyPacket: exception = null] ^M Feb 4, 2009 5:13:38 PM, Class: com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask, Method: run FINEST [com.gigaspaces.lrmi]: <-- [RequestPacket: update(com.j_spaces.core.IEntryPacket (class=com.example.MyClass,uid=-1231338469^19^10^0^0,version=0), net.jini.core.transactio n.Transaction null, long 9223372036854775807, long 0, com.j_spaces.core.client.IJSpaceProxyListener null, int 0, com.j_spaces.core.SpaceContext null, boolean false, long 0, int 4096), isOneWay = false, isCallBack = true] ^M Feb 4, 2009 5:13:38 PM, Class: LRMIRuntime - com.j_spaces.core.JSpaceImpl#1149432164508826, Method: update FINER [com.gigaspaces.lrmi]: ENTRY (class=com.example.MyClass,uid=-1231338469^19^10^0^0,version=0) null 9,223,372,036,854,775,807 0 null 0 null false 0 4,096 ^M Feb 4, 2009 5:13:38 PM, Class: LRMIRuntime - com.j_spaces.core.JSpaceImpl#1149432164508826, Method: update FINER [com.gigaspaces.lrmi]: RETURN [AnswerPacket entryPacket = null, isDummy = false] ...........................

================================================ * Java api calling in openoffice

Feb 4, 2009 5:10:08 PM FINE [com.gigaspaces.lrmi]: Thread[LRMI Connection-pool-2-thread-1,5,main] DynamicSmartStub prepared connection: DynamicSmartStub [ImplObjClass: com.gigaspaces.lrmi.classloading .DefaultClassProvider, ConnectionURL: NIO:///192.168.128.74:3280/1148901223536989_0, MaxConnPool: 1024 ] ^M Feb 4, 2009 5:10:09 PM, Class: com.gigaspaces.lrmi.nio.Writer, Method: writePacket FINEST [com.gigaspaces.lrmi]: --> Write Packet [RequestPacket: getClassDefinition(java.lang.String com.example.MyClass), isOneWay = false, isCallBack = false] ^M Feb 4, 2009 5:10:09 PM, Class: com.gigaspaces.lrmi.nio.Reader, Method: bytesToPacket FINEST [com.gigaspaces.lrmi]: <-- Read packet [ReplyPacket: exception = null] ^M Feb 4, 2009 5:10:09 PM SEVERE [com.gigaspaces.lrmi]: LRMI Transport Protocol caught server exception caused by [/192.168.128.74:3449] client. com.j_spaces.core.EntrySerializationException: Failed to deserialize Entry com.example.MyClass^M at com.j_spaces.core.EntryPacket.readExternal(EntryPacket.java:663)^M at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)^M at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)^M at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)^M at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)^M at com.gigaspaces.io.IOUtils.unmarshalValue(IOUtils.java:231)^M at com.gigaspaces.lrmi.nio.RequestPacket.readExternal(RequestPacket.java:139)^M at com.gigaspaces.lrmi.nio.Reader.unmarshall(Reader.java:461)^M at com.gigaspaces.lrmi.nio.Reader.unmarshallRequest(Reader.java:375)^M at com.gigaspaces.lrmi.nio.ChannelEntry.unmarshall(ChannelEntry.java:125)^M at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:142)^M at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)^M at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)^M at java.util.concurrent.FutureTask.run(FutureTask.java:123)^M at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)^M at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)^M at java.lang.Thread.run(Thread.java:595)^M

...............................................

Edited by: cc cc on Feb 4, 2009 6:56 PM

answered 2009-02-04 18:56:27 -0500

twinsenc gravatar image
edit flag offensive delete link more

Comments

Have this following system property at the client and space side: com.gs.transport_protocol.lrmi.classloading=false

Do you see different behavior? Shay

shay hassidim gravatar imageshay hassidim ( 2009-02-05 07:59:00 -0500 )edit
0

Thx for ur reply

The remote space is just an unmanged space. nth special and without any PU.

Suppose the Openoffice included the extension with the following function and calling it by a macro.


REM BASIC

Sub Main dim oSheet

svc = createUnoService( "com.sun.star.sheet.FunctionAccess" ) oSheet = thisComponent.Sheets(0)

url = oSheet.getCellRangeByName("A1").String stockId = oSheet.getCellRangeByName("A2").String

arg = array(stockId, url) oSheet.getCellRangeByName("A5").String = svc.callFunction("write", arg)

End Sub

the client code in openoffice addin project (java) public String write(com.sun.star.beans.XPropertySet xOptions, int id, String url) { try { IJSpace space = new UrlSpaceConfigurer(url).space(); GigaSpace gigaSpace = new GigaSpaceConfigurer(space).gigaSpace(); MyClass t = new MyClass(); t.setId(id); //MyClass x = gigaSpace.read(t); gigaSpace.write(t); return "Done."; } catch (Throwable e) { return e.toString(); } }


in GSC console log: SEVERE [com.gigaspaces.lrmi]: LRMI Transport Protocol caught server exception caused by [/192.168.128.74:4318] client. com.j_spaces.core.EntrySerializationException: Failed to deserialize Entry com.example.MyClass at com.j_spaces.core.EntryPacket.readExternal(EntryPacket.java:663) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348) at com.gigaspaces.io.IOUtils.unmarshalValue(IOUtils.java:231) at com.gigaspaces.lrmi.nio.RequestPacket.readExternal(RequestPacket.java:139) at com.gigaspaces.lrmi.nio.Reader.unmarshall(Reader.java:461) at com.gigaspaces.lrmi.nio.Reader.unmarshallRequest(Reader.java:375) at com.gigaspaces.lrmi.nio.ChannelEntry.unmarshall(ChannelEntry.java:125) at com.gigaspaces.lrmi.nio.Pivot$ChannelEntryTask.run(Pivot.java:142) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269) at java.util.concurrent.FutureTask.run(FutureTask.java:123) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.NullPointerException at com.j_spaces.core.introspect.PojoIntrospector.init(PojoIntrospector.java:351) at com.j_spaces.core.introspect.PojoIntrospector.readExternal(PojoIntrospector.java:344) at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)

at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at com.j_spaces.core.AbstractTypeDescriptor.readExternalV1(AbstractTypeDescriptor.java:382)
at com.j_spaces.core.AbstractTypeDescriptor.readExternal(AbstractTypeDescriptor.java:366)
at com.j_spaces.core.client.TypeTableEntry.readExternalV1(TypeTableEntry.java:116)
at com.j_spaces.core.client.TypeTableEntry.readExternal(TypeTableEntry.java:102)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1755)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1717)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at com.j_spaces.core.EntryPacket.readExternal(EntryPacket.java:645)
... 16 more

answered 2009-02-03 20:08:22 -0500

twinsenc gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2009-02-01 20:34:22 -0500

Seen: 110 times

Last updated: Feb 04 '09