Issue #10 new

Example throws an error

jvence
created an issue

Running the included example throws the following exception:

Exception in thread "main" java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before allocating another one. at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:216) at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:190) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:391) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) at urbanairship.UrbanAirshipClient.execute(UrbanAirshipClient.java:509) at urbanairship.UrbanAirshipClient.post(UrbanAirshipClient.java:346) at urbanairship.UrbanAirshipClient.sendPushNotifications(UrbanAirshipClient.java:111) at urbanairship.test.main(test.java:45) Java Result: 1

Comments (2)

  1. Fanbin Kong

    I have found the same issue when try android. you can through below change to fix it.

    Change UrbanAirshipClient.put(String path, Object requestBodyObject) method from ... execute(put); to ... HttpResponse res = execute(put); close(res);

  2. puneet chawla

    Can you please update the source tree if this is a known issue.

    I see the same problem:

    java Test Exception in thread "main" java.lang.IllegalStateException: Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before allocating another one. at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:216) at org.apache.http.impl.conn.SingleClientConnManager$1.getConnection(SingleClientConnManager.java:190) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:391) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732) at urbanairship.UrbanAirshipClient.execute(UrbanAirshipClient.java:509) at urbanairship.UrbanAirshipClient.post(UrbanAirshipClient.java:346) at urbanairship.UrbanAirshipClient.sendPushNotifications(UrbanAirshipClient.java:111) at Test.sendDeviceNotification(Test.java:31) at Test.main(Test.java:38)

  3. Log in to comment