<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel about="http://blog.gmane.org/gmane.comp.java.xstream.user">
    <title>gmane.comp.java.xstream.user</title>
    <link>http://blog.gmane.org/gmane.comp.java.xstream.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5340"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5339"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5338"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5337"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5336"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5335"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5334"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5333"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5332"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5331"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5330"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5329"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5328"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5327"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5326"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5325"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5324"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5323"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5322"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.java.xstream.user/5321"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5340">
    <title>Re: Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5340</link>
    <description>
Hi,

I created a class "IntegerConverter implements Converter" with the method:

&lt; at &gt;Override
public Object unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext arg1) {
System.out.println("unmarshal!");
if ((reader.getValue() != null) &amp;&amp; (!reader.getValue().equals(""))) {
return Integer.parseInt(reader.getValue());
} else {
return null;
}
}

 
how could I write marshal method for writing the attribute without value?


&lt; at &gt;Override
public void marshal(Object obj, HierarchicalStreamWriter writer,
MarshallingContext context) {
//????
}


Thanks.

Lucas Vargas Eskopinski.



Mark Waschkowski wrote:

</description>
    <dc:creator>Lucas Eskopinski</dc:creator>
    <dc:date>2008-12-02T01:27:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5339">
    <title>Re: Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5339</link>
    <description>OK, if you have special needs, then you will have to create a custom
converter, see:

http://xstream.codehaus.org/converter-tutorial.html

Its fairly straightforward, and when you are unmarshalling you can
just write some code to ignore empty strings.

Cheers,

Mark

On Mon, Dec 1, 2008 at 5:44 PM, Lucas Eskopinski &lt;eskopinski-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt; wrote:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Mark Waschkowski</dc:creator>
    <dc:date>2008-12-02T00:42:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5338">
    <title>Re: Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5338</link>
    <description>
Hi Mark,

Thanks for your response.

Yes, the XStream not generate attributes with null value, but I need.

Is there any sample this type converter to null values?

Thanks.

Lucas Vargas Eskopinski.



Mark Waschkowski wrote:

</description>
    <dc:creator>Lucas Eskopinski</dc:creator>
    <dc:date>2008-12-01T22:44:46</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5337">
    <title>RE: Custom Mapper</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5337</link>
    <description>Hi Calvin,

Wu, Calvin (Technology) wrote:


OK, that's one of the "general" reasons ;-)

Have a look at the CustomMapperTest in the com.thoughtworks.acceptance
package. This acceptance test already has such an implementation.

- Jörg



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Jörg Schaible</dc:creator>
    <dc:date>2008-12-01T20:53:05</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5336">
    <title>Re: Issue implementing Serializable interface</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5336</link>
    <description>Hi Mark,

Mark Codere wrote:


XStream uses different kind of converters for different type of objects. You
can write converters yourself or rely on the ones that are delivered by
XStream and registered by default. Those are documented here:
http://xstream.codehaus.org/converters.html.

XStream really tries hard to recreated any object (graph) that has been
written with XStream before. I emphasis on this sequence, since each
converter is free in its implementation what it writes into the XML for the
object it is handling.

Your description now seems to imply that you try to read XML that has *not*
been generated by XStream. While you can tweak XStream to some extend it is
sometimes necessary to implement an own converter. In general follow the
advice of the FAQ:
http://xstream.codehaus.org/faq.html#XML_unmarshalling_fails.

In any case it is always useful to see the XML that is generated and the XML
that should be generated (or read).

Regards,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Jörg Schaible</dc:creator>
    <dc:date>2008-12-01T20:50:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5335">
    <title>Re: How to use XSTream to persist a Graph Object??</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5335</link>
    <description>Hi,

Actually, your problem is *not* with XStream, its with how you setup
your object model. A lot could be said about this, but the simple
answer is:

Note the following method:

  getSlider

it takes parameters:

  String title, String name, int min, int max, int value, int
minorSpace, int majorSpace

What you could do is persist the default parameters somewhere and then
read them in and call the getSlider method with those parameters. You
could use a properties file for example.

However...you have chosen XStream for serialization, so what you
should then do is create an object called SliderProperties and create
an attribute for each of the above parameters. Then, create a default
SliderProperties object, serialize it with XStream and store the
resulting XML with your project. As well, create a new method with the
following signature:

  getSlider(SliderProperties sliderProperties)

The method will do the same thing the current code does now, but
calling on the SliderProperties object for all the needed state. Now,
when your project loads, have it read in the stored (at this point,
default) XML and initialize the system using the new method.

Then, during execution, when the user changes some value, update the
SliderProperties object and then serialize the changes using XStream
and store the xml file. Then, the next time your system loads it will
always have the latest state to load back from.

Just to reiterate, this is not an XStream issue, this is an
application design issue.

Regards,

Mark

On Mon, Dec 1, 2008 at 12:22 PM, sunnymanman &lt;charleswang2000-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt; wrote:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Mark Waschkowski</dc:creator>
    <dc:date>2008-12-01T18:10:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5334">
    <title>Re: RV: Arraylist</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5334</link>
    <description>This is accomplished via:
http://xstream.codehaus.org/manual-tweaking-output.html (see section
on implicit collections and give it a try with an Array or a List).

Regards,

Mark

On Mon, Dec 1, 2008 at 12:13 PM, Alejandro Vergara
&lt;alejandro.vergara-AyifJBEyR51SxoMRyd00xw&lt; at &gt;public.gmane.org&gt; wrote:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Mark Waschkowski</dc:creator>
    <dc:date>2008-12-01T17:53:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5333">
    <title>Re: Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5333</link>
    <description>Yes, I know. I'm not responding to your issue as I don't currently
have the time nor in depth experience doing XStream support to easily
provide you with an answer.

Please don't post into two threads at once, and might I suggest that
you wait patiently for someone to answer your question?

Regards,

Mark

On Mon, Dec 1, 2008 at 12:08 PM, Mark Codere &lt;mark.codere-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt; wrote:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Mark Waschkowski</dc:creator>
    <dc:date>2008-12-01T17:51:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5332">
    <title>RE: Custom Mapper</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5332</link>
    <description>For example, removing underscore of field names.  

Calvin

-----Original Message-----
From: Jörg Schaible [mailto:Joerg.Schaible-ysaFb9yBoMtWk0Htik3J/w&lt; at &gt;public.gmane.org] 
Sent: Friday, November 28, 2008 7:11 AM
To: user-wQG/9G7OwhzIJWOP8RzEEmD2FQJk+8+b&lt; at &gt;public.gmane.org
Subject: RE: [xstream-user] Custom Mapper

Hi Calvin, 

Wu, Calvin (Technology) wrote on Friday, November 28, 2008 12:51 PM:

Mappers and converters are fundamental different things. Since your question imply some lack of understanding (no offence, we do *not* encourage own mappers in first place - it is more like last resort), I'd like to know first, why you think you need a custom mapper?


- Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Wu, Calvin (Technology</dc:creator>
    <dc:date>2008-12-01T17:33:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5331">
    <title>Re: How to use XSTream to persist a Graph Object??</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5331</link>
    <description>
Thanks Mark:
But I am very new to XStream, really did not know how to do it, can you help
throw some lights here to guide how to apply XStream to my example??
I can run simple case in XStream tutorial, but I am confused with this
example.

Thanks



Mark Waschkowski wrote:

</description>
    <dc:creator>sunnymanman</dc:creator>
    <dc:date>2008-12-01T17:22:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5330">
    <title>RV: Arraylist</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5330</link>
    <description>Hi all,

 

I need map this estruct:

 

&lt;a&gt;
&lt;string&gt;cad w/o fees&lt;/string&gt;
&lt;string&gt;susp&lt;/string&gt;
&lt;string&gt;late&lt;/string&gt;
&lt;string&gt;badck&lt;/string&gt;
&lt;string&gt;other&lt;/string&gt;
&lt;string&gt;corp&lt;/string&gt;
&lt;/a&gt;

 

try with data type arraylist but no work! can any body help me?

 

Thanks

Alejandro.

 

 

</description>
    <dc:creator>Alejandro Vergara</dc:creator>
    <dc:date>2008-12-01T17:13:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5329">
    <title>Re: Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5329</link>
    <description>Hi Mark,
I didn't write the email to which you responded - that was someone else.

Here's my issue:

I am using XStream to deserialize an object from XML and I keep getting the
following fail message:

com.thoughtworks.xstream.converters.ConversionException: Cannot deserialize
object with new readObject()/writeObject() methods

---- Debugging information ----
class               : com.Request
required-type    : com.Request
path                : /work_request
line number         : 1
-------------------------------

at
com.thoughtworks.xstream.converters.reflection.SerializableConverter.doUnmarshal(SerializableConverter.java:270)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:150)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
at
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:55)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:142)
at
com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:931)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:917)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)


After much digging through XStream source code, it appears that the java
object I'm trying to deserialize from the XML is not being created because
it's an instance of a class that implements the Serializable interface.  It
seems as though, a SerializableConverter is being used as opposed to
the AbstractReflectionConverter.

In the DefaultConverterLookup.lookupConverterForType(),
the SerializableConverter is found since it's isSerializable() returns true
after passing the serializationMethodInvoker.supportsReadObject() test. The
object I'm trying to deserialize contains a readObject() in one of it's
parent classes...

XStream will deserialize my object successfully if I don't subclass the
object that's serializable.


On Mon, Dec 1, 2008 at 12:02 PM, Mark Waschkowski &lt;mwaschkowski-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt;wrote:

</description>
    <dc:creator>Mark Codere</dc:creator>
    <dc:date>2008-12-01T17:08:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5328">
    <title>Re: Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5328</link>
    <description>Hi,

You would need to provide the xml being unmarshelled. Almost certainly
this relates to:

http://xstream.codehaus.org/faq.html#XML_unmarshalling_fails

I believe if you compare XML created by XStream to the XML you are
using you will notice some differences that are causing the problem
you encountered.

Regards,

Mark

On Mon, Dec 1, 2008 at 11:54 AM, Lucas Eskopinski &lt;eskopinski-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt; wrote:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Mark Waschkowski</dc:creator>
    <dc:date>2008-12-01T17:02:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5327">
    <title>Conversion Exception</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5327</link>
    <description>
--------------------------------------------
</description>
    <dc:creator>Lucas Eskopinski</dc:creator>
    <dc:date>2008-12-01T16:54:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5326">
    <title>Issue implementing Serializable interface</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5326</link>
    <description>Hi Joerg,
I am using XStream to deserialize an object from XML and I keep getting the
following fail message:

com.thoughtworks.xstream.converters.ConversionException: Cannot deserialize
object with new readObject()/writeObject() methods

---- Debugging information ----
class               : com.Request
required-type    : com.Request
path                : /work_request
line number         : 1
-------------------------------

at
com.thoughtworks.xstream.converters.reflection.SerializableConverter.doUnmarshal(SerializableConverter.java:270)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:150)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:81)
at
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:55)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:75)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:59)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:142)
at
com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:931)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:917)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:861)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)


After much digging through XStream source code, it appears that the java
object I'm trying to deserialize from the XML is not being created because
it's an instance of a class that implements the Serializable interface.  It
seems as though, a SerializableConverter is being used as opposed to
the AbstractReflectionConverter.

In the DefaultConverterLookup.lookupConverterForType(),
the SerializableConverter is found since it's isSerializable() returns true
after passing the serializationMethodInvoker.supportsReadObject() test. The
object I'm trying to deserialize contains a readObject() in one of it's
parent classes...

Thanks,
Mark
</description>
    <dc:creator>Mark Codere</dc:creator>
    <dc:date>2008-12-01T16:15:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5325">
    <title>Re: How to use XSTream to persist a Graph Object??</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5325</link>
    <description>As I said in my previous email (which you never responded to):

-----snip
Hi,

The simple answer is you can serialize any java object you want.
Given your context, you should only persist the data you wish to
store. You should create classes that will render the stored data, and
you should do it all through an object model. So, change the names as
desired, but do something similar to the following:

1) Create a Position class (this stores rotation and distance)
2) Create renderers (or Views) that work with Position objects
3) Persist the Position classes via xstream - your serialized xml will
be very simple now

Once you apply the concept of a Model (Position) and a View (the
renderers), you will notice that its far easier to evolve, maintain
and debug your system moving forward. It will take a bit of work to
refactor your code, but trust me that it will be worth it, and the
next time you do something similar you will be further ahead knowing
the proper concepts to apply.

Search for Model-View-Controller to find out more.

Regards,

Mark

On Sun, Nov 30, 2008 at 10:38 PM, sunnymanman &lt;charleswang2000-Re5JQEeQqe8AvxtiuMwx3w&lt; at &gt;public.gmane.org&gt; wrote:

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Mark Waschkowski</dc:creator>
    <dc:date>2008-12-01T12:36:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5324">
    <title>RE: ClassNotFoundException thrown while deserializing?</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5324</link>
    <description>Hi,

rmahmood wrote:

OK, then let's rephrase it a bit and provide some pseudo code.

Fact is that your current apoproach relies on the client side implementation of the app server's stubs. But I think this detail is not realy of interest! Does it make a difference four your use case whether the EJB call was made against JBoss or WebLogic? AFAICS you should only be interested in the called method of that EJB (stub).

Currently you must have implemented something like this (pseudo code):

========= %&lt; ===========
class Call {
    Method method;
    Object target;
    Object[] arguments;
    Object result;
    public Call(Method method, Object target, Object[] arguments, Object result) {
        this.method = method;
        this.target = target;
        this.arguments = arguments;
        this.object = object;
    }
}

...
result = method.invoke(target, arguments);
recoder.add(new Call(method, target, arguments, result));
...
========= %&lt; ===========

but you have to do handle all stubs specially and replace it with an equivalent object (equivalent for the replay of course):

========= %&lt; ===========
class Call {
...
    public Call(Method method, Object target, Object[] arguments, Object result) {
        this.method = method;
        this.target = normalize(target);
        if (arguments == null)
            this.arguments = null;
        else {
            this.arguments = new Object[arguments.length];
            for (int i = 0; i &lt; arguments.length; ++i)
                this.arguments[i] = normalize(arguments[i]);
        }
        this.object = normalize(object);
    }
    private Object normalize(Object object) {
        if (!(object instanceof EJBObject)) {
            return object;
        }
        Class[] ifaces = object.getClass().getInterfaces();
        return Proxy.newProxyInstance(Thread.currentThread().getContextClassloader(), ifaces, new InvocationHandler() {
            Object invoke(Objetc proxy, Method method, Object[] args) {
                throw IllegalStateException("Should not have been called in replay");
            }
        })
    }
...
}
========= %&lt; ===========

That way, you create an own replacement object for the stubs that does not contain app server specific stuff and that can be serialized quite easily.

- Jörg

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Jörg Schaible</dc:creator>
    <dc:date>2008-12-01T10:52:16</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5323">
    <title>How to use XSTream to persist a Graph Object??</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5323</link>
    <description>
Hello sir:
I hope to use XStream to persist a Graph object as following example I
googled in website:

1. main program:

import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import javax.swing.*;
import javax.swing.event.*;
 
public class Location extends JPanel implements ChangeListener
{
    Ellipse2D.Double ball;
    Line2D.Double    line;
    JSlider          translate;
    double           lastTheta = 0;
 
    public void stateChanged(ChangeEvent e)
    {
        JSlider slider = (JSlider)e.getSource();
        String name = slider.getName();
        int value = slider.getValue();
        if(name.equals("rotation"))
            tilt(Math.toRadians(value));
        else if(name.equals("translate"))
            moveBall(value);
        repaint();
    }
 
    protected void paintComponent(Graphics g)
    {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D)g;
        g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                            RenderingHints.VALUE_ANTIALIAS_ON);
        if(ball == null)
            initGeom();
        g2.setPaint(Color.green.darker());
        g2.draw(line);
        g2.setPaint(Color.red);
        g2.fill(ball);
    }
 
    private void initGeom()
    {
        int w = getWidth();
        int h = getHeight();
        int DIA = 30;
        int padFromEnd = 5;
        line = new Line2D.Double(w/4, h*15/16, w*3/4, h*15/16);
        double x = line.x2 - padFromEnd - DIA;
        double y = line.y2 - DIA;
        ball = new Ellipse2D.Double(x, y, DIA, DIA);
        // update translate slider values
        int max = (int)line.getP1().distance(line.getP2());
        translate.setMaximum(max);
        translate.setValue(max-padFromEnd);
    }
 
    private void tilt(double theta)
    {
        // rotate line from left end
        Point2D pivot = line.getP1();
        double lineLength = pivot.distance(line.getP2());
        Point2D.Double p2 = new Point2D.Double();
        p2.x = pivot.getX() + lineLength*Math.cos(theta);
        p2.y = pivot.getY() + lineLength*Math.sin(theta);
        line.setLine(pivot, p2);
 
        // find angle from pivot to ball center relative to line
        // ie, ball center -&gt; pivot -&gt; line end
        double cx = ball.getCenterX();
        double cy = ball.getCenterY();
        double pivotToCenter = pivot.distance(cx, cy);
        // angle of ball to horizon
        double dy = cy - pivot.getY();
        double dx = cx - pivot.getX();
        // relative angle phi = ball_to_horizon - last line_to_horizon
        double phi = Math.atan2(dy, dx) - lastTheta;
        // rotate ball from pivot
        double x = pivot.getX() + pivotToCenter*Math.cos(theta+phi);
        double y = pivot.getY() + pivotToCenter*Math.sin(theta+phi);
        ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
        lastTheta = theta;  // save theta for next time
    }
 
    private void moveBall(int distance)
    {
        Point2D pivot = line.getP1();
        // ball touches line at distance from pivot
        double contactX = pivot.getX() + distance*Math.cos(lastTheta);
        double contactY = pivot.getY() + distance*Math.sin(lastTheta);
        // find new center location of ball
        // angle lambda = lastTheta - 90 degrees (anti-clockwise)
        double lambda = lastTheta - Math.PI/2;
        double x = contactX + (ball.width/2)*Math.cos(lambda);
        double y = contactY + (ball.height/2)*Math.sin(lambda);
        ball.setFrameFromCenter(x, y, x+ball.width/2, y+ball.height/2);
    }
 
    JPanel getControls()
    {
        JSlider rotate = getSlider("rotation angle", "rotation", -90, 0, 0,
5, 15);
        translate = getSlider("distance from end",  "translate", 0, 100,
100,25, 50);
        JPanel panel = new JPanel(new GridLayout(0,1));
        panel.add(rotate);
        panel.add(translate);
        return panel;
    }
 
    private JSlider getSlider(String title, String name, int min, int max,
                              int value, int minorSpace, int majorSpace)
    {
        JSlider slider = new JSlider(JSlider.HORIZONTAL, min, max, value);
        slider.setBorder(BorderFactory.createTitledBorder(title));
        slider.setName(name);
        slider.setPaintTicks(true);
        slider.setMinorTickSpacing(minorSpace);
        slider.setMajorTickSpacing(majorSpace);
        slider.setPaintLabels(true);
        slider.addChangeListener(this);
        return slider;
    }
 
    public static void main(String[] args)
    {
        Location test = new Location();
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(test);
        f.getContentPane().add(test.getControls(), "Last");
        f.setSize(400,400);
        f.setLocation(200,200);
        f.setVisible(true);
    }
}


OK, 
1. I hope After I run it, I made some changes on the picture such as:
rotation angle is -45 degree; Distance from the end is 100;
I hope to save this CURRENT state into an XML file and save it to disk;
2. then next time I open it, I can read this XML file from disk, and recover
whole picture I saved before: rotation angle is -45 degree; Distance from
the end is 100;

How to use XStream to do this??


Thanks

</description>
    <dc:creator>sunnymanman</dc:creator>
    <dc:date>2008-12-01T03:38:10</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5322">
    <title>RE: Custom Mapper</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5322</link>
    <description>Hi Calvin, 

Wu, Calvin (Technology) wrote on Friday, November 28, 2008 12:51 PM:

Mappers and converters are fundamental different things. Since your question imply some lack of understanding (no offence, we do *not* encourage own mappers in first place - it is more like last resort), I'd like to know first, why you think you need a custom mapper?


- Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Jörg Schaible</dc:creator>
    <dc:date>2008-11-28T12:10:52</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5321">
    <title>Custom Mapper</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5321</link>
    <description>How do you add a custom mapper to xstream object?  Is this only possible
via adding a custom converter?  Code examples will be much appreciated.

Thanks,



</description>
    <dc:creator>Wu, Calvin (Technology</dc:creator>
    <dc:date>2008-11-28T11:51:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.java.xstream.user/5320">
    <title>RE: CannotResolveClassException in java 1.6</title>
    <link>http://permalink.gmane.org/gmane.comp.java.xstream.user/5320</link>
    <description>Hi Calvin,

Calvin Wu wrote:

This is a changed behaviour in JDK 6.


Yes, http://jira.codehaus.org/browse/XSTR-447

- Jörg

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



</description>
    <dc:creator>Jörg Schaible</dc:creator>
    <dc:date>2008-11-28T07:34:37</dc:date>
  </item>
  <textinput about="http://search.gmane.org/?group=$group=gmane.comp.java.xstream.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.java.xstream.user</link>
  </textinput>
</rdf:RDF>
