java.net.ConnectException: invalid.url/62.157.140.133:443 - Connection refused

Appcelerator JIRA | Markus Krug | 5 years ago
  1. 0

    h2. Problem On Android, the error event is only triggered once if an image is not accessible. On iOS, it triggers the error event each time. Which is better in my opinion. h2. Test case {code:title=app.js|borderStyle=solid} var win = Ti.UI.createWindow({backgroundColor: 'white'}); win.open(); function createImageView (params) { var imageView = Ti.UI.createImageView(params); imageView.addEventListener('load', function (event) { Ti.API.info('load event'); }); imageView.addEventListener('error', function (event) { Ti.API.info('error event'); }); return imageView; } Ti.API.info('loading first image'); win.add(createImageView({image: 'https://invalid.url/doesnotexist.png', width: 200, height: 100, top: 50})); setTimeout(function () { Ti.API.info('loading second image'); win.add(createImageView({image: 'https://invalid.url/doesnotexist.png', width: 200, height: 100, top: 150})); }, 2000); {code} When executing this code, you'll notice that the {{error event}} is just displayed once in error log. The {{load event}} is never triggered. On iOS the {{error event}} is triggered twice. This is especially inappropriate if the image is not available for just a short time. On the next app start the {{error event}} is also not triggered since it is cached. It should try to reload the image. h2. Community Discussion Q&A [Android Parity: ImageView triggers error event only once|http://developer.appcelerator.com/question/135037/android-parity-imageview-triggers-error-event-only-once] I've also explained why I need the error event. h2. Log {code} D/TiAssetHelper( 410): Fetching "app.js" with Fastdev... I/TiAPI ( 410): loading first image D/dalvikvm( 410): GC_EXTERNAL_ALLOC freed 537K, 53% free 2895K/6087K, external 1967K/2137K, paused 159ms I/TiRootActivity( 410): (main) [0,0] checkpoint, on root activity resume. activity = de.test.mobile.TestMobileActivity@405a4498 D/dalvikvm( 410): GREF has increased to 201 E/TiDownloadManager( 410): (pool-3-thread-1) [31,31] Exception downloading https://invalid.url/doesnotexist1.png E/TiDownloadManager( 410): java.net.ConnectException: invalid.url/62.157.140.133:443 - Connection refused E/TiDownloadManager( 410): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:207) E/TiDownloadManager( 410): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437) E/TiDownloadManager( 410): at java.net.Socket.connect(Socket.java:983) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:74) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:298) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:381) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:369) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:510) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:247) E/TiDownloadManager( 410): at java.net.URL.openStream(URL.java:645) E/TiDownloadManager( 410): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157) E/TiDownloadManager( 410): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) E/TiDownloadManager( 410): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) E/TiDownloadManager( 410): at java.lang.Thread.run(Thread.java:1019) I/TiAPI ( 410): error event I/TiAPI ( 410): loading second image D/dalvikvm( 136): GC_EXPLICIT freed 50K, 51% free 2971K/5959K, external 4969K/5664K, paused 51ms I/InputReader( 62): Device reconfigured: id=0x0, name=qwerty2, display size is now 480x854 I/InputManager-Callbacks( 62): No virtual keys found for device qwerty2. {code}

    Appcelerator JIRA | 5 years ago | Markus Krug
    java.net.ConnectException: invalid.url/62.157.140.133:443 - Connection refused
  2. 0

    h2. Problem On Android, the error event is only triggered once if an image is not accessible. On iOS, it triggers the error event each time. Which is better in my opinion. h2. Test case {code:title=app.js|borderStyle=solid} var win = Ti.UI.createWindow({backgroundColor: 'white'}); win.open(); function createImageView (params) { var imageView = Ti.UI.createImageView(params); imageView.addEventListener('load', function (event) { Ti.API.info('load event'); }); imageView.addEventListener('error', function (event) { Ti.API.info('error event'); }); return imageView; } Ti.API.info('loading first image'); win.add(createImageView({image: 'https://invalid.url/doesnotexist.png', width: 200, height: 100, top: 50})); setTimeout(function () { Ti.API.info('loading second image'); win.add(createImageView({image: 'https://invalid.url/doesnotexist.png', width: 200, height: 100, top: 150})); }, 2000); {code} When executing this code, you'll notice that the {{error event}} is just displayed once in error log. The {{load event}} is never triggered. On iOS the {{error event}} is triggered twice. This is especially inappropriate if the image is not available for just a short time. On the next app start the {{error event}} is also not triggered since it is cached. It should try to reload the image. h2. Community Discussion Q&A [Android Parity: ImageView triggers error event only once|http://developer.appcelerator.com/question/135037/android-parity-imageview-triggers-error-event-only-once] I've also explained why I need the error event. h2. Log {code} D/TiAssetHelper( 410): Fetching "app.js" with Fastdev... I/TiAPI ( 410): loading first image D/dalvikvm( 410): GC_EXTERNAL_ALLOC freed 537K, 53% free 2895K/6087K, external 1967K/2137K, paused 159ms I/TiRootActivity( 410): (main) [0,0] checkpoint, on root activity resume. activity = de.test.mobile.TestMobileActivity@405a4498 D/dalvikvm( 410): GREF has increased to 201 E/TiDownloadManager( 410): (pool-3-thread-1) [31,31] Exception downloading https://invalid.url/doesnotexist1.png E/TiDownloadManager( 410): java.net.ConnectException: invalid.url/62.157.140.133:443 - Connection refused E/TiDownloadManager( 410): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:207) E/TiDownloadManager( 410): at org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437) E/TiDownloadManager( 410): at java.net.Socket.connect(Socket.java:983) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:74) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:298) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:381) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:369) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:510) E/TiDownloadManager( 410): at org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:247) E/TiDownloadManager( 410): at java.net.URL.openStream(URL.java:645) E/TiDownloadManager( 410): at org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157) E/TiDownloadManager( 410): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088) E/TiDownloadManager( 410): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581) E/TiDownloadManager( 410): at java.lang.Thread.run(Thread.java:1019) I/TiAPI ( 410): error event I/TiAPI ( 410): loading second image D/dalvikvm( 136): GC_EXPLICIT freed 50K, 51% free 2971K/5959K, external 4969K/5664K, paused 51ms I/InputReader( 62): Device reconfigured: id=0x0, name=qwerty2, display size is now 480x854 I/InputManager-Callbacks( 62): No virtual keys found for device qwerty2. {code}

    Appcelerator JIRA | 5 years ago | Markus Krug
    java.net.ConnectException: invalid.url/62.157.140.133:443 - Connection refused
  3. 0

    Did not save every static map

    GitHub | 4 years ago | stanfox
    ch.boye.httpclientandroidlib.conn.HttpHostConnectException: Connection to http://maps.google.com refused
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Not being logged in is not signalled prominently

    GitHub | 5 years ago | jirikucera
    org.apache.http.conn.HttpHostConnectException: Connection to https://www.geocaching.com refused
  6. 0

    libgdx no show admob

    Stack Overflow | 4 years ago | Vladimir
    java.net.ConnectException: googleads.g.doubleclick.net/127.0.0.1:80 - Connection refused

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.net.ConnectException

      invalid.url/62.157.140.133:443 - Connection refused

      at org.apache.harmony.luni.net.PlainSocketImpl.connect()
    2. org.apache.harmony
      PlainSocketImpl.connect
      1. org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:207)
      2. org.apache.harmony.luni.net.PlainSocketImpl.connect(PlainSocketImpl.java:437)
      2 frames
    3. Java RT
      Socket.connect
      1. java.net.Socket.connect(Socket.java:983)
      1 frame
    4. org.apache.harmony
      HttpsURLConnectionImpl.getInputStream
      1. org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:74)
      2. org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.<init>(HttpConnection.java:48)
      3. org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection$Address.connect(HttpConnection.java:298)
      4. org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:89)
      5. org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHttpConnection(HttpURLConnectionImpl.java:285)
      6. org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.makeConnection(HttpURLConnectionImpl.java:267)
      7. org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeSslConnection(HttpsURLConnectionImpl.java:381)
      8. org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl$HttpsEngine.makeConnection(HttpsURLConnectionImpl.java:369)
      9. org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.retrieveResponse(HttpURLConnectionImpl.java:1018)
      10. org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:510)
      11. org.apache.harmony.luni.internal.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:247)
      11 frames
    5. Java RT
      URL.openStream
      1. java.net.URL.openStream(URL.java:645)
      1 frame
    6. org.appcelerator.titanium
      TiDownloadManager$DownloadJob.run
      1. org.appcelerator.titanium.util.TiDownloadManager$DownloadJob.run(TiDownloadManager.java:157)
      1 frame
    7. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
      3. java.lang.Thread.run(Thread.java:1019)
      3 frames