0

Page not found: because of Cyrillic symbol

asked 2018-05-28 18:27:14 +0800

everdelightedone gravatar image everdelightedone
111 4

updated 2018-05-28 21:18:01 +0800

Hello everybody! I got a legacy project (2016 year) with zul-pages. The problem is some pages issue "Page not found" with com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence (...stack trace follows). I found out that problem arises only on pages with "И" symbol (Cyrillic Capital Letter I, unicode code is U+0418). So, if I replace "И" with & # x0418; (without spaces) on .zul page - it works. It looks strange because all other Cyrillic symbols are working without any problems. Zk version is 7.0.3, Tomcat version 8.0.27, OS Windows 10 1803 build 17134.48 with russian locale. Every zul-page has <?xml version="1.0" encoding="UTF-8"?> as a first line. Is it a ZK framework bug?

delete flag offensive retag edit

13 Answers

Sort by » oldest newest most voted
0

answered 2018-06-29 14:50:52 +0800

everdelightedone gravatar image everdelightedone
111 4

Good to see you again! Thank you for your help!

Stack trace:

WARNING: Unable to load C:\Yuri\games\Java\projects1\ca\admin-web\war\target\central-admin-2.4.8-SNAPSHOT\zk\dictionary\bin-dictionary.zul

com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence. at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701) at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:372) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1895) at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1191) at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:858) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(XMLNSDocumentScannerImpl.java:447) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:250) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327) at javax.xml.parsers.SAXParser.parse(SAXParser.java:328) at org.zkoss.idom.input.SAXBuilder.build(SAXBuilder.java:298) at org.zkoss.zk.ui.metainfo.Parser.parse(Parser.java:99) at org.zkoss.zk.ui.metainfo.PageDefinitions$MyLoader.parse(PageDefinitions.java:209) ... Jun 29, 2018 9:13:38 AM org.zkoss.zk.ui.impl.UiEngineImpl handleError:1362 SEVERE: >>org.zkoss.zk.ui.UiException: Page not found: /zk/dictionary/bin-dictionary.zul at org.zkoss.zk.ui.http.ExecutionImpl.getPageDefinition(ExecutionImpl.java:375) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246) at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238) at org.zkoss.zul.Include.afterCompose(Include.java:450) at org.zkoss.zul.Include.applyChangesToContent(Include.java:345) at org.zkoss.zul.Include.fixMode(Include.java:327) at org.zkoss.zul.Include.setSrc(Include.java:280) at ru.mycompany.centraladmin.web.MenuComposer.doClick(MenuComposer.java:78) at ru.mycompany.centraladmin.web.MenuComposer.onClick(MenuComposer.java:57) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.zkoss.zk.ui.select.Selectors$ComposerEventListener.onEvent(Selectors.java:683) at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2743) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2714) at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2655) at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136) at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1720) at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1505) at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1215) at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:601) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:483) at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:492) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2503) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2492) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

Running an application from your post I get:

windows-1251 ���������������������������������������������������������������� АБВГДЕЖЗ�?ЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя ��������??������������������������������������������������������� ���������������������������������������������������������������� АБВГДЕЖЗ�?ЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя ��������??�������������������������������������������������������

I'm using java 1.8.0_171

link publish delete flag offensive edit
0

answered 2018-06-29 19:29:40 +0800

everdelightedone gravatar image everdelightedone
111 4

Replacing problem page content to index.zul from your link got the same error instead of opening page. Stack trace:

WARNING: Unable to load C:\Yuri\games\Java\projects1\ca\admin-web\war\target\central-admin-2.4.8-SNAPSHOT\zk\report\eventLog.zul

>>com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte UTF-8 sequence.
>>  at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701)
>>  at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:372)
>>  at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1895)
>>  at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1187)
>>  at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:858)
>>  at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(XMLNSDocumentScannerImpl.java:447)
>>  at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:250)
>>  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
>>  at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
>>  at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
>>  at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
>>  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
>>  at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
>>  at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
>>  at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
>>  at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
>>  at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
>>  at javax.xml.parsers.SAXParser.parse(SAXParser.java:328)
>>  at org.zkoss.idom.input.SAXBuilder.build(SAXBuilder.java:298)
>>  at org.zkoss.zk.ui.metainfo.Parser.parse(Parser.java:99)
>>  at org.zkoss.zk.ui.metainfo.PageDefinitions$MyLoader.parse(PageDefinitions.java:209)
>>...
Jun 29, 2018 2:09:55 PM org.zkoss.zk.ui.impl.UiEngineImpl handleError:1362
SEVERE: >>org.zkoss.zk.ui.UiException: Page not found: /zk/report/eventLog.zul
>>  at org.zkoss.zk.ui.http.ExecutionImpl.getPageDefinition(ExecutionImpl.java:375)
>>  at org.zkoss.zk.ui.impl.AbstractExecution.createComponents0(AbstractExecution.java:246)
>>  at org.zkoss.zk.ui.impl.AbstractExecution.createComponents(AbstractExecution.java:238)
>>  at org.zkoss.zul.Include.afterCompose(Include.java:450)
>>  at org.zkoss.zul.Include.applyChangesToContent(Include.java:345)
>>  at org.zkoss.zul.Include.fixMode(Include.java:327)
>>  at org.zkoss.zul.Include.setSrc(Include.java:280)
>>  at ru.mycompany.centraladmin.web.MenuComposer.doClick(MenuComposer.java:78)
>>  at ru.mycompany.centraladmin.web.MenuComposer.onClick(MenuComposer.java:57)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>  at java.lang.reflect.Method.invoke(Method.java:498)
>>  at org.zkoss.zk.ui.select.Selectors$ComposerEventListener.onEvent(Selectors.java:683)
>>  at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2743)
>>  at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2714)
>>  at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2655)
>>  at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>>  at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1720)
>>  at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1505)
>>  at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1215)
>>  at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:601)
>>  at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:483)
>>  at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:492)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>>  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
>>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>>  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
>>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>>  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
>>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:167)
>>  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
>>  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
>>  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
>>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
>>  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>>  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
>>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217)
>>  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
>>  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
>>  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
>>  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
>>  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
>>  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
>>  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518)
>>  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
>>  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
>>  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2503)
>>  at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2492)
>>  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>>  at java.lang.Thread.run(Thread.java:748)

Then I got rid of "И" and opened page again. Result:

initial
windows-1251

мя

So page has windows-1251 encoding for some reason. Looks like it's Netbeans's problem.

I opened problem .zul with Notepad++ and it looked OK. Then I opened the same .zul from netbeans generated source (from war/target folder) and got broken "И".

link publish delete flag offensive edit
0

answered 2018-06-29 20:47:10 +0800

everdelightedone gravatar image everdelightedone
111 4

Another reason could be is a maven configuration

link publish delete flag offensive edit

Comments

maven is well documented: here a related setting https://maven.apache.org/plugins/maven-resources-plugin/examples/encoding.html

cor3000 ( 2018-07-02 10:08:35 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2018-05-28 18:27:14 +0800

Seen: 24 times

Last updated: Jul 02 '18

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More