[GRADLE-1944] Dependencies resolved different than old version which cause trouble when running Created: 18/Nov/11  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-6
Fix Version/s: None

Type: Bug
Reporter: Wang Liyu Assignee: Unassigned
Resolution: Won't Fix Votes: 0

Attachments: Text File dependencies.txt    

 Description   

My project requires to run the arquillian test with JBoss6.1.0.Final, in the build.gradle I have:
dependencies

{ ... testCompile([group: 'junit', name: 'junit', version: '4.9'], [group: 'org.jboss.arquillian.junit', name: 'arquillian-junit-container', version: '1.0.0.CR5']) jbossasRemoteTestRuntime([group: 'org.jboss.arquillian.container', name: 'arquillian-jbossas-remote-6', version: '1.0.0.CR2'], [group: 'org.jboss.spec', name: 'jboss-javaee-6.0', version: '1.0.0.Final'], [group: 'org.jboss.jbossas', name: 'jboss-as-profileservice-client', version: '6.1.0.Final']) }

and when I run my test with any previous version of Gradle (up to M5), there is no problem.
with M6 release, it report me "can not connect to JBoss container" error:
Detail logs:

Caused by: javax.naming.CommunicationException [Root exception is java.io.InvalidClassException: org.jboss.remoting.InvokerLocator; local class incompatible: stream classdesc serialVersionUID = -4977622166779282521, local class serialVersionUID = -2909329895029296248]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.jboss.arquillian.container.jbossas.remote_6.JBossASRemoteContainer.initDeploymentManager(JBossASRemoteContainer.java:204)
at org.jboss.arquillian.container.jbossas.remote_6.JBossASRemoteContainer.start(JBossASRemoteContainer.java:87)
... 88 more
Caused by: java.io.InvalidClassException: org.jboss.remoting.InvokerLocator; local class incompatible: stream classdesc serialVersionUID = -4977622166779282521, local class serialVersionUID = -2909329895029296248
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1582)

I ran projectReport, it generate different set of dependencies for the jbossasRemoteTest task (M6 generated much more than M5 generated)

I took a look the release note and breaking changes, no document mention there. Could someone please take a look?



 Comments   
Comment by Wang Liyu [ 18/Nov/11 ]

Here is a sample gradle arquillian project https://github.com/arquillian/arquillian-showcase/tree/master/cdi

Comment by Szczepan Faber [ 20/Nov/11 ]

@Wang, how do you run the sample project to reproduce the problem?

>it generate different set of dependencies for the jbossasRemoteTest task (M6 generated much more than M5 generated)

You mean different set of dependencies for the jbossAS6 configurations?

Comment by Wang Liyu [ 25/Nov/11 ]

I combined the dependencies list generated by both M6 & M5 into this file, and you can see M6 generated over 200 lines while M5 only generated 160 lines

Comment by Adam Murdoch [ 06/Feb/12 ]

I think that M6 is giving the correct result. I traced through the extra jars in the result, and for each one there is a dependency path that includes the jar, and does not exclude the jar. For example, this path includes activation-1.1.jar:

org.jboss.spec:jboss-javaee-6.0:1.0.0.Final
-> org.jboss.spec.javax.xml.registry:jboss-jaxr-api_1.0_spec:1.0.0.Final
-> javax.activation:activation:1.1

Comment by Wang Liyu [ 11/Apr/12 ]

I took a close look again, and it seems from this release, Gradle loads the dependencies in a reverse order than earlier versions. So the Arquillian load JBoss6 RMI jars first and load JBoss4 client jar later, the 2 jars happens to have the same class with different version which creates the mess.

After I adjusted the order, the problem gone now.
This ticket can be closed, BTW, you should document this change in the document.

Thanks,
Liyu

Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:08:34 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.