Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Resty broken on Java 1.5 #15

Open
davidekholm opened this issue Sep 1, 2012 · 2 comments
Open

Resty broken on Java 1.5 #15

davidekholm opened this issue Sep 1, 2012 · 2 comments

Comments

@davidekholm
Copy link

Resty breaks when running on Java 1.5. I looked at the code for Resty.java and can see that's intended to work, but it's not enough. This is the failing code:

    try {
            java.net.CookieHandler.setDefault(new java.net.CookieManager());
    } catch (Throwable oops) {
        System.err.println("No CookieHandler. Running on GAE? Fine. No cookie support for you!");
    }

On Java 1.5, the loading of the Resty class itself, where this static code is located is breaking, so it never reaches the try-catch part. The solution is to simply put this code in a separate "CookieFix" class and instantiate such a class from the static context of the Resty class. Now you can wrap that instantiation in the try-catch loop and it will work.

@beders
Copy link
Owner

beders commented Jan 20, 2013

thanks, will put it in

@davidekholm
Copy link
Author

Great!

On 20 jan 2013, at 07:13, Jochen Bedersdorfer [email protected] wrote:

thanks, will put it in


Reply to this email directly or view it on GitHub.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants