Está acontecendo esse erro ao deserializar com o Restfulie…
O mais estranho é que esse erro acontece aleatoriamente. Ou seja, se eu executar 10 vezes o código, 5 vezes dá 100% certo e 5 vezes dá errado… não achei o que pode causar o erro.
E não achei outros casos desses no Google. Alguém já passou por isso?
Erro abaixo:
[code]Exception in thread “main” com.thoughtworks.xstream.converters.ConversionException: br.com.caelum.restfulie.HistoricoExclusoes_1324647397279: frozen class (cannot edit) : br.com.caelum.restfulie.HistoricoExclusoes_1324647397279: frozen class (cannot edit)
---- Debugging information ----
message : br.com.caelum.restfulie.HistoricoExclusoes_1324647397279: frozen class (cannot edit)
cause-exception : java.lang.RuntimeException
cause-message : br.com.caelum.restfulie.HistoricoExclusoes_1324647397279: frozen class (cannot edit)
class : br.com.cauirs.xxxx.entidades.Sincronizacoes
required-type : br.com.cauirs.xxxx.entidades.HistoricoExclusoes
path : /sincronizacoes/exclusoes/excluido[2]
line number : 27
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:68)
at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:61)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:246)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:218)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:845)
at br.com.caelum.restfulie.mediatype.XmlMediaType.unmarshal(XmlMediaType.java:73)
at br.com.caelum.restfulie.http.apache.ApacheResponse.getResource(ApacheResponse.java:60)
at br.com.cauirs.xxxx.sincronizador.Sincronizador.puxarDadosDoOnline(Sincronizador.java:33)
at br.com.cauirs.xxxx.sincronizador.Sincronizador.puxarDadosDoOnline(Sincronizador.java:25)
at Teste.main(Teste.java:27)
Caused by: java.lang.RuntimeException: br.com.caelum.restfulie.HistoricoExclusoes_1324647397279: frozen class (cannot edit)
at javassist.ClassPool.checkNotFrozen(ClassPool.java:568)
at javassist.ClassPool.makeClass(ClassPool.java:746)
at javassist.ClassPool.makeClass(ClassPool.java:731)
at br.com.caelum.restfulie.relation.Enhancer.enhanceResource(Enhancer.java:17)
at br.com.caelum.restfulie.mediatype.XStreamHelper$EnhancedLookupProvider.newInstance(XStreamHelper.java:35)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:308)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:161)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
… 27 more[/code]