Nicolas, just pushed some more initialization along your lines, and have the test running with the output:
[~/code/neo/neo4j-osgi/examples] $mvn clean test [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Neo4j OSGi examples [INFO] task-segment: [clean, test] [INFO] ------------------------------------------------------------------------ [INFO] [clean:clean {execution: default-clean}] [INFO] Deleting /Users/peterneubauer/code/neo/neo4j-osgi/examples/target [WARNING] POM for 'biz.aQute:bndlib:pom:1.43.0:test' is invalid. Its dependencies (if any) will NOT be available to the current build. [WARNING] POM for 'biz.aQute:bndlib:pom:1.15.0:test' is invalid. Its dependencies (if any) will NOT be available to the current build. [INFO] [enforcer:enforce {execution: enforce-maven}] [INFO] [license:check {execution: check-licenses}] [INFO] Checking licenses... [INFO] [resources:resources {execution: default-resources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/peterneubauer/code/neo/neo4j-osgi/examples/src/main/resources [INFO] skip non existing resourceDirectory /Users/peterneubauer/code/neo/neo4j-osgi/examples/src/main/resources/META-INF [INFO] Copying 0 resource to META-INF [INFO] [compiler:compile {execution: default-compile}] [INFO] No sources to compile [INFO] [bundle:manifest {execution: bundle-manifest}] [WARNING] Warning in manifest for org.neo4j.examples:neo4j-osgi-examples:jar:0.1-SNAPSHOT : Superfluous export-package instructions: [null.*] [WARNING] Warning in manifest for org.neo4j.examples:neo4j-osgi-examples:jar:0.1-SNAPSHOT : Did not find matching referal for * [INFO] [resources:testResources {execution: default-testResources}] [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /Users/peterneubauer/code/neo/neo4j-osgi/examples/src/test/resources [INFO] Copying 0 resource to META-INF [INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Compiling 3 source files to /Users/peterneubauer/code/neo/neo4j-osgi/examples/target/test-classes [INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: /Users/peterneubauer/code/neo/neo4j-osgi/examples/target/surefire-reports ------------------------------------------------------- T E S T S ------------------------------------------------------- Running org.neo4j.examples.osgi.OSGiTest 300 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 2.1.0) created. Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-container-rbc:jar:2.1.0) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/exam/pax-exam-container-rbc/2.1.0/pax-exam-container-rbc-2.1.0.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.exam:pax-exam-extender-service:jar:2.1.0) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/exam/pax-exam-extender-service/2.1.0/pax-exam-extender-service-2.1.0.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.osgi:org.osgi.compendium:jar:4.2.0) as /Users/peterneubauer/.m2/repository/org/osgi/org.osgi.compendium/4.2.0/org.osgi.compendium-4.2.0.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.logging:pax-logging-api:jar:1.6.2) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/logging/pax-logging-api/1.6.2/pax-logging-api-1.6.2.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.ops4j.pax.logging:pax-logging-service:jar:1.6.2) as /Users/peterneubauer/.m2/repository/org/ops4j/pax/logging/pax-logging-service/1.6.2/pax-logging-service-1.6.2.jar Jul 17, 2011 5:52:07 PM org.ops4j.pax.url.mvn.internal.AetherBasedResolver resolve INFO: Resolved (org.neo4j:neo4j-osgi-bundle:jar:0.1-SNAPSHOT) as /Users/peterneubauer/.m2/repository/org/neo4j/neo4j-osgi-bundle/0.1-SNAPSHOT/neo4j-osgi-bundle-0.1-SNAPSHOT.jar [org.ops4j.pax.exam.rbc.internal.Activator] : Name, port or host is null. So this RBC remains inactive. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling SLF4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Jakarta Commons Logging API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Log4J API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling Avalon Logger API support. org.ops4j.pax.logging.pax-logging-api[org.ops4j.pax.logging.internal.Activator] : Enabling JULI Logger API support. [Framework Event Dispatcher] DEBUG org.ops4j.pax.logging.pax-logging-service - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.neo4j.neo4j-osgi-bundle - BundleEvent STARTED Opening database in embedded mode: [Start Level Event Dispatcher] INFO org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog/graphdb/nioneo_logical.log - Non clean shutdown detected on log [graphdb/nioneo_logical.log.1]. Recovery started ... [Start Level Event Dispatcher] INFO org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog//Users/peterneubauer/code/neo/neo4j-osgi/examples/graphdb/index/lucene.log - Non clean shutdown detected on log [/Users/peterneubauer/code/neo/neo4j-osgi/examples/graphdb/index/lucene.log.1]. Recovery started ... OK Populating it ... OK Hello, brave Neo4j world! [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles1594207755239724903UID - ServiceEvent REGISTERED [Start Level Event Dispatcher] DEBUG BuildByTinyBundlestinybundles1594207755239724903UID - ServiceEvent REGISTERED registered {org.neo4j.graphdb.GraphDatabaseService}={service.id=28} [Framework Event Dispatcher] DEBUG BuildByTinyBundlestinybundles1594207755239724903UID - BundleEvent STARTED [Framework Event Dispatcher] DEBUG org.eclipse.osgi - FrameworkEvent STARTLEVEL CHANGED [Framework Event Dispatcher] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - BundleEvent INSTALLED [Framework Event Dispatcher] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - BundleEvent RESOLVED [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c to be in PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c,PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc,PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791,PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature="PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c" and expression="org.ops4j.pax.exam.testforge.WaitForService;probe" [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc to be in PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c,PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc,PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791,PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature="PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc" and expression="org.ops4j.pax.exam.testforge.WaitForService;probe" [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-Executable to be in PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c,PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc,PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791,PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791 to be in PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c,PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc,PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791,PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature="PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791" and expression="org.ops4j.pax.exam.testforge.CountBundles;probe" [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Test PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36 to be in PaxExam-e6487fc8-91b9-41ab-b6fd-58102b1d000c,PaxExam-ea5274dd-3ea0-4d46-8130-ac5acbf80ffc,PaxExam-93c1c1ef-8ffd-4925-9426-21b648423791,PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36, [main] DEBUG org.ops4j.pax.exam.raw.extender.intern.Probe - Registering Service: org.ops4j.pax.exam.ProbeInvoker with Probe-Signature="PaxExam-40c38da3-eac3-4d4f-9d81-49a8f6de3b36" and expression="org.ops4j.pax.exam.testforge.BundlesInState;probe" [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - ServiceEvent REGISTERED [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - ServiceEvent REGISTERED [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - ServiceEvent REGISTERED [main] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - ServiceEvent REGISTERED [Framework Event Dispatcher] DEBUG org.ops4j.pax.exam.spi.probesupport.intern.DefaultResourceWriter_97e121c - BundleEvent STARTED Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.554 sec Results : Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 Cheers, /peter neubauer GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://startupbootcamp.org/ - Öresund - Innovation happens HERE. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Sun, Jul 17, 2011 at 3:02 PM, Nicolas Jouanin <nicolas.joua...@gmail.com> wrote: > Hi Peter, > > Thanks for initiating this work on OSGi bundle. > I've forked you repository and tried to make is work using this sample > activator [1]. My goal is to make my activator work when deployed on Felix > with the neo4j superbundle. > First of all, I had troubles to mvn clean install the bundle module. > maven-bundle-plugin is complaining about bundle.namespace property not set. > I've fixed it. > Then when deploying it on Felix I had an error saying that javax.transaction > couldn't be imported. Because this package is already included in > superbundle, I've removed it explicitally from the Import-Package directive. > You can see the changes here [2]. > Then I tried to make my bundle activated using felix and the following > bundles installed : > g! lb > START LEVEL 1 > ID|State |Level|Name > 0|Active | 0|System Bundle (3.2.2) > 1|Active | 1|Neo4j OSGi default bundle (0.1.0.SNAPSHOT) > 2|Active | 1|Apache Felix Bundle Repository (1.6.2) > 3|Active | 1|Apache Felix Gogo Command (0.8.0) > 4|Active | 1|Apache Felix Gogo Runtime (0.8.0) > 5|Active | 1|Apache Felix Gogo Shell (0.8.0) > 6|Resolved | 1|EscapeK - Neo4j OSGi how-to - Embedded client > (0.0.1.SNAPSHOT) > There are only felix core, neo4j superbundle and my test bundle. > So when starting felix I get the following trace : > ____________________________ > Welcome to Apache Felix Gogo > > g! Opening database in embedded mode: 17 juil. 2011 14:57:08 > org.neo4j.kernel.impl.transaction.xaframework.XaLogicalLog doInternalRecovery > INFO: Non clean shutdown detected on log [graphdb/nioneo_logical.log.1]. > Recovery started ... > OK > Populating it ... OK > Hello, brave Neo4j world! > ERROR: Bundle org.escapek.neo4j-osgi-howto.embedded-client [6] Error starting > file:/Users/nico/Dev/felix-framework-3.2.2/bundle/org.escapek.neo4j-osgi-howto.embedded-client_0.0.1-SNAPSHOT.jar > (org.osgi.framework.BundleException: Activator start error in bundle > org.escapek.neo4j-osgi-howto.embedded-client [6].) > java.lang.IllegalArgumentException: No index provider 'lucene' found > at > org.neo4j.kernel.IndexManagerImpl.getIndexProvider(IndexManagerImpl.java:76) > at > org.neo4j.kernel.IndexManagerImpl.findIndexConfig(IndexManagerImpl.java:116) > at > org.neo4j.kernel.IndexManagerImpl.getOrCreateIndexConfig(IndexManagerImpl.java:178) > at > org.neo4j.kernel.IndexManagerImpl.getOrCreateNodeIndex(IndexManagerImpl.java:267) > at > org.neo4j.kernel.IndexManagerImpl.forNodes(IndexManagerImpl.java:255) > at > org.neo4j.kernel.IndexManagerImpl.forNodes(IndexManagerImpl.java:249) > at > org.escapek.neo4jOsgiHowto.embeddedClient.EmbeddedClientActivator.start(EmbeddedClientActivator.java:65) > at > org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:629) > at org.apache.felix.framework.Felix.activateBundle(Felix.java:1904) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1822) > at > org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192) > at > org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266) > at java.lang.Thread.run(Thread.java:680) > > So everything works fine (open database, populate it and register service) > until the activator tries to register IndexProvider service. I then get the > previous exception which reminds me of something ... > > May be you can have a look at the stack trace to look for the error cause. > > NJ > > > [1] - > https://github.com/njouanin/neo4j-osgi-howto/blob/master/embedded-client/src/main/java/org/escapek/neo4jOsgiHowto/embeddedClient/EmbeddedClientActivator.java > [2] - > https://github.com/njouanin/neo4j-osgi/commit/4ec3eaf58b514d806fde3e48dd942c00fdfddf70 > > Le 5 juil. 2011 à 22:41, Peter Neubauer a écrit : > >> Hi all, >> I just pushed an initial working bundle-build to >> https://github.com/neo4j/neo4j-osgi. You can see the working test in >> https://github.com/neo4j/neo4j-osgi/blob/master/examples/src/test/java/org/neo4j/examples/osgi/OSGiTest.java >> that waits for the Activator to instantiate and register a >> GraphDatabaseService and a LuceneIndex. >> >> This should be tweaked, but maybe you can use the bundle project >> https://github.com/neo4j/neo4j-osgi/blob/master/bundle/pom.xml , which >> is just one pom.xml, as a blueprint for your OSGi environment Neo4j >> bundle. >> >> Right now JTA and others are drawn into the bundle, which might be too >> much, but I think you get the picture. >> >> This works even with the Java Service Loader architecture. Feel free >> to fork and tune the bundles exports, and add more tests to it. >> >> WDYT? >> >> Cheers, >> >> /peter neubauer >> >> GTalk: neubauer.peter >> Skype peter.neubauer >> Phone +46 704 106975 >> LinkedIn http://www.linkedin.com/in/neubauer >> Twitter http://twitter.com/peterneubauer >> >> http://www.neo4j.org - Your high performance graph database. >> http://startupbootcamp.org/ - Öresund - Innovation happens HERE. >> http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. >> _______________________________________________ >> 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