brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-489) Rebind error (on windows): "Invalid byte 1 of 1-byte UTF-8 sequence"
Date Tue, 25 Apr 2017 19:29:04 GMT

    [ https://issues.apache.org/jira/browse/BROOKLYN-489?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15983484#comment-15983484
] 

ASF GitHub Bot commented on BROOKLYN-489:
-----------------------------------------

GitHub user aledsage opened a pull request:

    https://github.com/apache/brooklyn-server/pull/652

    BROOKLYN-489: Fix XmlUtil.xpath character encoding

    Be explicit to use UTF_8. Otherwise, on some environments (e.g. windows?) it could use
a different encoding.
    
    See https://issues.apache.org/jira/browse/BROOKLYN-489
    
    However, I'm struggling to test this. For @iyovcheva, the `XmlUtilTest` passed in her
IDE. This included when we created another little test there to read the persisted state file
that was failing (`qf4zems55y`, and call `XmlUtil.xpath`). Maybe there's something different
about the character encodings when running brooklyn in karaf, versus in the IDE?!
    
    I also tried reproducing by changing `parent/pom.xml`, the `maven-surefire-plugin` configuration
to include `-Dfile.encoding=ISO-8859-1`. I then ran `mvn test -Dtest=XmlUtilTest -Dfile.encoding=ISO-8859-1`.
I confirmed that `Charset.defaultCharset()` writes out `ISO-8859-1`, but the tests still passed
even without the change in this PR.
    
    ---
    Even though I can't reproduce, I think it's worth including the fix. Looking at the code,
it's clearly wrong to not specify the character encoding.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/brooklyn-server BROOKLYN-489

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/brooklyn-server/pull/652.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #652
    
----
commit 371e7178e2501887e7d9820f3f05ff396bff00f3
Author: Aled Sage <aled.sage@gmail.com>
Date:   2017-04-25T19:22:16Z

    BROOKLYN-489: Fix XmlUtil.xpath character encoding
    
    Be explicit to use UTF_8. Otherwise, on some environments 
    (e.g. windows?) it could use a different encoding

----


> Rebind error (on windows): "Invalid byte 1 of 1-byte UTF-8 sequence"
> --------------------------------------------------------------------
>
>                 Key: BROOKLYN-489
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-489
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>
> When testing rebind with Brooklyn 0.11.0-rc2, Ivana hit the exception shown below.
> She was running Brooklyn on Windows.
> {noformat}
> 2017-04-25 09:44:07,263 WARN  120 o.a.b.c.m.r.RebindExceptionHandlerImpl [ooklyn-persister]
Rebind: continuing after problem loading memento: memento qf4zems55y loading raw error
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.
> 	at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:79)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:62)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpathHandlingIllegalChars(XmlUtil.java:95)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$2.visit(BrooklynMementoPersisterToObjectStore.java:298)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$1VisitorWrapper.run(BrooklynMementoPersisterToObjectStore.java:454)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
> 	at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
> Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.
> 	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:567)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1896)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1551)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2818)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)[:1.8.0_101]
> 	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)[:1.8.0_101]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:68)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	... 9 more
> 2017-04-25 09:44:07,263 WARN  120 o.a.b.c.m.r.RebindExceptionHandlerImpl [ooklyn-persister]
Rebind: continuing after problem loading memento: memento wd4dimlxkb loading raw error
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.
> 	at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:79)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:62)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpathHandlingIllegalChars(XmlUtil.java:95)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$2.visit(BrooklynMementoPersisterToObjectStore.java:298)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$1VisitorWrapper.run(BrooklynMementoPersisterToObjectStore.java:454)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
> 	at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
> Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.
> 	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:567)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1896)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1551)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2818)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)[:1.8.0_101]
> 	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)[:1.8.0_101]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:68)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	... 9 more
> 2017-04-25 09:44:07,824 WARN  120 o.a.b.c.m.r.RebindExceptionHandlerImpl [ooklyn-persister]
Rebind: continuing after problem loading memento: memento com.canopy.compose.blogengine_1.7
loading raw error
> org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.
> 	at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:79)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:62)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpathHandlingIllegalChars(XmlUtil.java:95)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$2.visit(BrooklynMementoPersisterToObjectStore.java:298)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at org.apache.brooklyn.core.mgmt.persist.BrooklynMementoPersisterToObjectStore$1VisitorWrapper.run(BrooklynMementoPersisterToObjectStore.java:454)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_101]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
> 	at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
> Caused by: com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.
> 	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:701)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:567)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1896)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1551)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2818)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:243)[:1.8.0_101]
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)[:1.8.0_101]
> 	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)[:1.8.0_101]
> 	at org.apache.brooklyn.util.core.xstream.XmlUtil.xpath(XmlUtil.java:68)[120:org.apache.brooklyn.core:0.11.0.20170420_1246]
> 	... 9 more
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message