Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Okhttp 3.2.0 as an http connector #594

Closed
sachin-walia opened this issue Mar 4, 2016 · 14 comments
Closed

Support Okhttp 3.2.0 as an http connector #594

sachin-walia opened this issue Mar 4, 2016 · 14 comments

Comments

@sachin-walia
Copy link
Contributor

Okhttp 3.x has been released few weeks ago and as such any new feature will only be added to that version. Since 2.x version will be deprecated eventually so it may be a good idea to move to Okhttp v3.

@sachin-walia
Copy link
Contributor Author

Sent pull #595 to address this issue.

@sachin-walia
Copy link
Contributor Author

Pull #595 request is consolidated so closing this issue.

@gondor gondor reopened this Mar 5, 2016
@gondor
Copy link
Member

gondor commented Mar 5, 2016

@sachinwalia2k8 I was just trying to deploy a new SNAPSHOT with the merge for this. One of the tests (possibly more is failing) in the OKHttp connector.

When you get a chance can you run a mvn verify and see if this is a quick fix on your side.

Tests run: 146, Failures: 1, Errors: 0, Skipped: 1

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] OpenStack4j Parent ................................. SUCCESS [  4.104 s]
[INFO] OpenStack4j Core ................................... SUCCESS [ 24.654 s]
[INFO] OpenStack4j Test Cases ............................. SUCCESS [  4.160 s]
[INFO] OpenStack4j Connectors ............................. SUCCESS [  1.638 s]
[INFO] OpenStack4j Jersey2 Connector ...................... SUCCESS [  5.603 s]
[INFO] OpenStack4j Jersey 2.6 JDK16 Compat Connector ...... SUCCESS [  5.914 s]
[INFO] OpenStack4j RestEasy Connector ..................... SUCCESS [  5.572 s]
[INFO] OpenStack4j HttpComponents-HttpClient Connector .... SUCCESS [  5.747 s]
[INFO] OpenStack4j OKHttp Connector ....................... FAILURE [  2.489 s]
[INFO] OpenStack4j HttpURL Connector ...................... SKIPPED
[INFO] OpenStack4j Plugins ................................ SKIPPED
[INFO] OpenStack4j Log4j Plugin ........................... SKIPPED
[INFO] OpenStack4j SLF4J Plugin ........................... SKIPPED
[INFO] OpenStack4j Distribution ........................... SKIPPED
[INFO] ------------------------------------------------------------------------

StackTrace:

org.openstack4j.api.exceptions.ConnectionException: method POST must have a request body.
    at okhttp3.Request$Builder.method(Request.java:239)
    at org.openstack4j.connectors.okhttp.HttpCommand.execute(HttpCommand.java:118)
    at org.openstack4j.connectors.okhttp.HttpExecutorServiceImpl.invokeRequest(HttpExecutorServiceImpl.java:61)
    at org.openstack4j.connectors.okhttp.HttpExecutorServiceImpl.invoke(HttpExecutorServiceImpl.java:54)
    at org.openstack4j.connectors.okhttp.HttpExecutorServiceImpl.execute(HttpExecutorServiceImpl.java:30)
    at org.openstack4j.core.transport.internal.HttpExecutor.execute(HttpExecutor.java:51)
    at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.executeWithResponse(BaseOpenStackService.java:193)
    at org.openstack4j.openstack.manila.internal.ShareServiceImpl.unmanageShare(ShareServiceImpl.java:167)
    at org.openstack4j.api.manila.ShareTests.unmanageShare(ShareTests.java:199)

@gondor
Copy link
Member

gondor commented Mar 5, 2016

PS. I noticed your local to me.. I'm in Redwood City area.

@sachin-walia
Copy link
Contributor Author

@gondor sure will give it a try today.

@sachin-walia
Copy link
Contributor Author

@gondor - yes I am in south bay. Been here for long time. :)

@sachin-walia
Copy link
Contributor Author

@gondor can you try doing a full build from the parent project and try again. I was only able to replicate it only once if I executed verify goal for okhttp-connector project (reason being it downloaded snapshot artifact from CI branch). After full build it vanished.

@gondor
Copy link
Member

gondor commented Mar 6, 2016

I tried again and the same result. Did you try a re-pull? Also, Do you have Docker installed locally? If so I can wrap it in a Docker build so it's prestine to check your results.

@sachin-walia
Copy link
Contributor Author

@gondor - I tried it. Sorry I was trying with my fork which didn't had the manila changes. Apparently this issue started popping after version 2.3.0 of okhttp (what a coincidence :)). Here is a bug reported on okhttp website: square/okhttp#751. The solution is to put an empty body in the post call instead of null. I am going to send one more pull request to address it.

@sachin-walia
Copy link
Contributor Author

@gondor just sent pull request #596 to address this issue. This is a workaround as provided by okhttp team.

@gondor
Copy link
Member

gondor commented Mar 6, 2016

Awesome @sachinwalia2k8, i will try now and update/close if the SNAPSHOT goes through. Thanks for jumping into this.

@gondor
Copy link
Member

gondor commented Mar 6, 2016

That worked! Thanks again!

@gondor gondor closed this as completed Mar 6, 2016
@sachin-walia
Copy link
Contributor Author

You are welcome. BTW I saw that you work at auction.com. That's a nice place and a friend of mine joined there a month ago. She has all the good words about the company.

@gondor
Copy link
Member

gondor commented Mar 6, 2016

Awesome, Whats your friends name? I started there in Jan, moving back to CA from Seattle. Really like the company so far.. great people and culture. PS. my personal email is jeremybunruh at gmail

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

No branches or pull requests

2 participants