Bug 1015324 - eclipse-m2e-core: Failing to retrieve Archetypes
Summary: eclipse-m2e-core: Failing to retrieve Archetypes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: eclipse-m2e-core
Version: 22
Hardware: Unspecified
OS: Other
unspecified
medium
Target Milestone: ---
Assignee: Gerard Ryan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-03 23:08 UTC by John Himpel
Modified: 2015-12-18 07:53 UTC (History)
5 users (show)

Fixed In Version: eclipse-m2e-core-1.4.0-11.1.fc20 eclipse-m2e-core-1.6.2-4.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-18 07:53:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
0001-RHBZ-1015324-Failing-to-retrieve-archetypes.patch (1.86 KB, patch)
2014-01-27 23:33 UTC, Gerard Ryan
no flags Details | Diff
Backtrace (116.75 KB, text/plain)
2014-01-31 08:54 UTC, Mikolaj Izdebski
no flags Details

Description John Himpel 2013-10-03 23:08:33 UTC
Description of problem:When performing in eclipse Filie -> New -> Project -> Maven Project, I get the following error dialog box:

Problem Occurred
'Retrieving archetypes:' has encountered a problem.
An internal error occurred during: "Retrieving archetypes:".

Details:
An internal error occurred during: "Retrieving archetypes:" org/apache/maven/archetype/catalog/ArchetypeCatalog


Version-Release number of selected component (if applicable):
eclipse-m2e-1.4.0-6.fc21.noarch.rpm

How reproducible:
Always


Steps to Reproduce:
1.Start eclipse
2.File->New->Project->Maven Module
3.Next->Next

Actual results:


Expected results:


Additional info:

Comment 1 Roland Grunberg 2013-10-28 14:40:02 UTC
Was able to reproduce as well. Relevent stacktrace below :

java.lang.NoClassDefFoundError: org/apache/maven/archetype/catalog/ArchetypeCatalog
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
	at java.lang.Class.getDeclaredMethods(Class.java:1855)
	at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:674)
	at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:366)
	at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
	at com.google.inject.internal.InjectorImpl.getInternalDependencies(InjectorImpl.java:609)
	at com.google.inject.internal.InjectorImpl.cleanup(InjectorImpl.java:565)
	at com.google.inject.internal.InjectorImpl.initializeJitBinding(InjectorImpl.java:551)
	at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:865)
	at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:790)
	at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:278)
	at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:210)
	at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:986)
	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1019)
	at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:982)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1032)
	at org.sonatype.guice.bean.reflect.AbstractDeferredClass.get(AbstractDeferredClass.java:45)
	at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:55)
	at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:70)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:100)
	at org.sonatype.guice.plexus.lifecycles.PlexusLifecycleManager.onProvision(PlexusLifecycleManager.java:138)
	at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:109)
	at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:55)
	at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:68)
	at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:47)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1054)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:59)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
	at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:997)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1047)
	at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:993)
	at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
	at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
	at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:239)
	at org.eclipse.m2e.core.internal.MavenPluginActivator.lookup(MavenPluginActivator.java:357)
	at org.eclipse.m2e.core.internal.MavenPluginActivator.getArchetype(MavenPluginActivator.java:393)
	at org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.getArchetyper(ArchetypeCatalogFactory.java:71)
	at org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory$InternalCatalogFactory.getArchetypeCatalog(ArchetypeCatalogFactory.java:108)
	at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage.getArchetypesForCatalog(MavenProjectWizardArchetypePage.java:519)
	at org.eclipse.m2e.core.ui.internal.wizards.MavenProjectWizardArchetypePage$15.run(MavenProjectWizardArchetypePage.java:557)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.archetype.catalog.ArchetypeCatalog cannot be found by org.eclipse.m2e.archetype.common_1.4.0.20131003-1647
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	... 47 more

Comment 2 Mikolaj Izdebski 2013-12-31 06:44:25 UTC
Reproducible for me as well.

Comment 3 Roland Grunberg 2014-01-06 18:10:10 UTC
I was able to get this working by adding 'org.apache.maven.archetype.catalog' to the Require-Bundle manifest list of 'org.eclipse.m2e.maven.indexer' and 'org.eclipse.m2e.archetype.common'. It was also necessary to symlink/add maven-invoker.jar and archetype-descriptor.jar to the Bundle-ClassPath of 'org.eclipse.m2e.archetype.common' .

Comment 4 Mikolaj Izdebski 2014-01-06 18:17:21 UTC
(In reply to Roland Grunberg from comment #3)
> I was able to get this working by adding
> 'org.apache.maven.archetype.catalog' to the Require-Bundle manifest list of
> 'org.eclipse.m2e.maven.indexer' and 'org.eclipse.m2e.archetype.common'. It
> was also necessary to symlink/add maven-invoker.jar and
> archetype-descriptor.jar to the Bundle-ClassPath of
> 'org.eclipse.m2e.archetype.common' .

Earlier I did the same.  No exeptions show up, but the list of archetypes is empty.  Besides that I don't know how this should properly be fixed other than  hacking manifests.

Comment 5 John Himpel 2014-01-12 02:22:49 UTC
Would this be the way to populate the list of archetypes (assuming the above fixes are in place)?
http://stackoverflow.com/questions/8975789/maven-jboss-archetypes-catalog-on-eclipse-m2e

Comment 6 Roland Grunberg 2014-01-13 14:43:43 UTC
(In reply to comment #5)
> Would this be the way to populate the list of archetypes (assuming the above
> fixes are in place)?
> http://stackoverflow.com/questions/8975789/maven-jboss-archetypes-catalog-on-eclipse-m2e

I forgot to mention that in my case, the reason the archetype list was empty, was due to running on a VM where /tmp was a tmpfs with a size of ~ 700MB. eclipse-m2e-core seems to use /tmp for downloading data before storing it in the workspace metadata. Once I increased the size of that partition I had listing of archetypes. Although yes, that would probably be the approach to add an archetype from a catalog that isn't present.

Comment 7 John Himpel 2014-01-14 14:23:45 UTC
Have the above changes been packaged and made available yet?
I looked in Koji and didn't see anything that looked like it included these changes, but I'm certainly not an expert at interpreting Change Logs.

Comment 8 Gerard Ryan 2014-01-15 22:24:09 UTC
Thanks for the updates on progress on this guys.

(In reply to John Himpel from comment #7)
> Have the above changes been packaged and made available yet?
> I looked in Koji and didn't see anything that looked like it included these
> changes, but I'm certainly not an expert at interpreting Change Logs.

Unfortunately I haven't been much help, since I was away on holidays for a while, and came back to a dead laptop. I'll hopefully have a usable machine sometime soon.

Comment 9 Gerard Ryan 2014-01-27 23:33:06 UTC
Created attachment 856298 [details]
0001-RHBZ-1015324-Failing-to-retrieve-archetypes.patch

The attached patch to the spec file fixes this issue for me, thanks to the info from Roland and Mikolaj.

I haven't applied/committed/rebuilt yet, as I'm not 100% sure if the versioning is ok. At this point, the F20 branch will diverge from Rawhide. There's already a 1.4.0-12.fc21 build in rawhide. Is it ok for there to be a 1.4.0-12.fc20 build in F20 that's unrelated? I feel like maybe F20 should go to 1.4.0-13, and rawhide to 1.4.0-14 to preserve upgradepath. Does that make sense? If so, I'll submit an update after work tomorrow (or if anyone else would like to do it before then, feel free).

Thanks,
Gerard.

Comment 10 Gerard Ryan 2014-01-28 08:55:02 UTC
(In reply to Gerard Ryan from comment #9)
> I haven't applied/committed/rebuilt yet, as I'm not 100% sure if the
> versioning is ok. At this point, the F20 branch will diverge from Rawhide.
> There's already a 1.4.0-12.fc21 build in rawhide. Is it ok for there to be a
> 1.4.0-12.fc20 build in F20 that's unrelated? I feel like maybe F20 should go
> to 1.4.0-13, and rawhide to 1.4.0-14 to preserve upgradepath. Does that make
> sense? If so, I'll submit an update after work tomorrow (or if anyone else
> would like to do it before then, feel free).

Or I could stop being such a silly goose and put in a conditional for the f21+ stuff. I'm not so good at thinking of these things late at night! :) I'll do that later and submit an update.

Comment 11 Mikolaj Izdebski 2014-01-28 09:22:34 UTC
(In reply to Gerard Ryan from comment #9)
> I haven't applied/committed/rebuilt yet, as I'm not 100% sure if the
> versioning is ok. At this point, the F20 branch will diverge from Rawhide.
> There's already a 1.4.0-12.fc21 build in rawhide. Is it ok for there to be a
> 1.4.0-12.fc20 build in F20 that's unrelated? I feel like maybe F20 should go
> to 1.4.0-13, and rawhide to 1.4.0-14 to preserve upgradepath. Does that make
> sense? If so, I'll submit an update after work tomorrow (or if anyone else
> would like to do it before then, feel free).

Youn could bump release in F20 branch in one of the following ways:

1.4.0-11.fc20 -> 1.4.0-11.1.fc20 -> 1.4.0-11.2.fc20 -> ...
1.4.0-11.fc20 -> 1.4.0-11.fc20.1 -> 1.4.0-11.fc20.1 -> ...

In either case upgrade path from F20 to F21 is retained.

(In reply to Gerard Ryan from comment #10)
> Or I could stop being such a silly goose and put in a conditional for the
> f21+ stuff. I'm not so good at thinking of these things late at night! :)
> I'll do that later and submit an update.

That works too, until the difference becomes too big to effectively maintain both versions using conditionals.

Comment 12 Gerard Ryan 2014-01-28 20:01:12 UTC
(In reply to Mikolaj Izdebski from comment #11)
> That works too, until the difference becomes too big to effectively maintain
> both versions using conditionals.

Good point, although there wouldn't necessarily be too many now, that number could grow a lot if we went down that path, and may not get cleaned up much.

I've gone with your first solution:
> 1.4.0-11.fc20 -> 1.4.0-11.1.fc20 -> 1.4.0-11.2.fc20 -> ...

Comment 13 Fedora Update System 2014-01-28 20:03:26 UTC
eclipse-m2e-core-1.4.0-11.1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/eclipse-m2e-core-1.4.0-11.1.fc20

Comment 14 Fedora Update System 2014-01-30 03:42:11 UTC
Package eclipse-m2e-core-1.4.0-11.1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing eclipse-m2e-core-1.4.0-11.1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-1810/eclipse-m2e-core-1.4.0-11.1.fc20
then log in and leave karma (feedback).

Comment 15 Mikolaj Izdebski 2014-01-31 08:54:32 UTC
Created attachment 857752 [details]
Backtrace

It's still not fixed for me, but there's an improvement.  I can see the list of archetypes and I can select one, but creating project fails (see attached log).

Comment 16 Gerard Ryan 2014-02-08 15:43:59 UTC
(In reply to Mikolaj Izdebski from comment #15)
> Created attachment 857752 [details]
> Backtrace
> 
> It's still not fixed for me, but there's an improvement.  I can see the list
> of archetypes and I can select one, but creating project fails (see attached
> log).

Yeah, I'm seeing that too. I'll try to have a look at it this weekend. I think it's probably due to the hacks I did to get this to build with maven 3.1.x. I might be able to backport some stuff from m2e-core-1.5 -- hopefully we'll get this working properly soon!

Comment 17 Fedora Update System 2014-02-09 03:53:20 UTC
eclipse-m2e-core-1.4.0-11.1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 18 John Himpel 2014-04-07 20:16:22 UTC
Gerard,

Sorry to take so long to respond.  $DAYJOB and $LIFE got in the way.

I have eclipse-m2e-core-1.5.0-11.1.fc20 installed.

When I click on New->Project->Maven Project, the New Maven Project wizard starts.  I select "Use default Workspace location" and click "Next".
An error message appears at the top of the next dialog box saying "No archetypes currently available.  The archetype list will refresh when the indexes finish updating."  For about 45 seconds, there is a considerable amount of network traffic and cpu utilitization.  Then both drop to normal idle usage levels.  The error message remains and nothing appears in the list of archetypes.

Any ideas?  I saw where Roland in Comment #6 said he had to increase the size of /tmp.  With the new systemd /tmp being a tempfs, I'm not sure how to go about doing this.

Perhaps there's a maven rpm that I'm missing?  I assumed that eclipse-m2e-core would install everything I needed, but maybe that's not the case.

Thanks.

Comment 19 Roland Grunberg 2014-04-08 14:41:08 UTC
RE Comment #18:

I don't see eclipse-m2e-core-1.5.0-11.1.fc20 even on koji, but it has been built for rawhide so that could probably be tested out. The first step would be to confirm that /tmp is in fact running out of space. You could do something like : watch -n1 -d 'du -sh /tmp' as root and see if the limit is reached. If this is the case, you can increase the size /tmp (assuming it's using tmpfs) with : mount -o remount,size=NBYTES /tmp .

Comment 20 Andreas Bierfert 2015-02-19 21:20:14 UTC
Still seeing this on f21. I doubt that this is a tmpfs issue, mine is ~8Gb atm.

Comment 21 John Himpel 2015-02-19 23:44:57 UTC
I've also tried it without the tmpfs and nothing changed.  I've run eclipse from the command line with all the debug options that I could find and nothing unusual appears.

Hopefully, now the devCon has just finished, some of the Java guys can look into this.

My symptoms are now somewhat different that the symptoms described originally.

1) Start Eclipse
2) File->New->Maven Project->Nex
The following message appears in the "New Maven Project" dialog box:
(A small red circle with a white "x" inside) No archetypes currently available.  The archetype list will refresh when the indexes finish updating.

In the Windows version, Eclipse fetches the various catalogs and presents a list of archetypes.  In Fedora, nothing happens.

Thanks.

Comment 22 Whistler 2015-04-08 07:36:08 UTC
I can confirm that m2e still does not work with fedora 21.

>  No archetypes currently available. The archetype list will refresh when the indexes finish updating.

...and no archetypes are shown there.

Comment 23 John Himpel 2015-05-09 20:55:24 UTC
Would this be a possible cause?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=409314

Comment 24 Fedora Update System 2015-12-13 01:04:46 UTC
eclipse-m2e-core-1.6.2-3.fc23 maven-indexer-5.1.1-8.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-27e4145ca1

Comment 25 Gerard Ryan 2015-12-13 01:10:22 UTC
(In reply to Fedora Update System from comment #24)
> eclipse-m2e-core-1.6.2-3.fc23 maven-indexer-5.1.1-8.fc23 has been submitted
> as an update to Fedora 23.
> https://bodhi.fedoraproject.org/updates/FEDORA-2015-27e4145ca1

I believe this update fixes this issue (on F23). I don't currently have the cycles to apply the changes to F22, as that branch of eclipse-m2e-core has diverged slightly (and is significantly older build than F23+), and I don't have an F22 machine to test it out on.

If anyone still needs this on F22, feel free to propose a patch!

Comment 26 Fedora Update System 2015-12-13 17:21:32 UTC
eclipse-m2e-core-1.6.2-3.fc23, maven-indexer-5.1.1-8.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update eclipse-m2e-core maven-indexer'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-27e4145ca1

Comment 27 Fedora Update System 2015-12-14 20:53:27 UTC
eclipse-m2e-core-1.6.2-4.fc23 maven-indexer-5.1.1-8.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-27e4145ca1

Comment 28 Fedora Update System 2015-12-15 10:55:00 UTC
eclipse-m2e-core-1.6.2-4.fc23, maven-indexer-5.1.1-8.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update eclipse-m2e-core maven-indexer'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-27e4145ca1

Comment 29 Fedora Update System 2015-12-18 07:52:56 UTC
eclipse-m2e-core-1.6.2-4.fc23, maven-indexer-5.1.1-8.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.