Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369792

Summary: Lucene & Solr 3.5
Product: [Tools] Orbit Reporter: Gunnar Wagenknecht <gunnar>
Component: bundlesAssignee: Gunnar Wagenknecht <gunnar>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: jarthana, john.arthorne
Version: unspecified   
Target Milestone: Juno M6   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=365693
Whiteboard:
Bug Depends on:    
Bug Blocks: 370484    
Attachments:
Description Flags
Dependencies for Orion
none
Stacktrace none

Comment 1 Gunnar Wagenknecht CLA 2012-03-19 16:49:32 EDT
Committed!
Comment 2 Jay Arthanareeswaran CLA 2012-03-20 10:05:32 EDT
Created attachment 212915 [details]
Dependencies for Orion

Thanks, Gunnar. I just pulled the lucene and solr projects into my Orion workspace and had to make these changes to make it work. Now, I am not very sure if this was absolutely necessary. Is this change really required and should it go to the orbit projects or is there a way I can make it work by just making changes in the Orion projects? TIA
Comment 3 Gunnar Wagenknecht CLA 2012-03-20 15:37:52 EDT
(In reply to comment #2)
> Thanks, Gunnar. I just pulled the lucene and solr projects into my Orion
> workspace and had to make these changes to make it work.

I'm not sure about that spatial dependency but the IO makes sense. I'm pretty sure I ran a PDE analysis but it likely didn't catch all the required dependencies. I'll add Commons IO.

Meanwhile, Can you test with the spatial package being optional?
Comment 4 Jay Arthanareeswaran CLA 2012-03-20 23:36:52 EDT
(In reply to comment #3)
> Meanwhile, Can you test with the spatial package being optional?

Hmm.. It works with optional. I don't know why it produced an error earlier. Perhaps a clean+build could have helped me. Anyway, with the common.io.* inclusion, everything should work well now. Thanks!
Comment 5 Jay Arthanareeswaran CLA 2012-03-21 00:56:50 EDT
I see the version of the commons IO has been upped to 2.0.0 but I am unable to find the project in the corresponding branch (v2_0_0) in orbit. Am I looking at the wrong place?
Comment 6 Gunnar Wagenknecht CLA 2012-03-21 02:14:36 EDT
Commons IO 2.0.0 is not in Orbit but 2.0.1 is.
Comment 7 Jay Arthanareeswaran CLA 2012-03-21 02:35:19 EDT
(In reply to comment #6)
> Commons IO 2.0.0 is not in Orbit but 2.0.1 is.

Thanks, I looked around in few other similar sounding branches, such as 2.2.0, but missed out that one. Everything looks alright now.
Comment 8 Jay Arthanareeswaran CLA 2012-03-21 03:26:00 EDT
(In reply to comment #4)
> Hmm.. It works with optional. I don't know why it produced an error earlier.
> Perhaps a clean+build could have helped me. Anyway, with the common.io.*
> inclusion, everything should work well now. Thanks!

It compiles alright. But at run time, I get a ClassDefNotFoundError. As an alternative, I am importing the spatial package from Orion project that uses solr/core. Do you think that's the way to go? The Orion project is using the spatial classes only indirectly, i.e. through solr/core.
Comment 9 Gunnar Wagenknecht CLA 2012-03-21 03:48:02 EDT
(In reply to comment #8)
> It compiles alright. But at run time, I get a ClassDefNotFoundError.

Can you post the stack? Can you also issue a "diag <solr.core.bundle.id>" on the OSGi console and print the output here?

I'm wondering how the package import in your Orion bundles is related. Usually, Equinox should wire the optional dependencies all in if they are available at runtime. If it's required for some search functionality then we'll have to make more packages mandatory. I just tried to be conservative in the first run.
Comment 10 Jay Arthanareeswaran CLA 2012-03-21 06:47:31 EDT
(In reply to comment #9)
> I'm wondering how the package import in your Orion bundles is related. Usually,
> Equinox should wire the optional dependencies all in if they are available at
> runtime. If it's required for some search functionality then we'll have to make
> more packages mandatory. I just tried to be conservative in the first run.

It's essentially the same problem as the one I reported few comments above with the spatial package. It works either when I make the package mandatory or when I import it in my project.
Comment 11 Jay Arthanareeswaran CLA 2012-03-21 06:48:54 EDT
Created attachment 212987 [details]
Stacktrace

The attachment has the stack trace with the NoClassDefFoundError.

And the osgi command produces this:

osgi> diag <solr.core.bundle.id>
2012-03-21 16:16:50.901 [Finalizer thread] ERROR org.apache.solr.core.SolrCore - REFCOUNT ERROR: unreferenced org.apache.solr.core.SolrCore@71067106 (Eclipse Web Search) has a reference count of 1
gogo: IllegalArgumentException: Cannot coerce diag(String) to any of [(long[])]
Comment 12 Gunnar Wagenknecht CLA 2012-03-21 08:52:32 EDT
(In reply to comment #11)
> osgi> diag <solr.core.bundle.id>

Sorry, I wasn't clear enough. You need to replace "<solr.core.bundle.id>" with the number (bundle id) of the Solr Core bundle. You can get that number using the "ss solr" command.
Comment 13 Jay Arthanareeswaran CLA 2012-03-21 11:06:18 EDT
Here is it:

osgi> diag 33
reference:file:/C:/work/Orion/workspace/org.apache.solr.core/ [33]
  Direct constraints which are unresolved:
    Missing optionally imported package org.apache.commons.csv_[1.0.0,2.0.0).
    Missing optionally imported package org.apache.lucene.spatial_3.5.0.
    Missing optionally imported package org.apache.lucene.spatial.geohash_3.5.0.
    Missing optionally imported package org.apache.lucene.spatial.geometry_3.5.0.
    Missing optionally imported package org.apache.lucene.spatial.geometry.shape_3.5.0.
    Missing optionally imported package org.apache.lucene.spatial.tier_3.5.0.
    Missing optionally imported package org.apache.lucene.spatial.tier.projections_3.5.0.
    Missing optionally imported package org.mortbay.jetty_6.1.0.
    Missing optionally imported package org.mortbay.jetty.servlet_6.1.0.
    Missing optionally imported package org.mortbay.log_6.1.0.
Comment 14 Gunnar Wagenknecht CLA 2012-03-21 11:57:16 EDT
Thanks, can you also check if there is a bundle which exports the package, i.e. is the relevant Lucene bundle installed and resolved?
Comment 15 Jay Arthanareeswaran CLA 2012-03-26 01:34:48 EDT
(In reply to comment #14)
> Thanks, can you also check if there is a bundle which exports the package, i.e.
> is the relevant Lucene bundle installed and resolved?

I have the org.apache.lucene.spatial project in my workspace and the manifest has something like this:

Bundle-SymbolicName: org.apache.lucene.spatial
Bundle-Version: 3.5.0.qualifier
Export-Package: org.apache.lucene.spatial;version="3.5.0",
 org.apache.lucene.spatial.geohash;version="3.5.0",
...
...