[ 
https://issues.apache.org/jira/browse/JCR-3917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15037547#comment-15037547
 ] 

Rino van Wijngaarden commented on JCR-3917:
-------------------------------------------

One step closer now!
the JcrUtils.getRepository(uri) calls 
ServiceRegistry.lookupProviders(RepositoryFactory.class) which in turn calls 
ServiceLoader.load(providerClass). The ServiceLoader pattern gives problems in 
OSGi 
(see http://aries.apache.org/modules/spi-fly.html)

I wrapped the jackrabbit-jcr2dav-spifly jar with a 
<SPI-Provider>*</SPI-Provider> in the MANIFEST and this part seems to
work given the "serviceloader.mediator" property in the osgi console below.
The 'consumer' part (my jar) howerever, still does not 'see' the 
RepositoryFactory. I tried
*,  javax.imageio.spi.ServiceRegistry#lookupProviders and 
javax.imageio.spi.ServiceRegistry#lookupProviders(java.lang.Class) in the 
<SPI-Consumer> in the manifest but to no avail.

{code}
JBossFuse:admin@root> list | grep jcr2dav
[ 277] [Active     ] [            ] [       ] [   80] jackrabbit-jcr2dav-spifly 
(2.11.2)
[ 278] [Active     ] [            ] [       ] [   80] 
wrap_mvn_org.apache.jackrabbit_jackrabbit-jcr2dav_2.11.2 (0)
JBossFuse:admin@root> ls 277

jackrabbit-jcr2dav-spifly (277) provides:
-----------------------------------------
.org.apache.aries.spifly.provider.implclass = 
org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory
objectClass = [javax.jcr.RepositoryFactory]
service.id = 614
serviceloader.mediator = 267
JBossFuse:admin@root> ls 278
JBossFuse:admin@root>
{code}

> OSGi errors when running jackrabbit 2.11 in Karaf  2.4 / Felix 4.x
> ------------------------------------------------------------------
>
>                 Key: JCR-3917
>                 URL: https://issues.apache.org/jira/browse/JCR-3917
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>          Components: jackrabbit-core
>    Affects Versions: 2.10.1, 2.11.1, 2.11.2
>         Environment: Mac OS X 10.10.5, Apache Karaf 2.4.x
>            Reporter: Rino van Wijngaarden
>
> Hi,
> I'm trying to use JackRabbit 2.11.1 to connect to a remote repo (using 
> jackrabbit-jcr-rmi). The bundles run in JBoss Fuse 6.2, which has Apache 
> Karaf 2.4 / Felix 4.4 under the hood. On startup i get the exception below.
> If i try to use jackrabbit-bundle i get 
> "Missing Constraint: Import-Package: com.ibm.db2.jcc; version="0.0.0""
> So i'm confused, is JackRabbit 2.x OSGi ready? or do i need to use Sling or 
> Oak , or .... ?
> Caused by: org.osgi.framework.BundleException: Uses constraint violation. 
> Unable to resolve bundle revision 
> wrap_mvn_org.apache.jackrabbit_jackrabbit-core_2.11.1 [270.0] because it 
> exports package 'org.apache.jackrabbit.core.config' and is also exposed to it 
> from bundle revision org.apache.jackrabbit.jackrabbit-data [276.0] via the 
> following dependency chain:
>   wrap_mvn_org.apache.jackrabbit_jackrabbit-core_2.11.1 [270.0]
>     import: (osgi.wiring.package=org.apache.jackrabbit.core.data.db)
>      |
>     export: osgi.wiring.package=org.apache.jackrabbit.core.data.db; 
> uses:=org.apache.jackrabbit.core.config
>     export: osgi.wiring.package=org.apache.jackrabbit.core.config
>   org.apache.jackrabbit.jackrabbit-data [276.0]
>       at 
> org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4006)[org.apache.felix.framework-4.4.1.jar:]
>       at 
> org.apache.felix.framework.Felix.startBundle(Felix.java:2045)[org.apache.felix.framework-4.4.1.jar:]
>       at 
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)[org.apache.felix.framework-4.4.1.jar:]
>       at 
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)[org.apache.felix.framework-4.4.1.jar:]
>       at 
> org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeatures(FeaturesServiceImpl.java:546)[9:org.apache.karaf.features.core:2.4.0.redhat-620133]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to