Buenos días,
Me he encontrado un problema que no consigo solucionar. He estado buscando información por Internet, pero parece que a nadie le pasa lo mismo.
Mediante el jaxb, defino un esquema de XML, en este pongo un atributo de tipo "xsd:string", el problema llega cuando recibo la cadena "ÍNDICE". Al parecer el hecho que haya una mayúscula con acento provoca el error que muestro a continuación:
javax.xml.bind.UnmarshalException
- with linked exception:
[com.sun.org.apache.xerces.internal.impl.io.Malform edByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.]
at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:213)
at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal(UnmarshallerImpl.java:184)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(AbstractUnmarshallerImpl.java:137)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(AbstractUnmarshallerImpl.java:184)
at org.me.ParsejaICreaFitxers.ParsejaICreaFitxer.comp rovaSegueixiXMLSchemaICreaClasses(ParsejaICreaFitx er.java:343)
at org.me.ParsejaICreaFitxers.ParsejaICreaFitxer.pars ejaICreaFitxer(ParsejaICreaFitxer.java:142)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.security.application.EJBSecurit yManager.runMethod(EJBSecurityManager.java:1067)
at com.sun.enterprise.security.SecurityUtil.invoke(Se curityUtil.java:176)
at com.sun.ejb.containers.BaseContainer.invokeTargetB eanMethod(BaseContainer.java:2895)
at com.sun.ejb.containers.BaseContainer.intercept(Bas eContainer.java:3986)
at com.sun.ejb.containers.WebServiceInvocationHandler .invoke(WebServiceInvocationHandler.java:189)
at $Proxy142.parsejaICreaFitxer(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.webservice.InvokerImpl.invoke(I nvokerImpl.java:81)
at com.sun.enterprise.webservice.EjbInvokerImpl.invok e(EjbInvokerImpl.java:88)
at com.sun.xml.ws.server.InvokerTube$2.invoke(Invoker Tube.java:146)
at com.sun.xml.ws.server.sei.EndpointMethodHandler.in voke(EndpointMethodHandler.java:257)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRe quest(SEIInvokerTube.java:93)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:5 95)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:55 4)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539 )
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:4 36)
at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.pr ocess(AbstractTubeImpl.java:106)
at com.sun.enterprise.webservice.MonitoringPipe.proce ss(MonitoringPipe.java:147)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.process Request(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:5 95)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:55 4)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539 )
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:4 36)
at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.pr ocess(AbstractTubeImpl.java:106)
at com.sun.xml.ws.tx.service.TxServerPipe.process(TxS erverPipe.java:317)
at com.sun.enterprise.webservice.CommonServerSecurity Pipe.processRequest(CommonServerSecurityPipe.java: 218)
at com.sun.enterprise.webservice.CommonServerSecurity Pipe.process(CommonServerSecurityPipe.java:129)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.process Request(PipeAdapter.java:115)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:5 95)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:55 4)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539 )
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:4 36)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSE ndpointImpl.java:243)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpTool kit.handle(HttpAdapter.java:444)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(H ttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapt er.handle(ServletAdapter.java:135)
at com.sun.enterprise.webservice.Ejb3MessageDispatche r.handlePost(Ejb3MessageDispatcher.java:113)
at com.sun.enterprise.webservice.Ejb3MessageDispatche r.invoke(Ejb3MessageDispatcher.java:87)
at com.sun.enterprise.webservice.EjbWebServiceServlet .dispatchToEjbEndpoint(EjbWebServiceServlet.java:2 00)
at com.sun.enterprise.webservice.EjbWebServiceServlet .service(EjbWebServiceServlet.java:129)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:831)
at com.sun.enterprise.web.AdHocContextValve.invoke(Ad HocContextValve.java:114)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:571)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipel ine.java:87)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:206)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:1080)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:150)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:632)
at org.apache.catalina.core.StandardPipeline.doInvoke (StandardPipeline.java:577)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:270)
at com.sun.enterprise.web.connector.grizzly.DefaultPr ocessorTask.invokeAdapter(DefaultProcessorTask.jav a:637)
at com.sun.enterprise.web.connector.grizzly.DefaultPr ocessorTask.doProcess(DefaultProcessorTask.java:56 8)
at com.sun.enterprise.web.connector.grizzly.DefaultPr ocessorTask.process(DefaultProcessorTask.java:813)
at com.sun.enterprise.web.connector.grizzly.DefaultRe adTask.executeProcessorTask(DefaultReadTask.java:3 39)
at com.sun.enterprise.web.connector.grizzly.DefaultRe adTask.doTask(DefaultReadTask.java:261)
at com.sun.enterprise.web.connector.grizzly.DefaultRe adTask.doTask(DefaultReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase. run(TaskBase.java:265)
at com.sun.enterprise.web.connector.grizzly.ssl.SSLWo rkerThread.run(SSLWorkerThread.java:106)
Caused by: com.sun.org.apache.xerces.internal.impl.io.Malform edByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.impl.io.UTF8Rea der.invalidByte(UTF8Reader.java:674)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Rea der.read(UTF8Reader.java:362)
at com.sun.org.apache.xerces.internal.impl.XMLEntityS canner.load(XMLEntityScanner.java:1742)
at com.sun.org.apache.xerces.internal.impl.XMLEntityS canner.skipChar(XMLEntityScanner.java:1416)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl$FragmentContentDriver.next(XM LDocumentFragmentScannerImpl.java:2777)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tScannerImpl.next(XMLDocumentScannerImpl.java:645)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocum entScannerImpl.next(XMLNSDocumentScannerImpl.java: 140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImpl.scanDocument(XMLDocumentFragm entScannerImpl.java:508)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserI mpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:211)
... 77 more
The log message is null.
He probado cambiando la mayuscula por una minuscula y entonces, ningún problema. También he probado la mayuscula sin acento y entonces perfecto.
Puede ayudarme alguien? A alguien le ha pasado algo similar?
Gracias por adelantado,