bom dia pessoal....
to com um probleminha em xstream aqui....
estou fazendo um aplicativo que lê um .xml fornecido por outro aplicativo... tenho q criar uma lista de uma determinada tag, pois ela aparece n vezes no .xml, até ai blz... só que está tag que eu tive que criar a lista possui outras tags filhas... ai ta dando o seguinte erro...
Exception in thread "main" com.thoughtworks.xstream.converters.ConversionException: Element prod of type entity.prod is not defined as field in type java.lang.Object
---- Debugging information ----
class : entity.NFe
required-type : java.lang.Object
path : /NFe/infNFe/det/prod
line number : 1
-------------------------------
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.writeValueToImplicitCollection(AbstractReflectionConverter.java:283)
at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:236)
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.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:225)
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.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(AbstractReflection
Converter.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 DAO.LerXML.leXML(LerXML.java:24)
at DAO.EdNFe.main(EdNFe.java:11)
Java Result: 1
a estrutura do meu xml até onde da o erro é a seguinte.... a tag que eu criei a lista é a
<?xml version="1.0" encoding="utf-8" ?>
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
- <infNFe xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="NFe31090125338930000180550000000003720000396099" versao="1.10">
+ <ide>
<cUF>31</cUF>
<cNF>000039609</cNF>
<natOp>VENDAS ESTADUAIS</natOp>
<indPag>0</indPag>
<mod>55</mod>
<serie>0</serie>
<nNF>372</nNF>
<dEmi>2009-01-22</dEmi>
<dSaiEnt>2009-01-22</dSaiEnt>
<tpNF>1</tpNF>
<cMunFG>0000000</cMunFG>
<tpImp>1</tpImp>
<tpEmis>1</tpEmis>
<cDV>9</cDV>
<tpAmb>2</tpAmb>
<finNFe>1</finNFe>
<procEmi>0</procEmi>
<verProc>1.10</verProc>
</ide>
+ <emit>
<CNPJ>25338930000180</CNPJ>
<xNome>CASA AGRICOLA COMERCIO LTDA</xNome>
<xFant>CASA AGRICOLA</xFant>
- <enderEmit>
<xLgr>R ARTIMENIO PIVA TONELLI</xLgr>
<nro>90</nro>
<xBairro>VILA LICINIO</xBairro>
<cMun>3126109</cMun>
<xMun>FORMIGA</xMun>
<UF>MG</UF>
<CEP>35570000</CEP>
<cPais>1058</cPais>
<xPais>BRASIL</xPais>
<fone>[telefone removido]</fone>
</enderEmit>
<IE>2615324490001</IE>
</emit>
+ <dest>
<xNome>ACCUSHOP COMERCIAL DE MATERIAIS</xNome>
- <enderDest>
<xLgr>RUA PADRE REMACLO FOXIUS, 329</xLgr>
<nro>, 329</nro>
<xBairro>CENTENARIO</xBairro>
<cMun>3126109</cMun>
<xMun>FORMIGA</xMun>
<UF>MG</UF>
<CEP>35570000</CEP>
<cPais>1058</cPais>
<xPais>BRASIL</xPais>
</enderDest>
<IE />
</dest>
- <det nItem="1">
- <prod>
<cProd>00001</cProd>
<cEAN>0000000000017</cEAN>
<xProd>Produto 1</xProd>
<CFOP>5102</CFOP>
<uCom>FR</uCom>
<qCom>1.0000</qCom>
<vUnCom>200.0000</vUnCom>
<vProd>200.00</vProd>
<cEANTrib />
<uTrib>0</uTrib>
<qTrib>0.0000</qTrib>
<vUnTrib>0.0000</vUnTrib>
</prod>
- <imposto>
- <ICMS>
- <ICMS00>
<orig>0</orig>
<CST>00</CST>
<modBC>0</modBC>
<vBC>200.00</vBC>
<pICMS>18.00</pICMS>
<vICMS>36.00</vICMS>
</ICMS00>
</ICMS>
- <PIS>
- <PISNT>
<CST>06</CST>
</PISNT>
</PIS>
- <COFINS>
- <COFINSNT>
<CST>06</CST>
</COFINSNT>
</COFINS>
</imposto>
</det>
- <det nItem="2">
- <prod>
<cProd>00002</cProd>
<cEAN>0000000000024</cEAN>
<xProd>produto 2</xProd>
<CFOP>5102</CFOP>
<uCom>FR</uCom>
<qCom>1.0000</qCom>
<vUnCom>300.0000</vUnCom>
<vProd>300.00</vProd>
<cEANTrib />
<uTrib>0</uTrib>
<qTrib>0.0000</qTrib>
<vUnTrib>0.0000</vUnTrib>
</prod>
- <imposto>
- <ICMS>
- <ICMS60>
<orig>0</orig>
<CST>60</CST>
<vBCST>0.00</vBCST>
<vICMSST>0.00</vICMSST>
</ICMS60>
</ICMS>
- <PIS>
- <PISNT>
<CST>06</CST>
</PISNT>
</PIS>
- <COFINS>
- <COFINSNT>
<CST>06</CST>
</COFINSNT>
</COFINS>
</imposto>
</det>
se alguem puder me dar um help ai....
vlw....