Spring Data Neo4j
  1. Spring Data Neo4j
  2. DATAGRAPH-88

org.springframework.data.neo4j bundle imports *.impl.* packages from org.neo4j

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Complete
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: CORE
    • Labels:
    • Environment:
      Virgo 3.0.0.M04

      Description

      I'm trying to get SDG up and running in an OSGi environment on Virgo 3.0.0.M04.
      The bundle org.springframework.data.neo4j imports not exported packages from the org.neo4j bundle, i.e. "org.neo4j.index.impl.lucene". This gives the following error on virgo:

      [2011-05-12 15:12:48.436]  TCP Connection(2)-127.0.0.1 <DE0500E> Unable to install application from URI 'file:/C:/virgo-tomcat-server-3.0.0.M04/stage/neo4j.domain.jar'. Cannot satisfy constraints for bundle 'com.example.neo4j.domain' version '0.0.1.BUILD-SNAPSHOT'. Cannot resolve: com.example.neo4j.domain
          Resolver report:
              An Import-Package could not be resolved. Caused by missing constraint in bundle <com.example.neo4j.domain_0.0.1.BUILD-SNAPSHOT>
                   constraint: <Import-Package: org.springframework.data.graph.annotation; version="[1.0.0,1.1.0)">
              An Import-Package could not be resolved. Caused by missing constraint in bundle <org.springframework.data.neo4j_1.0.0.RELEASE>
                   constraint: <Import-Package: org.neo4j.index.impl.lucene; version="0.0.0">

      template.mf of the org.springframework.data.neo4j bundle should probably contain something like:

      Excluded-Imports: 
       org.neo4j.*.impl.*
      

      Other imported "implementation" packages that catched my eye:

      • org.neo4j.kernel.impl.core;version=0,
      • org.neo4j.kernel.impl.nioneo.store;version=0,
      • org.neo4j.kernel.impl.persistence;version=0,
      • org.neo4j.kernel.impl.transaction;version=0

      And BTW: There is no version number for the neo4j libs in template.mf, which sooner or later will cause a problem.

        Activity

        Hide
        Michael Hunger added a comment -

        I'm no expert in OSGi so I did just the minimal thing, adding bundlor information to the maven build. This is obviously not successful enough.

        So I would be very happy if you could checkout spring data graph, put in all the correct OSGi information and send me a pull request.

        Cheers

        Michael

        Show
        Michael Hunger added a comment - I'm no expert in OSGi so I did just the minimal thing, adding bundlor information to the maven build. This is obviously not successful enough. So I would be very happy if you could checkout spring data graph, put in all the correct OSGi information and send me a pull request. Cheers Michael
        Hide
        Michael Hunger added a comment -

        Can you perhaps provide a standalone test (or refer to a maven-plugin) that validates the OSGi conformance of the packaged spring-data graph jars?

        Thanks

        Michael

        Show
        Michael Hunger added a comment - Can you perhaps provide a standalone test (or refer to a maven-plugin) that validates the OSGi conformance of the packaged spring-data graph jars? Thanks Michael
        Hide
        Jean-Pierre Bergamin added a comment -

        With the "Exclude-Imports", the bundles can at least be resolved now (see this pull request).

        But as described here, the spring context can still not be loaded.

        Show
        Jean-Pierre Bergamin added a comment - With the "Exclude-Imports", the bundles can at least be resolved now (see this pull request ). But as described here , the spring context can still not be loaded.
        Hide
        Jean-Pierre Bergamin added a comment -

        I'll let you know when I find out more.

        Regarding testing: it would be interesting to see how all other spring bundles are tested so that they at least can be resolved. I'll see what I can do, but I cannot promise to deliver something regarding testing.

        Show
        Jean-Pierre Bergamin added a comment - I'll let you know when I find out more. Regarding testing: it would be interesting to see how all other spring bundles are tested so that they at least can be resolved. I'll see what I can do, but I cannot promise to deliver something regarding testing.
        Hide
        Jean-Pierre Bergamin added a comment -

        Simply excluding the impl packages from being imported will of course not work for the long run. The classes that SDG uses from the .impl. packages cannot be loaded and sooner or later a ClassNotFound Exception will occur. It should be investigated if SDG absolutely needs those implementation classes. If yes, the neo4j bundles must export them of course.

        BTW: I created a very simple SDG example application as a bundle for testing: https://github.com/ractive/sdg-bundle

        Show
        Jean-Pierre Bergamin added a comment - Simply excluding the impl packages from being imported will of course not work for the long run. The classes that SDG uses from the .impl. packages cannot be loaded and sooner or later a ClassNotFound Exception will occur. It should be investigated if SDG absolutely needs those implementation classes. If yes, the neo4j bundles must export them of course. BTW: I created a very simple SDG example application as a bundle for testing: https://github.com/ractive/sdg-bundle
        Hide
        Jean-Pierre Bergamin added a comment -

        This "Excluded-Imports" directive has to be removed again, since there still are many .impl. packages that are exported by neo4j and needed by SDG. Otherwise, there is not chance at all to get spring data neo4j get up and running within an osgi environment.

        Show
        Jean-Pierre Bergamin added a comment - This "Excluded-Imports" directive has to be removed again, since there still are many .impl. packages that are exported by neo4j and needed by SDG. Otherwise, there is not chance at all to get spring data neo4j get up and running within an osgi environment.
        Hide
        Michael Hunger added a comment -

        Merged James' pull request(s)

        Show
        Michael Hunger added a comment - Merged James' pull request(s)

          People

          • Assignee:
            Michael Hunger
            Reporter:
            Jean-Pierre Bergamin
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: