Uploaded image for project: 'Fedora Repository Project'
  1. Fedora Repository Project
  2. FCREPO-2579

Fcrepo: OSGI Deployment?



    • Type: Story
    • Status: Received
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Roadmap Theme:


      I would like to deploy fcrepo as OSGI in Karaf. I have made some noteworthy progress.

      Here is a summary of some issues:
      1. org.apache.activemq:activemq-spring:5.14.1 depends on org.apache.xbean:xbean-spring:3.18
      Problem: In the MANIFEST.MF for xbean-spring, the Import-Packages:
      org.springframework.beans;version="[ 2.5,4)!
      fcrepo-webapp depends on activemq-spring. This means that to deploy it, only spring releases < 4 will work. It is not possible to have multiple spring release dependencies, and many of the tests are using spring 4+ methods. I found the source code here: http://svn.apache.org/repos/asf/geronimo/xbean/trunk/xbean-spring/
      I have repackaged this with revised headers. It also needs to import several activemq packages.

      2. ModeShape Schematic API uses a TCCL.
      I filed an issue here: https://issues.jboss.org/browse/MODE-2711
      I have made this work by removing the CL from the getDb() method and using a "ServiceLoader Mediator" provided with Aries. I also ran into an issue https://groups.google.com/forum/#!topic/ops4j/lLEP1RMrk3M with an old version of mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle
      being provided by Pax Web, but have been able to override their provided feature with a newer version using Karaf's override.properties.
      3. Non-OSGI provided dependencies. Many of these are now provided by Apache ServiceMix. Here is an almost complete list of required bundles to get everything to resolve:

      I might be worthwhile to change the <dependencies> to point to ServiceMix instead of the original source.

      Other small issues: velocity tools (used in http-api) uses an old version of javax.servlet-api (2.3), but metrics uses a newer version. Solution is to exclude the old version.
      org.apache.http.annotation.NotThreadSafe (used in FedoreNodeIT); is removed in httpcore 4.4.6. this can be replaced with org.modeshape.schematic.annotation.NotThreadSafe;

      4. @Inject fails for cross-bundle implementations.
      Here is an example exception:
      Caused by: org.glassfish.hk2.api.MultiException: A MultiException has 4 exceptions. They are:
      1. org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at SystemInjecteeImpl(requiredType=ExternalContentService,parent=ContentLocationMessageBodyReader,qualifiers={},position=-1,optional=false,self=false,unqualified=null,155428528)
      2. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of org.fcrepo.http.commons.domain.ContentLocationMessageBodyReader errors were found
      I think that this occurs because a class in http-commons is trying to inject an implementation in kernel-modeshape via an interface in kernel-api and it cannot resolve it.

      AFAIK, using "traditional DI" across bundles is bad in OSGI because this breaks encapsulation. I guess that this is probably known already. IDK what the solution is (maybe Blueprint), but this may require some reengineering of the fcrepo service architecture to make it work.

      5. Velocity needs to be embedded in fcrepo-http-api because it needs to see the class path to load resources.




            • Assignee:
              christopher-johnson Christopher Johnson
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: