Hi Jorg,
Thanks a lot-- that helped!
Just for reference I fixed my problem by not using auto-detect mode, and
explicitly calling processAnnotations.
Jason
On 1/25/14, 7:06 AM, Jörg Schaible wrote:
> Hi Jason,
>
> Jason Novotny wrote:
>
>> Hi,
>>
>> I'm having an extreely strange problem where I run a unit test on my Mac
>> that works fine but the identical code on a linux server produces an
>> xstream related error:
>>
>>
>> testInrixAuthentication(XXXX.service.inrix.InrixServiceTest): Could not
>> read [class XXXX.service.inrix.auth.InrixGetSecurityTokenResponse];
>> nested exception is
>> org.springframework.oxm.UnmarshallingFailureException: XStream
>> unmarshalling exception; nested exception is
>> com.thoughtworks.xstream.mapper.CannotResolveClassException: Inrix
> This simply tells you, that XStream cannot find any class named "Inrix" in
> the default package.
>
>> Basically I'm trying to serialize the XML into an Object and was using
>> annotations so the class looks like:
>>
>> @XStreamAlias("Inrix")
>> public class InrixGetSecurityTokenResponse {
>>
>> @XStreamAlias("AuthResponse")
>> private InrixAuthResponse authResponse;
>>
>> public InrixAuthResponse getAuthResponse() {
>> return authResponse;
>> }
>>
>> public void setAuthResponse(InrixAuthResponse authResponse) {
>> this.authResponse = authResponse;
>> }
>>
>> }
> It depends how your XStream was set up. By default, at deserialization time,
> XStream simple gets an XML element "Inrix" - how should it know, that
> there's somewhere a class with an alias annotation?
>
>> I just can't understand why it works on one machine but not another-- I
>> do understand that in using maven to build, the class listed above is
>> contained in my project jar file, while the test that calls it lives in
>> test-classes directory, so maybe there is some issue with the
>> classloader of the test class needing the classloader of the jar
>> containing my annotated POJOs, but this doesn't seem to explain why it
>> works on one machine but not the other....
>>
>> Any ideas on debugging this would be greatly helpful!
> Anything is explained here:
> http://xstream.codehaus.org/annotations-tutorial.html#AutoDetect
>
> Cheers,
> 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