Component descriptor cannot be found in the component repository

I'm trying to build a Maven3/Grails-1.3.6 project inside TeamCity 6.0.1 and I'm having a strange exception that makes my build fail:

org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.artifact.handler.ArtifactHandlergrails-app.
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
at org.codehaus.plexus.DefaultPlexusContainer.lookupMap(DefaultPlexusContainer.java:390)
at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:103)
... 53 more


This same build was was building fine until recently (that is until I installed spring-security-core plugin, but I don't know if it's connected). What's also weird is that "mvn package" builds fine locally on my machine. Now of course the problem is to find what is different between both environments that makes the build fail on the build agent.
The first thing I'm wondering is which version of Maven does TeamCity use. Locally I'm running Maven 3.0.1, but the build configuration only allows for Maven2 as a build type.

Any idea?
3 comments
Comment actions Permalink

I just noticed something that makes me think that something is wrong with my TeamCity installation. In fact, the Maven build itself seems to be successful and the exception happens at the very end of the build:

[INFO] ------------------------------------------------------------------------
[20:19:36]: [INFO] BUILD SUCCESSFUL
[20:19:36]: [INFO] ------------------------------------------------------------------------
[20:19:36]: [INFO] Total time: 33 seconds
[20:19:36]: [INFO] Finished at: Sat Jan 15 20:19:36 CET 2011
[20:19:37]: [INFO] Final Memory: 288M/452M
[20:19:37]: [INFO] ------------------------------------------------------------------------
[20:19:37]: java.lang.RuntimeException: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.artifact.factory.ArtifactFactory', it could not be started
[20:19:37]: at com.jetbrains.maven.watcher.reporter.MavenBuildInfoReporter.getComponent(MavenBuildInfoReporter.java:230)
[20:19:37]: at com.jetbrains.maven.watcher.reporter.MavenBuildInfoReporter.addPluginElement(MavenBuildInfoReporter.java:203)
[20:19:37]: at com.jetbrains.maven.watcher.reporter.MavenBuildInfoReporter.addProjectPart(MavenBuildInfoReporter.java:175)
[20:19:37]: at com.jetbrains.maven.watcher.reporter.MavenBuildInfoReporter.generateReport(MavenBuildInfoReporter.java:80)
[20:19:37]: at com.jetbrains.maven.watcher.reporter.MavenBuildInfoReporter.generateReport(MavenBuildInfoReporter.java:48)
[20:19:37]: at com.jetbrains.maven.watcher.Watcher.onBuildFinished(Watcher.java:46)
[20:19:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:19:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[20:19:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[20:19:37]: at java.lang.reflect.Method.invoke(Method.java:597)
[20:19:37]: Application context shutting down...
[20:19:37]: at com.jetbrains.maven.watcher.WatcherFrontEnd.callWatcherMethod(WatcherFrontEnd.java:139)
[20:19:37]: Application context shutdown.
[20:19:37]: at com.jetbrains.maven.watcher.WatcherFrontEnd.onBuildFinished(WatcherFrontEnd.java:38)
[20:19:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:19:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[20:19:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[20:19:37]: at java.lang.reflect.Method.invoke(Method.java:597)
[20:19:37]: at org.jboss.byteman.rule.expression.MethodExpression.interpret(MethodExpression.java:264)
[20:19:37]: at org.jboss.byteman.rule.Action.interpret(Action.java:150)
[20:19:37]: at com.jetbrains.maven.watcher.WatcherFrontEnd_HelperAdapter_Interpreted.fire(Unknown Source)
[20:19:37]: at com.jetbrains.maven.watcher.WatcherFrontEnd_HelperAdapter_Interpreted.execute0(Unknown Source)
[20:19:37]: at com.jetbrains.maven.watcher.WatcherFrontEnd_HelperAdapter_Interpreted.execute(Unknown Source)
[20:19:37]: at org.jboss.byteman.rule.Rule.execute(Rule.java:533)
[20:19:37]: at org.jboss.byteman.rule.Rule.execute(Rule.java:506)
[20:19:37]: at org.apache.maven.cli.MavenCli.main(MavenCli.java:381)
[20:19:37]: at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
[20:19:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[20:19:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[20:19:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[20:19:37]: at java.lang.reflect.Method.invoke(Method.java:597)
[20:19:37]: at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
[20:19:37]: at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
[20:19:37]: at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
[20:19:37]: at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[20:19:37]: Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.artifact.factory.ArtifactFactory', it could not be started
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
[20:19:37]: at org.apache.maven.execution.MavenSession.lookup(MavenSession.java:132)
[20:19:37]: at com.jetbrains.maven.watcher.reporter.MavenBuildInfoReporter.getComponent(MavenBuildInfoReporter.java:227)
[20:19:37]: ... 32 more
[20:19:37]: Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component
[20:19:37]: at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
[20:19:37]: at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
[20:19:37]: at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
[20:19:37]: ... 34 more
[20:19:37]: Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException: Error composing component
[20:19:37]: at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
[20:19:37]: at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
[20:19:37]: at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
[20:19:37]: ... 37 more
[20:19:37]: Caused by: org.codehaus.plexus.component.composition.CompositionException: Composition failed of field artifactHandlerManager in object of type org.apache.maven.artifact.factory.DefaultArtifactFactory because the requirement ComponentRequirement{role='org.apache.maven.artifact.handler.manager.ArtifactHandlerManager', roleHint='null', fieldName='null'} was missing
[20:19:37]: at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
[20:19:37]: at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
[20:19:37]: at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
[20:19:37]: at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
[20:19:37]: ... 39 more
[20:19:37]: Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Unable to lookup component 'org.apache.maven.artifact.handler.manager.ArtifactHandlerManager', it could not be started
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:339)
[20:19:37]: at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129)
[20:19:37]: ... 43 more
[20:19:37]: Caused by: org.codehaus.plexus.component.repository.exception.ComponentLifecycleException: Error starting component
[20:19:37]: at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:109)
[20:19:37]: at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
[20:19:37]: at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92)
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
[20:19:37]: ... 44 more
[20:19:37]: Caused by: org.codehaus.plexus.personality.plexus.lifecycle.phase.PhaseExecutionException: Error composing component
[20:19:37]: at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:33)
[20:19:37]: at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
[20:19:37]: at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
[20:19:37]: ... 47 more
[20:19:37]: Caused by: org.codehaus.plexus.component.composition.CompositionException: Composition failed of field artifactHandlers in object of type org.apache.maven.artifact.handler.manager.DefaultArtifactHandlerManager because the requirement ComponentRequirement{role='org.apache.maven.artifact.handler.ArtifactHandler', roleHint='null', fieldName='artifactHandlers'} was missing
[20:19:37]: at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:154)
[20:19:37]: at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73)
[20:19:37]: at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68)
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486)
[20:19:37]: at org.codehaus.plexus.personality.plexus.lifecycle.phase.CompositionPhase.execute(CompositionPhase.java:29)
[20:19:37]: ... 49 more
[20:19:37]: Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Component descriptor cannot be found in the component repository: org.apache.maven.artifact.handler.ArtifactHandlergrails-app.
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:323)
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
[20:19:37]: at org.codehaus.plexus.DefaultPlexusContainer.lookupMap(DefaultPlexusContainer.java:390)
[20:19:37]: at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:103)
[20:19:37]: ... 53 more
[20:19:37]: Process exited with code 0
[20:19:37]: Surefire report watcher
[20:19:37]: Waiting for 1 service processes to complete
[20:19:37]: Build finished
0
Comment actions Permalink

I just encountered exactly this stacktrace in one of our builds on TeamCity 6.  Our build is using Maven 2.2.1 in this case.  We are specifying an explicit Maven home path in the Maven2 runner.

0
Comment actions Permalink

This has been fixed - http://youtrack.jetbrains.net/issue/TW-15103

Please wait for 6.0.2 coming next week.

As a workaround you can try run your builds with Maven 3.

0

Please sign in to leave a comment.