org.xml.sax.SAXParseException: Unexpected token (position:TEXT )]}'{"conn": "mo...@1:10771 in java.io.InputStreamReader@4245c080)

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • In Ti.Network.HttpClient API this.responseText is truncated and incomplete in case of android while its complete in case of IOS. Please find the attached app.js and media.js to reproduce the same. Folowing error occurs: {code} E/V8Exception( 2937): Exception occurred at app.js:22: Uncaught TypeError: Cannot read property '0' of undefined E/XMLModule( 2937): (KrollRuntimeThread) [136,7131] Error parsing XML E/XMLModule( 2937): org.xml.sax.SAXParseException: Unexpected token (position:TEXT )]}'{"conn": "mo...@1:10771 in java.io.InputStreamReader@4245c080) E/XMLModule( 2937): at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) E/XMLModule( 2937): at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) E/XMLModule( 2937): at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) E/XMLModule( 2937): at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:624) E/XMLModule( 2937): at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:84) E/XMLModule( 2937): at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method) E/XMLModule( 2937): at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:58) E/XMLModule( 2937): at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:44) E/XMLModule( 2937): at org.appcelerator.kroll.runtime.v8.V8Function$1.run(V8Function.java:71) E/XMLModule( 2937): at android.os.Handler.handleCallback(Handler.java:615) E/XMLModule( 2937): at android.os.Handler.dispatchMessage(Handler.java:92) E/XMLModule( 2937): at android.os.Looper.loop(Looper.java:137) E/XMLModule( 2937): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109) E/TiHttpClient( 2937): (KrollRuntimeThread) [13,7144] Error parsing XML E/TiHttpClient( 2937): org.xml.sax.SAXParseException: Unexpected token (position:TEXT )]}'{"conn": "mo...@1:10771 in java.io.InputStreamReader@4245c080) E/TiHttpClient( 2937): at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) E/TiHttpClient( 2937): at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) E/TiHttpClient( 2937): at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) E/TiHttpClient( 2937): at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:624) E/TiHttpClient( 2937): at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:84) E/TiHttpClient( 2937): at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method) E/TiHttpClient( 2937): at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:58) E/TiHttpClient( 2937): at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:44) E/TiHttpClient( 2937): at org.appcelerator.kroll.runtime.v8.V8Function$1.run(V8Function.java:71) E/TiHttpClient( 2937): at android.os.Handler.handleCallback(Handler.java:615) E/TiHttpClient( 2937): at android.os.Handler.dispatchMessage(Handler.java:92) E/TiHttpClient( 2937): at android.os.Looper.loop(Looper.java:137) E/TiHttpClient( 2937): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109) {code}
    via by Rupesh Sharma,
  • Titanium - PHP+JSON error parsing
    via Stack Overflow by strano
    ,
  • Http requests on android against BasicAuth protected pages fail, when multiple requests are fired before the previous request is completed. I have created a sample project which allows you to send single http requests (x1) which will work and you can execute 10 requests (x10) in a row. The first 5 requests will be executed every 5 seconds, these requests will work as expected. From the sixth request on all remaining 5 requests get fired at once and cause an issue. Sample project: https://github.com/MichelBahl/AC-4446 *Hint:* I watched into network traffic with wireshark, I recognized that when I execute a BasicAuth request the android network module starts two http requests, the first without credentials, these requests ends up with an 401 error, the second one with credentials works as expected, maybe the issue I described is related to this flaw in the network module. *Error Message:* [ERROR] TiHTTPClient: (TiHttpClient-10) [66387,66387] HTTP Error (java.io.IOException): 401 : Access Denied [ERROR] TiHTTPClient: java.io.IOException: 401 : Access Denied [ERROR] TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1227) [ERROR] TiHTTPClient: at java.lang.Thread.run(Thread.java:818) [ERROR] TiHTTPClient: (TiHttpClient-12) [3,66390] HTTP Error (java.io.IOException): 401 : Access Denied [ERROR] TiHTTPClient: java.io.IOException: 401 : Access Denied [ERROR] TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1227) [ERROR] TiHTTPClient: at java.lang.Thread.run(Thread.java:818) [ERROR] XMLModule: (main) [3,66393] Error parsing XML [ERROR] XMLModule: org.xml.sax.SAXParseException: Unexpected token (position:TEXT You do not have ...@1:59 in java.io.InputStreamReader@e79ec62) [ERROR] XMLModule: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) [ERROR] XMLModule: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) [ERROR] XMLModule: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) [ERROR] XMLModule: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:68) [ERROR] XMLModule: at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:562) [ERROR] XMLModule: at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:129) [ERROR] XMLModule: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] XMLModule: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] XMLModule: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] XMLModule: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] XMLModule: at android.os.Looper.loop(Looper.java:148) [ERROR] XMLModule: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] XMLModule: at java.lang.reflect.Method.invoke(Native Method) [ERROR] XMLModule: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] XMLModule: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] TiHTTPClient: (main) [2,66395] Error parsing XML [ERROR] TiHTTPClient: org.xml.sax.SAXParseException: Unexpected token (position:TEXT You do not have ...@1:59 in java.io.InputStreamReader@e79ec62) [ERROR] TiHTTPClient: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) [ERROR] TiHTTPClient: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) [ERROR] TiHTTPClient: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) [ERROR] TiHTTPClient: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:68) [ERROR] TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:562) [ERROR] TiHTTPClient: at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:129) [ERROR] TiHTTPClient: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] TiHTTPClient: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] TiHTTPClient: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] TiHTTPClient: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] TiHTTPClient: at android.os.Looper.loop(Looper.java:148) [ERROR] TiHTTPClient: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] TiHTTPClient: at java.lang.reflect.Method.invoke(Native Method) [ERROR] TiHTTPClient: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] TiHTTPClient: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    via by Michael Bahl,
  • Http requests on android against BasicAuth protected pages fail, when multiple requests are fired before the previous request is completed. I have created a sample project which allows you to send single http requests (x1) which will work and you can execute 10 requests (x10) in a row. The first 5 requests will be executed every 5 seconds, these requests will work as expected. From the sixth request on all remaining 5 requests get fired at once and cause an issue. Sample project: https://github.com/MichelBahl/AC-4446 *Hint:* I watched into network traffic with wireshark, I recognized that when I execute a BasicAuth request the android network module starts two http requests, the first without credentials, these requests ends up with an 401 error, the second one with credentials works as expected, maybe the issue I described is related to this flaw in the network module. *Error Message:* [ERROR] TiHTTPClient: (TiHttpClient-10) [66387,66387] HTTP Error (java.io.IOException): 401 : Access Denied [ERROR] TiHTTPClient: java.io.IOException: 401 : Access Denied [ERROR] TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1227) [ERROR] TiHTTPClient: at java.lang.Thread.run(Thread.java:818) [ERROR] TiHTTPClient: (TiHttpClient-12) [3,66390] HTTP Error (java.io.IOException): 401 : Access Denied [ERROR] TiHTTPClient: java.io.IOException: 401 : Access Denied [ERROR] TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1227) [ERROR] TiHTTPClient: at java.lang.Thread.run(Thread.java:818) [ERROR] XMLModule: (main) [3,66393] Error parsing XML [ERROR] XMLModule: org.xml.sax.SAXParseException: Unexpected token (position:TEXT You do not have ...@1:59 in java.io.InputStreamReader@e79ec62) [ERROR] XMLModule: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) [ERROR] XMLModule: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) [ERROR] XMLModule: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) [ERROR] XMLModule: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:68) [ERROR] XMLModule: at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:562) [ERROR] XMLModule: at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:129) [ERROR] XMLModule: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] XMLModule: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] XMLModule: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] XMLModule: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] XMLModule: at android.os.Looper.loop(Looper.java:148) [ERROR] XMLModule: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] XMLModule: at java.lang.reflect.Method.invoke(Native Method) [ERROR] XMLModule: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] XMLModule: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] TiHTTPClient: (main) [2,66395] Error parsing XML [ERROR] TiHTTPClient: org.xml.sax.SAXParseException: Unexpected token (position:TEXT You do not have ...@1:59 in java.io.InputStreamReader@e79ec62) [ERROR] TiHTTPClient: at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) [ERROR] TiHTTPClient: at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) [ERROR] TiHTTPClient: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) [ERROR] TiHTTPClient: at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:68) [ERROR] TiHTTPClient: at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:562) [ERROR] TiHTTPClient: at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:129) [ERROR] TiHTTPClient: at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method) [ERROR] TiHTTPClient: at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:73) [ERROR] TiHTTPClient: at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1155) [ERROR] TiHTTPClient: at android.os.Handler.dispatchMessage(Handler.java:98) [ERROR] TiHTTPClient: at android.os.Looper.loop(Looper.java:148) [ERROR] TiHTTPClient: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] TiHTTPClient: at java.lang.reflect.Method.invoke(Native Method) [ERROR] TiHTTPClient: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] TiHTTPClient: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    via by Michael Bahl,
  • SAX parser flipping out
    via Stack Overflow by Razzor
    ,
    • org.xml.sax.SAXParseException: Unexpected token (position:TEXT )]}'{"conn": "mo...@1:10771 in java.io.InputStreamReader@4245c080) at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:146) at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:107) at ti.modules.titanium.xml.XMLModule.parse(XMLModule.java:82) at ti.modules.titanium.network.TiHTTPClient.getResponseXML(TiHTTPClient.java:624) at ti.modules.titanium.network.HTTPClientProxy.getResponseXML(HTTPClientProxy.java:84) at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method) at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:58) at org.appcelerator.kroll.runtime.v8.V8Function.call(V8Function.java:44) at org.appcelerator.kroll.runtime.v8.V8Function$1.run(V8Function.java:71) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:109)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    bmacedo
    bmacedo1 times, last one,
    5 more bugmates