java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence

nhsoft.yhw
stack error message:
java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.
        at org.apache.xerces.impl.io.UTF8Reader.invalidByte(Unknown Source)
        at org.apache.xerces.impl.io.UTF8Reader.read(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
        at org.apache.xerces.impl.XMLEntityScanner.scanContent(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanContent(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at java.util.XMLUtils.getLoadingDoc(XMLUtils.java:85)
        at java.util.XMLUtils.load(XMLUtils.java:57)
        at java.util.Properties.loadFromXML(Properties.java:852)
        at org.apache.wicket.util.io.Streams.loadFromXml(Streams.java:132)
        at org.apache.wicket.resource.XmlFilePropertiesLoader.loadJavaProperties(XmlFilePropertiesLoader.java:59)
        at org.apache.wicket.resource.PropertiesFactory.loadFromLoader(PropertiesFactory.java:218)
        at org.apache.wicket.resource.PropertiesFactory.load(PropertiesFactory.java:164)
        at org.apache.wicket.resource.loader.ComponentStringResourceLoader.loadStringResource(ComponentStringResourceLoader.java:142)
        at org.apache.wicket.resource.loader.ComponentStringResourceLoader.loadStringResource(ComponentStringResourceLoader.java:239)
        at org.apache.wicket.Localizer.getStringIgnoreSettings(Localizer.java:368)
        at org.apache.wicket.Localizer.getString(Localizer.java:201)
        at org.apache.wicket.Localizer.getString(Localizer.java:149)
        at org.apache.wicket.model.ResourceModel$AssignmentWrapper.getObject(ResourceModel.java:124)
        at org.apache.wicket.model.ResourceModel$AssignmentWrapper.getObject(ResourceModel.java:91)
        at org.apache.wicket.Component.getDefaultModelObject(Component.java:1644)
        at org.apache.wicket.Component.getDefaultModelObjectAsString(Component.java:1672)
        at org.apache.wicket.markup.html.form.Button.onComponentTag(Button.java:183)
        at org.apache.wicket.Component.internalRenderComponent(Component.java:2487)
        at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1576)
        at org.apache.wicket.Component.internalRender(Component.java:2346)
        at org.apache.wicket.Component.render(Component.java:2274)
        at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1474)
        at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1638)
        at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1613)
        at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:735)
        at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76)
        at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112)
        at org.apache.wicket.Component.internalRenderComponent(Component.java:2516)
        at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1576)
        at org.apache.wicket.Component.internalRender(Component.java:2346)
        at org.apache.wicket.Component.render(Component.java:2274)
        at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1474)
        at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1638)
        at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1613)
        at org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1567)
        at org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1604)
        at org.apache.wicket.markup.html.panel.DefaultMarkupSourcingStrategy.onComponentTagBody(DefaultMarkupSourcingStrategy.java:72)
        at org.apache.wicket.Component.internalRenderComponent(Component.java:2516)
        at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1576)
        at org.apache.wicket.Component.internalRender(Component.java:2346)
        at org.apache.wicket.Component.render(Component.java:2274)
        at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1474)
        at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1638)
        at org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1613)
        at org.apache.wicket.MarkupContainer.renderAssociatedMarkup(MarkupContainer.java:735)
        at org.apache.wicket.markup.html.panel.AssociatedMarkupSourcingStrategy.renderAssociatedMarkup(AssociatedMarkupSourcingStrategy.java:76)
        at org.apache.wicket.markup.html.panel.PanelMarkupSourcingStrategy.onComponentTagBody(PanelMarkupSourcingStrategy.java:112)
        at org.apache.wicket.Component.internalRenderComponent(Component.java:2516)
        at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1576)
        at org.apache.wicket.Component.internalRender(Component.java:2346)
        at org.apache.wicket.Component.render(Component.java:2274)
        at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1474)
        at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1638)
        at org.apache.wicket.Page.onRender(Page.java:904)
        at org.apache.wicket.markup.html.WebPage.onRender(WebPage.java:140)
        at org.apache.wicket.Component.internalRender(Component.java:2346)
        at org.apache.wicket.Component.render(Component.java:2274)
        at org.apache.wicket.Page.renderPage(Page.java:1035)
        at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105)
        at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:182)
        at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167)
        at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
        at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
        at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
        at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
        at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
        at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
        at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:399)
        at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
        at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
        at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411)
        at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:188)
        at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:303)
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:183)
        at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:169)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:311)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)


i found that there has some chinese word break in Wizard_zh_CN.properties.xml file, i open Wizard_zh_CN.properties.xml in notpad++, some chinese word does not display properly,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
        <entry key="org.apache.wicket.extensions.wizard.next">下一步</entry>
        <entry key="org.apache.wicket.extensions.wizard.previous">上一步</entry>
        <entry key="org.apache.wicket.extensions.wizard.last">最忎</entry>
        <entry key="org.apache.wicket.extensions.wizard.cancel">忖消</entry>
        <entry key="org.apache.wicket.extensions.wizard.finish">结濟</entry>

        <entry key="org.apache.wicket.extensions.wizard.NextButton.step.did.not.complete">无法执行下一步</entry>
        <entry key="org.apache.wicket.extensions.wizard.FinishButton.step.did.not.complete">无法执行最忎一步</entry>
</properties>


Fixed does not display properly 's Chinese characters in Wizard_zh_CN.properties.xml file,  rebuild wicket jar file, it can be used normally.
my first wicket application: www.118114life.com
Reply | Threaded
Open this post in threaded view
|

Re: java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence

nhsoft.yhw
upload fixed two properties file
Wizard_zh_CN.properties.xml
Wizard_zh_TW.properties.xml
my first wicket application: www.118114life.com