Also, the full stack trace is:

org.springframework.http.converter.HttpMessageNotReadableException: Could not 
read [class com.foo.service.inrix.auth.InrixGetSecurityTokenResponse]; nested 
exception is org.springframework.oxm.UnmarshallingFailureException: XStream 
unmarshalling exception; nested exception is 
com.thoughtworks.xstream.mapper.CannotResolveClassException: Inrix
        at 
org.springframework.http.converter.xml.MarshallingHttpMessageConverter.readFromSource(MarshallingHttpMessageConverter.java:135)
        at 
org.springframework.http.converter.xml.AbstractXmlHttpMessageConverter.readInternal(AbstractXmlHttpMessageConverter.java:61)
        at 
org.springframework.http.converter.AbstractHttpMessageConverter.read(AbstractHttpMessageConverter.java:158)
        at 
org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:104)
        at 
org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:773)
        at 
org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:758)
        at 
org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:535)
        at 
org.springframework.web.client.RestTemplate.execute(RestTemplate.java:489)
        at 
org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:250)
        at com.foo.service.inrix.InrixService.authenticate(InrixService.java:70)
        at 
com.foo.service.inrix.InrixServiceTest.testInrixAuthentication(InrixServiceTest.java:35)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
        at 
org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
        at 
org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
        at 
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:232)
        at 
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:89)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at 
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at 
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at 
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:175)
        at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
        at 
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
        at 
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
        at 
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
        at 
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
        at 
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)



On 1/24/14, 6:04 PM, 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
>
> 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;
>     }
>
> }
>
>
> 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!
>
> Thanks, Jason
>
>
>

Reply via email to