Help. Getting exception executing PostMethod.getStatusCode()!

Couldn't figure out why I'm getting Null pointer here : System.out.println(method.getStatusCode()); !? method initialized and successfully executed! Any ideas? Sample code here. I'm using commons-httpclient-3.1.jar

            PostMethod = new PostMethod(url);

        LogInHelper.logRequest(httpClient, method);

        try {
            httpClient.executeMethod(method);
            method.getResponseBodyAsString();
        } catch (HttpException e) {
            LOG.error("@getSessionId() error connecting to " + url, e);

        } catch (IOException e) {
            LOG.error("@getSessionId() error connecting to " + url, e);

        }

        LogInHelper.logResponse(method);

        System.out.println(method.getStatusCode());

Answers


Cleaning and recompile whole project helped in this case.


Need Your Help

Laravel 5 middleware Auth check not working

php redirect laravel-5 infinite-loop middleware

i want to show a 404 error page if the user try to access to de admin page if he is not logged or if he dont have the 'Admin' type. This work fine if the user is logged in, if not the user access t...

Changing conflicting assembly references

c# android xamarin reference

My friend gave me a project created in Xamarin Studio. When I try to run the project I get some warnings related to conflicting assembly references.