Re: Serializing/deserializing VTK classes

View: New views
3 Messages — Rating Filter:   Alert me  

Re: Serializing/deserializing VTK classes

by shu gao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,Jarek,
    Thanks for telling me to use Xstream to serialize /deserialize my
classes.I can serialize/deserialize  my classes, but  I met the
exception,which is java.lang.reflect.InvocationTargetException ,when I use
the statement XStream xstream=new XStream() in my Web Service
application.The detailed exception trace is in the attachment.Any suggestion
will be help.Many thanks in advance.

Kind regards,
Gao shu



>From: Jarek Sacha <jsacha@...>
>To: shu gao <gshu418@...>
>CC: ij-plugins-users@...
>Subject: Re: [Ij-plugins-users] Serializing/deserializing VTK classes
>Date: Wed, 27 Sep 2006 22:17:23 -0400
>
>shu gao wrote:
>>   I am developing web service using VTK. I met some difficulties in
>>serializing /deserialing VTK objects. As an example,I modified
>>Medical1.java ,which is in the VTK-Examples,as a application in server
>>side.So the return of the web service is class Medical1.I got an
>>Exception--java.io.NotserializableException:vtk.vtkLight.And I also found  
>>the other classes,such as vtkVolume16Reader,vtkContourFilter, and so on,
>>all seem not to be serialized.How do I
>>serialize /deserialze VTK objects? Any suggestion would be helpful and
>>many thanks in advance.
>
>I assume that you are trying to use standard Java binary serialization that
>requires a class to implement Serializable interface. Most of the classes
>in package vtk are auto generated by VTK build code. Only vtk.vtkPanel and
>vtk.vtkCanvas have actual source code. If you want binary serialization you
>may have to modify VTK build scripts and rebuild VTK.
>
>Another option is be to serialize to XML using libraries like XStream
>(http://xstream.codehaus.org/) that can serialize almost any code without
>need to implement Serializable interface. I am doing that in one of my
>projects that uses ij-VTK and it works quite nice.
>
>Jarek
>
_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free!
http://imagine-msn.com/messenger/launch80/?locale=en-gb


error2.JPG (58K) Download Attachment

Parent Message unknown Re: Serializing/deserializing VTK classes

by shu gao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



Hi,Jarek,
    Thanks for telling me to use Xstream to serialize /deserialize
my classes.I can serialize/deserialize  my classes, but  I met the
exception,which is java.lang.reflect.InvocationTargetException ,when
I use the statement XStream xstream=new XStream() in my Web Service
application.The detailed exception trace is in the attachment.Any
suggestion will be help.Many thanks in advance.

Kind regards,
Gao shu


>
>>From: Jarek Sacha <jsacha@...>
>>To: shu gao <gshu418@...>
>>CC: ij-plugins-users@...
>>Subject: Re: [Ij-plugins-users] Serializing/deserializing VTK classes
>>Date: Wed, 27 Sep 2006 22:17:23 -0400
>>
>>shu gao wrote:
>>>   I am developing web service using VTK. I met some difficulties in
>>>serializing /deserialing VTK objects. As an example,I modified
>>>Medical1.java ,which is in the VTK-Examples,as a application in server
>>>side.So the return of the web service is class Medical1.I got an
>>>Exception--java.io.NotserializableException:vtk.vtkLight.And I also found
>>>  the other classes,such as vtkVolume16Reader,vtkContourFilter, and so
>>>on, all seem not to be serialized.How do I
>>>serialize /deserialze VTK objects? Any suggestion would be helpful and
>>>many thanks in advance.
>>
>>I assume that you are trying to use standard Java binary serialization
>>that requires a class to implement Serializable interface. Most of the
>>classes in package vtk are auto generated by VTK build code. Only
>>vtk.vtkPanel and vtk.vtkCanvas have actual source code. If you want binary
>>serialization you may have to modify VTK build scripts and rebuild VTK.
>>
>>Another option is be to serialize to XML using libraries like XStream
>>(http://xstream.codehaus.org/) that can serialize almost any code without
>>need to implement Serializable interface. I am doing that in one of my
>>projects that uses ij-VTK and it works quite nice.
>>
>>Jarek
>>
>
>_________________________________________________________________
>Windows Live?Messenger has arrived. Click here to download it for free!
>http://imagine-msn.com/messenger/launch80/?locale=en-gb

><< error2.JPG >>


>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share
>your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


>_______________________________________________
>Ij-plugins-users mailing list
>Ij-plugins-users@...
>https://lists.sourceforge.net/lists/listinfo/ij-plugins-users

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free!
http://imagine-msn.com/messenger/launch80/?locale=en-gb


error2.JPG (58K) Download Attachment

Re: Serializing/deserializing VTK classes

by Jarek Sacha-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shu Gao:

I do not have experience running VTK in a web service. I cannot help you
with the error you have. My suggestion would be to try to separate you
objects into ones representing configuration ()independent of VTK) and
rendering (based on VTK). Then serialize only the configuration and
avoid possible problems related to VTK JNI interface and native
libraries (though I am not sure if that is really the problem in you case).

Jarek

shu gao
wrote:

>
>
> Hi,Jarek,
> Thanks for telling me to use Xstream to serialize /deserialize
> my classes.I can serialize/deserialize my classes, but I met the
> exception,which is java.lang.reflect.InvocationTargetException ,when
> I use the statement XStream xstream=new XStream() in my Web Service
> application.The detailed exception trace is in the attachment.Any
> suggestion will be help.Many thanks in advance.
>
> Kind regards,
> Gao shu
>
>
>>
>>> From: Jarek Sacha <jsacha@...>
>>> To: shu gao <gshu418@...>
>>> CC: ij-plugins-users@...
>>> Subject: Re: [Ij-plugins-users] Serializing/deserializing VTK classes
>>> Date: Wed, 27 Sep 2006 22:17:23 -0400
>>>
>>> shu gao wrote:
>>>> I am developing web service using VTK. I met some difficulties in
>>>> serializing /deserialing VTK objects. As an example,I modified
>>>> Medical1.java ,which is in the VTK-Examples,as a application in
>>>> server side.So the return of the web service is class Medical1.I
>>>> got an Exception--java.io.NotserializableException:vtk.vtkLight.And
>>>> I also found the other classes,such as
>>>> vtkVolume16Reader,vtkContourFilter, and so on, all seem not to be
>>>> serialized.How do I
>>>> serialize /deserialze VTK objects? Any suggestion would be helpful
>>>> and many thanks in advance.
>>>
>>> I assume that you are trying to use standard Java binary
>>> serialization that requires a class to implement Serializable
>>> interface. Most of the classes in package vtk are auto generated by
>>> VTK build code. Only vtk.vtkPanel and vtk.vtkCanvas have actual
>>> source code. If you want binary serialization you may have to modify
>>> VTK build scripts and rebuild VTK.
>>>
>>> Another option is be to serialize to XML using libraries like
>>> XStream (http://xstream.codehaus.org/) that can serialize almost any
>>> code without need to implement Serializable interface. I am doing
>>> that in one of my projects that uses ij-VTK and it works quite nice.
>>>
>>> Jarek
>>>
>>
>> _________________________________________________________________
>> Windows Live?Messenger has arrived. Click here to download it for
>> free! http://imagine-msn.com/messenger/launch80/?locale=en-gb
>
>
>> << error2.JPG >>
>
>
>> -------------------------------------------------------------------------
>>
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your
>> opinions on IT & business topics through brief surveys -- and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV 
>>
>
>
>> _______________________________________________
>> Ij-plugins-users mailing list
>> Ij-plugins-users@...
>> https://lists.sourceforge.net/lists/listinfo/ij-plugins-users
>
> _________________________________________________________________
> Windows Live™ Messenger has arrived. Click here to download it for
> free! http://imagine-msn.com/messenger/launch80/?locale=en-gb
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ij-plugins-users mailing list
> Ij-plugins-users@...
> https://lists.sourceforge.net/lists/listinfo/ij-plugins-users
>  



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Ij-plugins-users mailing list
Ij-plugins-users@...
https://lists.sourceforge.net/lists/listinfo/ij-plugins-users