[GRADLE-1716] Unable to run tests due to wharf exceptions Created: 04/Aug/11  Updated: 04/Jan/13  Resolved: 12/Oct/11

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

Type: Bug
Reporter: Szczepan Faber Assignee: Adam Murdoch
Resolution: Fixed Votes: 0


 Description   

Sometime yesterday gradle build stopped working for me. Dozens of tests are failing due to unresolved dependencies. Since the problem lead to think that it is cache problem I nuked my entire cache. However, it made things even worse because I was not able to resolve dependencies so it was making development somewhat painful I resolved the latter problem by downgrading to gradle-1.0-milestone-4-20110725000027+0200, the version already includes wharf but apparently it allows to resolve dependencies fine. Now I'm back with my initial problem. Here's the output of exemplary test (EclipseClasspathIntegrationTest):

		::::::::::::::::::::::::::::::::::::::::::::::

		::          UNRESOLVED DEPENDENCIES         ::

		::::::::::::::::::::::::::::::::::::::::::::::

		:: coolGroup#niceArtifact;1.0: Buffer limit exceeded reading object of type: java.util.HashSet

		::::::::::::::::::::::::::::::::::::::::::::::

Ivy does not provide a stack trace (c'mon, real hacker does not need the stack trace however I did some debugging and here's the stack trace:

com.esotericsoftware.kryo.SerializationException: Buffer limit exceeded reading object of type: java.util.HashSet
	at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:587)
	at com.esotericsoftware.kryo.ObjectBuffer.readObject(ObjectBuffer.java:97)
	at org.jfrog.wharf.ivy.marshall.kryo.WharfKryoResolverMarshaller.getWharfMetadatas(WharfKryoResolverMarshaller.java:75)
	at org.jfrog.wharf.ivy.cache.ResolverHandler.<init>(ResolverHandler.java:53)
	at org.jfrog.wharf.ivy.cache.WharfCacheManager.getResolverHandler(WharfCacheManager.java:151)
	at org.jfrog.wharf.ivy.cache.WharfCacheManager.doFindModuleInCache(WharfCacheManager.java:534)
	at org.jfrog.wharf.ivy.cache.WharfCacheManager.findModuleInCache(WharfCacheManager.java:497)
	at org.apache.ivy.plugins.resolver.AbstractResolver.findModuleInCache(AbstractResolver.java:352)
	at org.jfrog.wharf.ivy.resolver.IBiblioWharfResolver.basicFindModuleInCache(IBiblioWharfResolver.java:142)
	at org.jfrog.wharf.ivy.util.WharfUtils.findModuleInCache(WharfUtils.java:129)
	at org.jfrog.wharf.ivy.resolver.IBiblioWharfResolver.findModuleInCache(IBiblioWharfResolver.java:127)
	at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:203)
	at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:503)
	at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
	at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:104)
	at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:169)
	at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:287)
	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:696)
	at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:781)
	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
	at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:769)
	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
	at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:769)
	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:704)
	at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:576)
	at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:237)
	at org.apache.ivy.Ivy.resolve(Ivy.java:512)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyDependencyResolver.resolve(DefaultIvyDependencyResolver.java:55)
	at org.gradle.api.internal.artifacts.ivyservice.SelfResolvingDependencyResolver.resolve(SelfResolvingDependencyResolver.java:43)
	at org.gradle.api.internal.artifacts.ivyservice.DefaultIvyService.resolve(DefaultIvyService.java:122)
	at org.gradle.api.internal.artifacts.ivyservice.ShortcircuitEmptyConfigsIvyService.resolve(ShortcircuitEmptyConfigsIvyService.java:69)
	at org.gradle.api.internal.artifacts.ivyservice.ErrorHandlingIvyService.resolve(ErrorHandlingIvyService.java:47)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:212)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
	at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:57)
	at org.gradle.api.internal.BeanDynamicObject.getProperty(BeanDynamicObject.java:86)
	at org.gradle.api.internal.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:51)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getProperty(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:235)
	at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.resolveDependencies(IdeDependenciesExtractor.groovy:148)
	at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.this$2$resolveDependencies(IdeDependenciesExtractor.groovy)
	at org.gradle.plugins.ide.internal.IdeDependenciesExtractor$this$2$resolveDependencies.callCurrent(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
	at org.gradle.plugins.ide.internal.IdeDependenciesExtractor.extractRepoFileDependencies(IdeDependenciesExtractor.groovy:88)
	at org.gradle.plugins.ide.internal.IdeDependenciesExtractor$extractRepoFileDependencies.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$4.update(ClasspathFactory.groovy:60)
	at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$ClasspathEntryBuilder$update.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
	at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory.createEntries(ClasspathFactory.groovy:86)
	at org.gradle.plugins.ide.eclipse.model.internal.ClasspathFactory$createEntries.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
	at org.gradle.plugins.ide.eclipse.model.EclipseClasspath.resolveDependencies(EclipseClasspath.groovy:213)
	at org.gradle.plugins.ide.eclipse.model.EclipseClasspath$resolveDependencies.callCurrent(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
	at org.gradle.plugins.ide.eclipse.model.EclipseClasspath.mergeXmlClasspath(EclipseClasspath.groovy:220)
	at org.gradle.plugins.ide.eclipse.model.EclipseClasspath$mergeXmlClasspath.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
	at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath.configure(GenerateEclipseClasspath.groovy:45)
	at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath.configure(GenerateEclipseClasspath.groovy)
	at org.gradle.plugins.ide.api.XmlGeneratorTask$1.configure(XmlGeneratorTask.java:41)
	at org.gradle.plugins.ide.api.XmlGeneratorTask$1.configure(XmlGeneratorTask.java:35)
	at org.gradle.plugins.ide.api.GeneratorTask.generate(GeneratorTask.java:70)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
	at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:158)
	at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:93)
	at org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath_Decorated.invokeMethod(Unknown Source)
	at groovy.lang.GroovyObject$invokeMethod.call(Unknown Source)
	at org.gradle.util.ReflectionUtil.invoke(ReflectionUtil.groovy:23)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:129)
	at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$2.execute(AnnotationProcessingTaskFactory.java:127)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:63)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:48)
	at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:34)
	at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:41)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:52)
	at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:42)
	at org.gradle.api.internal.AbstractTask.execute(AbstractTask.java:237)
	at org.gradle.execution.DefaultTaskGraphExecuter.executeTask(DefaultTaskGraphExecuter.java:167)
	at org.gradle.execution.DefaultTaskGraphExecuter.doExecute(DefaultTaskGraphExecuter.java:160)
	at org.gradle.execution.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:78)
	at org.gradle.execution.TaskNameResolvingBuildExecuter.execute(TaskNameResolvingBuildExecuter.java:113)
	at org.gradle.execution.DelegatingBuildExecuter.execute(DelegatingBuildExecuter.java:54)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:155)
	at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:109)
	at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:77)
	at org.gradle.integtests.fixtures.InProcessGradleExecuter.doRun(InProcessGradleExecuter.java:176)
	at org.gradle.integtests.fixtures.InProcessGradleExecuter.doRun(InProcessGradleExecuter.java:144)
	at org.gradle.integtests.fixtures.AbstractGradleExecuter.run(AbstractGradleExecuter.java:245)
	at org.gradle.integtests.fixtures.GradleDistributionExecuter.doRun(GradleDistributionExecuter.java:108)
	at org.gradle.integtests.fixtures.AbstractGradleExecuter.run(AbstractGradleExecuter.java:245)
	at org.gradle.integtests.fixtures.GradleExecuter$run.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
	at org.gradle.plugins.ide.AbstractIdeIntegrationTest.runTask(AbstractIdeIntegrationTest.groovy:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
	at org.gradle.plugins.ide.eclipse.AbstractEclipseIntegrationTest.runEclipseTask(AbstractEclipseIntegrationTest.groovy:23)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:225)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:153)
	at org.gradle.plugins.ide.eclipse.AbstractEclipseIntegrationTest.runEclipseTask(AbstractEclipseIntegrationTest.groovy)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
	at org.gradle.plugins.ide.eclipse.EclipseClasspathIntegrationTest.classpath contains library entries for external and file dependencies(EclipseClasspathIntegrationTest.groovy:47)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.gradle.integtests.fixtures.TestResources$1.evaluate(TestResources.java:63)
	at org.gradle.util.TemporaryFolder$1.evaluate(TemporaryFolder.java:69)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:97)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:192)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
Caused by: java.nio.BufferUnderflowException
	at java.nio.Buffer.nextGetIndex(Buffer.java:474)
	at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:117)
	at com.esotericsoftware.kryo.Serializer.readObject(Serializer.java:57)
	at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:581)
	... 175 more


 Comments   
Comment by Szczepan Faber [ 04/Aug/11 ]

Submitted to jfrog tracker: https://issues.jfrog.org/jira/browse/WHARF-24

Comment by Szczepan Faber [ 08/Aug/11 ]

I did a fresh clone on the side and couldn't reproduce the problem there. It got me thinking it may be related to 'intTestHomeDir'. When I deleted 'intTestHomeDir/*' the problem is gone (or rather waiting in the deep to resurface )

Comment by Frederic Simon [ 20/Aug/11 ]

I double checked (without managing to reproduced!), and their may be OS file system environment where this may happen. But on Mac OS X the atomic operation File.createNewFile() "should not" but "can" be used for locking.
So, in your case, it may be due to folder or file symlink, or the OS inode got messed up
Anyway, this issue relates to the global "multi JVM locking infrastructure" issue...

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