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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V #61

Open
ObjectiveTruth opened this issue Apr 17, 2016 · 7 comments

Comments

@ObjectiveTruth
Copy link
Contributor

ObjectiveTruth commented Apr 17, 2016

Works on v2.0.1x but not on v2.6.3 and unfortunately for me, i use CircleCI which isn't supported in v2.0.1x 馃槶

See #47, #45

Any ideas what it could be or if there's any workaround for now? Awesome plugins btw 馃憤

> org.apache.http.entity.mime.content.ByteArrayBody.<init>([BLorg/apache/http/entity/ContentType;Ljava/lang/String;)V

@ObjectiveTruth
Copy link
Contributor Author

So, i tried straight upgrading the version of org.apache.httpcomponents:httpmime from 4.3 to various versions.

Patch upgrade compiled up to 4.3.6 but still gave the error mentioned above in the gradle task

httpmime maven: http://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime

http-builder maven (already at latest): http://mvnrepository.com/artifact/org.codehaus.groovy.modules.http-builder/http-builder

https://github.com/kt3k/coveralls-gradle-plugin/blob/master/build.gradle#L20-L30

dependencies {
    compile localGroovy()
    compile gradleApi()

    compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1'
    //Here is the mime version declaration
    compile 'org.apache.httpcomponents:httpmime:4.3.6'
    compile 'org.eclipse.jgit:org.eclipse.jgit:3.6.0.201412230720-r'

    testCompile 'junit:junit:4.11'
    testCompile 'org.mockito:mockito-all:1.9.5'
    testCompile 'com.github.tomakehurst:wiremock:1.18'
}

I'd like to try upgrading past to a higher minor version but it fails all the tests and I'm not a gradle expert so I couldn't fine the issue to fix the tests.

Here's the test failure output when moving to 4.5.2

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMain FAILED
    java.lang.NoSuchMethodError at CoverallsTaskTest.groovy:130

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMainNoFile FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testPostJsonToUrl FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMainNoService FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMainWithEmptyCoverageReport FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testPostJsonToUrlFailure FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMainWithTravisProSituation FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMainNoPostJson FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest > testMainSaveFile FAILED
    java.lang.RuntimeException
        Caused by: java.net.BindException

44 tests completed, 9 failed
:test FAILED

Cheers 馃樅

@ObjectiveTruth
Copy link
Contributor Author

Oh, and the stack traces, of the interesting one, the rest are all address already in use exception, which probably fails because of the first

testMain

java.lang.NoSuchMethodError: org.apache.http.entity.ContentType.create(Ljava/lang/String;[Lorg/apache/http/NameValuePair;)Lorg/apache/http/entity/ContentType;
    at org.apache.http.entity.mime.MultipartEntityBuilder.buildEntity(MultipartEntityBuilder.java:219)
    at org.apache.http.entity.mime.MultipartEntityBuilder.build(MultipartEntityBuilder.java:240)
    at org.apache.http.entity.mime.MultipartEntityBuilder$build$1.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$_postJsonToUrl_closure1.doCall(CoverallsTask.groovy:44)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1019)
    at groovy.lang.Closure.call(Closure.java:426)
    at groovy.lang.Closure.call(Closure.java:442)
    at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:432)
    at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:366)
    at groovyx.net.http.HTTPBuilder$request.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.postJsonToUrl(CoverallsTask.groovy:42)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$postJsonToUrl$1.callCurrent(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask.coverallsAction(CoverallsTask.groovy:152)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTask$coverallsAction.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
    at org.kt3k.gradle.plugin.coveralls.CoverallsTaskTest.testMain(CoverallsTaskTest.groovy:130)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at com.github.tomakehurst.wiremock.junit.WireMockRule$1.evaluate(WireMockRule.java:46)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:105)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:56)
    at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:64)
    at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:50)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
    at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
    at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
    at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:106)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
    at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
    at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

echsylon added a commit to laszlourszuly/atlantis that referenced this issue Oct 3, 2016
@echsylon
Copy link

echsylon commented Oct 3, 2016

I too see this behavior in 2.6.3. Please fix.

@ObjectiveTruth I have found that v. 2.4.0x seems to work. As a temporary solution, perhaps you could try to downgrade.

@ngeor
Copy link

ngeor commented Feb 8, 2017

This is still an issue in 2.8.1 (latest at this point).

@ngeor
Copy link

ngeor commented Feb 8, 2017

And I confirm that downgrading to 2.4.0x works fine.

@robohorse
Copy link

@kt3k This is still an issue in 2.8.2
my build.gradle

@d4rken
Copy link

d4rken commented Dec 6, 2017

Also encountered this in 2.8.2.

The issue is the version of httpmime and is Android related.

The coveralls plugin pulls in 4.3:

Download https://plugins.gradle.org/m2/org/apache/httpcomponents/httpmime/4.3/httpmime-4.3.pom

But something else pulls in 4.1 causing this issue.

Download https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom

Possibly:
https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime/4.1/usages

d4rken added a commit to d4rken/RxShell that referenced this issue Dec 6, 2017
@kt3k kt3k mentioned this issue May 26, 2019
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

5 participants