guilherme.chapiewski 9 de jan. de 2007
Se você quer que esse atributo não apareça no XML você deve usar um Double ao ivés de double. Não se esqueça que atributos do tipo primitivo double são inicializados com 0.0 e terão este valor se você não especificar um.
Se você quiser que não apareça nada, use o wrapper de Double, que neste seu caso será null e não aparecerá no XML.
krlalunardi 9 de jan. de 2007
obrigadinha guilherme!
krlalunardi 17 de jan. de 2007
pessoal, qdo eu serializo um objeto em XML eu tenho o seguinte erro:
16 : 22 : 26 , 096 ERROR [ LogInterceptor ] TransactionRolledbackLocalException in method : public abstract void br . inf . portalfiscal . nfe . controller . FilaLocal . finalizarProcessamento ( br . inf . portalfiscal . nfe . model . FilaVO ) throws br . inf . portalfiscal . nfe . exception . NfeAplicacaoException , br . inf . portalfiscal . nfe . exception . NfeSessionFactoryException , java . lang . Exception , causedBy :
java . lang . NullPointerException
at br . inf . portalfiscal . nfe . converter . XmlnsConverter . toString ( XmlnsConverter . java : 20 )
at com . thoughtworks . xstream . converters . SingleValueConverterWrapper . toString ( SingleValueConverterWrapper . java : 27 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 1. visit ( AbstractReflectionConverter . java : 56 )
at com . thoughtworks . xstream . converters . reflection . PureJavaReflectionProvider . visitSerializableFields ( PureJavaReflectionProvider . java : 109 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . doMarshal ( AbstractReflectionConverter . java : 49 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . marshal ( AbstractReflectionConverter . java : 41 )
at com . thoughtworks . xstream . core . AbstractReferenceMarshaller . convert ( AbstractReferenceMarshaller . java : 59 )
at com . thoughtworks . xstream . core . TreeMarshaller . convertAnother ( TreeMarshaller . java : 50 )
at com . thoughtworks . xstream . annotations . AnnotationReflectionConverter . marshallField ( AnnotationReflectionConverter . java : 37 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 2. writeField ( AbstractReflectionConverter . java : 105 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 2. visit ( AbstractReflectionConverter . java : 81 )
at com . thoughtworks . xstream . converters . reflection . PureJavaReflectionProvider . visitSerializableFields ( PureJavaReflectionProvider . java : 109 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . doMarshal ( AbstractReflectionConverter . java : 66 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . marshal ( AbstractReflectionConverter . java : 41 )
at com . thoughtworks . xstream . core . AbstractReferenceMarshaller . convert ( AbstractReferenceMarshaller . java : 59 )
at com . thoughtworks . xstream . core . TreeMarshaller . convertAnother ( TreeMarshaller . java : 50 )
at com . thoughtworks . xstream . annotations . AnnotationReflectionConverter . marshallField ( AnnotationReflectionConverter . java : 37 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 2. writeField ( AbstractReflectionConverter . java : 105 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 2. visit ( AbstractReflectionConverter . java : 81 )
at com . thoughtworks . xstream . converters . reflection . PureJavaReflectionProvider . visitSerializableFields ( PureJavaReflectionProvider . java : 109 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . doMarshal ( AbstractReflectionConverter . java : 66 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . marshal ( AbstractReflectionConverter . java : 41 )
at com . thoughtworks . xstream . core . AbstractReferenceMarshaller . convert ( AbstractReferenceMarshaller . java : 59 )
at com . thoughtworks . xstream . core . TreeMarshaller . convertAnother ( TreeMarshaller . java : 50 )
at com . thoughtworks . xstream . annotations . AnnotationReflectionConverter . marshallField ( AnnotationReflectionConverter . java : 37 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 2. writeField ( AbstractReflectionConverter . java : 105 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter $ 2. visit ( AbstractReflectionConverter . java : 81 )
at com . thoughtworks . xstream . converters . reflection . PureJavaReflectionProvider . visitSerializableFields ( PureJavaReflectionProvider . java : 109 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . doMarshal ( AbstractReflectionConverter . java : 66 )
at com . thoughtworks . xstream . converters . reflection . AbstractReflectionConverter . marshal ( AbstractReflectionConverter . java : 41 )
at com . thoughtworks . xstream . core . AbstractReferenceMarshaller . convert ( AbstractReferenceMarshaller . java : 59 )
at com . thoughtworks . xstream . core . TreeMarshaller . convertAnother ( TreeMarshaller . java : 50 )
at com . thoughtworks . xstream . core . TreeMarshaller . start ( TreeMarshaller . java : 73 )
at com . thoughtworks . xstream . core . ReferenceByXPathMarshallingStrategy . marshal ( ReferenceByXPathMarshallingStrategy . java : 34 )
at com . thoughtworks . xstream . XStream . marshal ( XStream . java : 745 )
at com . thoughtworks . xstream . XStream . marshal ( XStream . java : 734 )
at com . thoughtworks . xstream . XStream . toXML ( XStream . java : 715 )
at com . thoughtworks . xstream . XStream . toXML ( XStream . java : 705 )
eu posso dizer q seria pq o xstream tenta achar um elemento, ou seja um atributo na classe, e não o encontra ?
alguma ideia?