[ 
https://issues.apache.org/jira/browse/JENA-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne updated JENA-1312:
--------------------------------
    Description: 
This is the raw bytes for a BOM - i.e. no UTF-8 encoded.  This report is not 
specific to this bad encoded data.

{noformat}
#!/bin/bash

DATA=$'PREFIX : <http://exmaple/> INSERT DATA { :s :p "abc\xFE\xFFxyz" }'

curl -XPOST \
     --header 'Content-type: application/sparql-update' \
     --data "$DATA" \
     http://localhost:3030/ds/update
{noformat}

With -v:
{noformat}
[2017-03-28 18:23:27] Fuseki     WARN  [2] Runtime IO Exception (client left?) 
RC = 500 : java.nio.charset.MalformedInputException: Input length = 1
org.apache.jena.atlas.RuntimeIOException: 
java.nio.charset.MalformedInputException: Input length = 1
        at org.apache.jena.atlas.io.IO.exception(IO.java:233)
        at 
org.apache.jena.fuseki.servlets.SPARQL_Update.executeBody(SPARQL_Update.java:183)
{noformat}
(this is in the verbose handling)

This causes a 500.

It is using a Java StreamDecoder. Decoding via, e.g, new String(bytes, UTF-8) 
works, no error. It is a different code path in the JDK.

Without "-v", a 204 response is generated (javacc converts the bytes to 
characters, not java).

  was:
{noformat}
#!/bin/bash

DATA=$'PREFIX : <http://exmaple/> INSERT DATA { :s :p "abc\xFE\xFFxyz" }'

curl -XPOST \
     --header 'Content-type: application/sparql-update' \
     --data "$DATA" \
     http://localhost:3030/ds/update
{noformat}

With -v:
{noformat}
[2017-03-28 18:23:27] Fuseki     WARN  [2] Runtime IO Exception (client left?) 
RC = 500 : java.nio.charset.MalformedInputException: Input length = 1
org.apache.jena.atlas.RuntimeIOException: 
java.nio.charset.MalformedInputException: Input length = 1
        at org.apache.jena.atlas.io.IO.exception(IO.java:233)
        at 
org.apache.jena.fuseki.servlets.SPARQL_Update.executeBody(SPARQL_Update.java:183)
{noformat}
(this is in the verbose handling)

This causes a 500.

Without "-v", a 204 response is generated (javacc converts the bytes to 
charcaters, not java).


> Bad UTF-8 string causes different behaviour between "fuseki -v" and "fuseki".
> -----------------------------------------------------------------------------
>
>                 Key: JENA-1312
>                 URL: https://issues.apache.org/jira/browse/JENA-1312
>             Project: Apache Jena
>          Issue Type: Bug
>            Reporter: Andy Seaborne
>
> This is the raw bytes for a BOM - i.e. no UTF-8 encoded.  This report is not 
> specific to this bad encoded data.
> {noformat}
> #!/bin/bash
> DATA=$'PREFIX : <http://exmaple/> INSERT DATA { :s :p "abc\xFE\xFFxyz" }'
> curl -XPOST \
>      --header 'Content-type: application/sparql-update' \
>      --data "$DATA" \
>      http://localhost:3030/ds/update
> {noformat}
> With -v:
> {noformat}
> [2017-03-28 18:23:27] Fuseki     WARN  [2] Runtime IO Exception (client 
> left?) RC = 500 : java.nio.charset.MalformedInputException: Input length = 1
> org.apache.jena.atlas.RuntimeIOException: 
> java.nio.charset.MalformedInputException: Input length = 1
>       at org.apache.jena.atlas.io.IO.exception(IO.java:233)
>       at 
> org.apache.jena.fuseki.servlets.SPARQL_Update.executeBody(SPARQL_Update.java:183)
> {noformat}
> (this is in the verbose handling)
> This causes a 500.
> It is using a Java StreamDecoder. Decoding via, e.g, new String(bytes, UTF-8) 
> works, no error. It is a different code path in the JDK.
> Without "-v", a 204 response is generated (javacc converts the bytes to 
> characters, not java).



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

Reply via email to