Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1356217

Summary: Import of org.apache.lucene.analysis in lucene-analyzers-common is too lax
Product: [Fedora] Fedora Reporter: Roland Grunberg <rgrunber>
Component: luceneAssignee: Roland Grunberg <rgrunber>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: high    
Version: rawhideCC: akurtako, eclipse-sig, hicham.haouari, java-sig-commits, jerboaa, krzysztof.daniel, msimacek, rgrunber
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: lucene-5.5.0-4.fc24 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-23 18:49:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Roland Grunberg 2016-07-13 18:06:12 UTC
I'm seeing the following after testing out a local Neon build :

java.lang.NoClassDefFoundError: org/apache/lucene/analysis/DelegatingAnalyzerWrapper
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:273)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:586)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:538)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:525)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:334)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:407)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:361)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:353)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at org.eclipse.mylyn.internal.tasks.index.ui.IndexReference.index(IndexReference.java:58)
	at org.eclipse.mylyn.internal.tasks.index.ui.commands.ResetIndexHandler$1.run(ResetIndexHandler.java:37)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.DelegatingAnalyzerWrapper cannot be found by org.apache.lucene.analyzers-common_5.5.0
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:398)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:361)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:353)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 18 more


lucene-analyzers-common lists an Import-Package on 'org.apache.lucene.analysis' with no version, so by default any version can satisfy this.

The problem is that the following units exist in Fedora 24 (or at least in my installation) :

IU: org.apache.lucene.core 5.5.0
* java.package/org.apache.lucene.analysis/5.5.0
IU: org.apache.lucene.core 3.6.2
* java.package/org.apache.lucene.analysis/3.6.2

Seems like a simple fix, but I wonder why it isn't inheriting the "[5.5,6)" range like all the other lucene entries.

Comment 1 Roland Grunberg 2016-07-13 18:21:32 UTC
To be honest, I couldn't understand how this could happen. I mean all I did was update an Eclipse build so running into the error made no sense.

Then I realized that my update also brought in eclipse-abrt, and eclipse-epp-logging, and behold :

osgi.wiring.package; bundle-symbolic-name="org.apache.lucene.core"; bundle-version:Version="3.6.2"; version:Version="3.6.2"; osgi.wiring.package="org.apache.lucene.analysis"<org.apache.lucene.core_3.6.2 [432]>
  org.eclipse.epp.logging.aeri.ide_1.100.0.201603241525 [435] imports

.. that exposed the issue.

Comment 2 Roland Grunberg 2016-07-14 16:55:50 UTC
This only seems to be an issue on F24 as rawhide seems to have the correct version range so my guess is maven-bundle-plugin has some improvements on rawhide. In case they can't be backported I've pushed http://pkgs.fedoraproject.org/cgit/rpms/lucene.git/commit/?id=6d771c87dc66611576f9935a04cbbf9b28680663 .

Comment 3 Fedora Update System 2016-07-15 11:14:26 UTC
lucene-5.5.0-4.fc24 eclipse-emf-2.12.0-1.fc24 eclipse-4.6.0-3.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7fb3470a9c

Comment 4 Fedora Update System 2016-07-15 19:25:09 UTC
eclipse-4.6.0-3.fc24, eclipse-emf-2.12.0-1.fc24, lucene-5.5.0-4.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7fb3470a9c

Comment 5 Fedora Update System 2016-07-23 18:49:23 UTC
eclipse-4.6.0-3.fc24, eclipse-emf-2.12.0-1.fc24, lucene-5.5.0-4.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.