Helly everyone I'm currently also stuck with the "No index provider 'lucene' found" error that you all seem to have been able to work around. I have built and installed the 1.5-SNAPSHOT kernel from the bundle-friendly-classloader branch and installed it locally (mvn install). When I run the neo4j-osgi tests I still get the mentioned lucene error:
... [FelixDispatchQueue] DEBUG org.neo4j.examples.osgi.test-bundle - BundleEvent STOPPED ERROR: Bundle org.neo4j.examples.osgi.test-bundle [3] Error starting file:bundles/org.neo4j.examples.osgi.test-bundle_0.1.0.SNAPSHOT.jar (org.osgi.framework.BundleException: Activator start error in bundle org.neo4j.examples.osgi.test-bundle [3].) java.lang.IllegalArgumentException: No index provider 'lucene' found at org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:76) ... Failed tests: neo4jStartupTest(org.neo4j.examples.osgi.OSGiTest) bundleStartupTest(org.neo4j.examples.osgi.OSGiTest) Is there anything else I have to to so that I get the examples up and running? Best regards, James 2011/7/26 Nicolas Jouanin <nicolas.joua...@gmail.com>: > Glad to hear that ! > > 2011/7/25 Jörg Richter <j...@deepamehta.de> > >> >> Hi Peter, >> >> SUCCESS!!! >> >> "No index provider 'lucene' found" in OSGi is solved for the moment! >> >> Its exactly as you suggest: >> When using pax exam's native container no error shows up. >> When using pax exam's pax runner container the error shows up (which is >> correct OSGi behavoir). >> When using bundle-friendly-classloader branch of neo 1.5-SNAPSHOT kernel >> the error disappears! >> My neo4j-osgi-test project runs successful now! >> >> I'm looking forward to have a patch like yours in the next neo4j stable. >> >> Thank you and Toni very much for investigation. >> >> Cheers, >> Jörg >> >> >> On Jul 24, 2011, at 22:08, Peter Neubauer wrote: >> >> > Jörg, >> > there where several issues Toni and me found when looking at your >> > example. Thanks a lot! >> > >> > First of all, Pax Exam Player using the built-in native OSGi Runner is >> > not emulating the real platform classloading correctly. Toni is at >> > this one, the tests are switched to the PaxRunner instead, running in >> > its own process. >> > >> > Secondly, the Neo4j Service.java that is loading the classes and >> > resources is not providing a classloader, which in an OSGi bundle >> > defaults to a classloader that does not find the interesting classes >> > and services. With >> > >> > private static <T> Iterable<T> java6Loader( Class<T> type ) >> > { >> > try >> > { >> > @SuppressWarnings( "unchecked" ) Iterable<T> result = >> (Iterable<T>) >> > Class.forName( "java.util.ServiceLoader" ) >> > .getMethod( "load", Class.class, ClassLoader.class ) >> > .invoke( null, type, Service.class.getClassLoader() ); >> > return filterExceptions( result ); >> > } >> > catch ( Exception e ) >> > { >> > return null; >> > } >> > catch ( LinkageError e ) >> > { >> > return null; >> > } >> > } >> > >> > Everything works, but we need to discuss more what classloader to >> > chose in what contexts, as this might not be great in all >> > circumstances. >> > >> > Anyway, you can build the fixed kernel project from >> > https://github.com/neo4j/community/tree/bundle-friendly-classloader, >> > then build the https://github.com/neo4j/neo4j-osgi and you should be >> > able to start up your test project (see my pull request). >> > >> > Let me know if that works! >> > >> > /peter >> >> _______________________________________________ >> Neo4j mailing list >> User@lists.neo4j.org >> https://lists.neo4j.org/mailman/listinfo/user >> > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user