java.io.IOException: 401 : Access Denied

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.

  • 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,
  • 400 Bad Request
    via GitHub by puneetimpinge
    ,
  • GitHub comment 36#189918587
    via GitHub by cjadhav
    ,
  • I updated my app to 5.2.1.GA because I want to solve this problem on Android 4.0.x https://jira.appcelerator.org/browse/TIMOB-20564 In 5.2.1.GA the app works correctly on android 4.0.x but in the android versions > 4.0.x this error appear: {code:java} 04-11 09:33:10.152: E/TiExceptionHandler(16821): (main) [3148,24504] ----- Titanium Javascript Runtime Error ----- 04-11 09:33:10.152: E/TiExceptionHandler(16821): (main) [0,24504] - In undefined:5,8 04-11 09:33:10.152: E/TiExceptionHandler(16821): (main) [1,24505] - Message: Uncaught ReferenceError: $ is not defined 04-11 09:33:10.152: E/TiExceptionHandler(16821): (main) [1,24506] - Source: ((__t=($.noticiaDetail.fecha))==null?'':__t)+ 04-11 09:33:10.152: E/V8Exception(16821): Exception occurred at undefined:5: Uncaught ReferenceError: $ is not defined 04-11 09:33:10.182: E/TiHTTPClient(16821): (TiHttpClient-4) [16,24522] HTTP Error (java.io.IOException): 404 : Not Found 04-11 09:33:10.182: E/TiHTTPClient(16821): java.io.IOException: 404 : Not Found 04-11 09:33:10.182: E/TiHTTPClient(16821): at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1227) 04-11 09:33:10.182: E/TiHTTPClient(16821): at java.lang.Thread.run(Thread.java:841) 04-11 09:33:10.182: E/TiAPI(16821): 2016-4-11 9:33:10 | idDevice: 20:6E:9C:35:DF:65 | android (4.4.2) SM-G355HN | [10002] | undefined {code} This is my code: {code:java} <Model src="noticia" instance="true" id="noticiaDetail" /> <Label class="fechaLabel" id="fechaLabel" text="{$.noticiaDetail.fecha}"></Label> {code} When I test the app with Appcelerator Studio this error doesn't appear, but if you download the same version uploaded to the playstore the app doesn't work and this error appear. Please help me fast, my app is having very bad comments and I don't change any line of code respect my previous version, only the version of Ti SDK.
    via by Anna,
    • java.io.IOException: 401 : Access Denied at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1227) at java.lang.Thread.run(Thread.java:818)

    Users with the same issue

    gamebusterz
    gamebusterz1 times, last one,