Quantcast

How can I enable reference URL handler?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How can I enable reference URL handler?

Alexey Romanov
I have this file under ${karaf.home}/features/odp_server_features.xml:

<?xml version="1.0" encoding="UTF-8"?>
<features name="ODP-Server-Features">
        <feature name="reference" version="0.1.0">
                <bundle start-level="5">mvn:org.ops4j.base/ops4j-base-lang/1.3.0</bundle>
                <bundle start-level="5">mvn:org.ops4j.base/ops4j-base-util-property/1.3.0</bundle>
                <bundle start-level="5">mvn:org.ops4j.pax.swissbox/pax-swissbox-property/1.5.0</bundle>
                <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-commons/1.4.0.RC1</bundle>
                <bundle start-level="5">mvn:org.ops4j.pax.url/pax-url-reference/1.4.0.RC1</bundle>
        </feature>
        <feature name="ODP-Server" version="0.1.0">
                <bundle>mvn:commons-pool/commons-pool/1.5.4</bundle>
                <bundle>mvn:commons-dbcp/commons-dbcp/1.4</bundle>
                <bundle>mvn:commons-collections/commons-collections/3.2.1</bundle>
                <bundle>mvn:commons-lang/commons-lang/2.4</bundle>
                <bundle>mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1</bundle>
                <bundle>mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1</bundle>
                <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.13.1_4</bundle>
                <bundle start-level="50">mvn:org.apache.openjpa/openjpa/2.2.0</bundle>
                <bundle>mvn:org.apache.felix/org.apache.felix.gogo.runtime/0.10.0</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.karaf.db/generated/ru.focusmedia.odp.server.karaf.db.jar</bundle>
                <bundle>file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.org.apache.commons.dbcp.dynamic-import/generated/ru.focusmedia.odp.server.org.apache.commons.dbcp.dynamic-import.jar</bundle>
                <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.javax-inject/1_2</bundle>
                <bundle>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.cglib/2.2.2_1</bundle>
                <bundle>mvn:com.mysema.commons/mysema-commons-lang/0.2.2</bundle>
                <bundle>mvn:com.mysema.querydsl/querydsl-core/2.5.0</bundle>
                <!-- <bundle>mvn:com.mysema.querydsl/querydsl-core/2.5.1</bundle> -->
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/cnf/repo/com.mysema.querydsl.jpa/com.mysema.querydsl.jpa-2.5.0.jar</bundle>
<!-- temp until 2.5.1 -->
                <bundle>mvn:com.google.guava/guava/12.0</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.jsr-275/generated/ru.focusmedia.jsr-275.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.jsr-305/generated/ru.focusmedia.jsr-305.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.comms/generated/ru.focusmedia.comms.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.concurrent/generated/ru.focusmedia.concurrent.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.api/generated/ru.focusmedia.odp.server.api.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.datastore.api/generated/ru.focusmedia.odp.server.datastore.api.jar</bundle>
                <bundle>mvn:org.apache.derby/derby/10.8.2.2</bundle>
                <bundle>mvn:org.ancoron.postgresql/org.postgresql/9.1.901.jdbc4.1-rc3</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.datastore.datasource/generated/ru.focusmedia.odp.server.datastore.datasource.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.datastore.jpa/generated/ru.focusmedia.odp.server.datastore.jpa.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.datastore.jpa/generated/ru.focusmedia.odp.server.datastore.jpa.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.drivers.api/generated/ru.focusmedia.odp.server.drivers.api.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.sspd.api/generated/ru.focusmedia.odp.server.sspd.api.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.sspd.impl/generated/ru.focusmedia.odp.server.sspd.impl.jar</bundle>
                <bundle>reference:file:///home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.drivers.test/generated/ru.focusmedia.odp.server.drivers.test.jar</bundle>
        </feature>
</features>

and org.apache.karaf.features.cfg:

#
# Comma separated list of features repositories to register by default
#
featuresRepositories=mvn:org.apache.karaf.assemblies.features/standard/2.2.7/xml/features,mvn:org.apache.karaf.assemblies.features/enterprise/2.2.7/xml/features,file:////home/aromanov/workspaces/odp-server/ru.focusmedia.odp.server.karaf.launcher/features/odp_server_features.xml

#
# Comma separated list of features to install at startup
#
featuresBoot=config,ssh,management,kar,jpa,jndi,transaction,war,reference,ODP-Server

When I remove /data and start Karaf, reference feature is _not_
installed. Instead Karaf begins installing ODP-Server and fails
(unsurprisingly). If I do "karaf@root> features:install reference", it
succeeds, but installing ODP-Server still fails.

service:list shows URLStreamHandlerService is not provided:

OPS4J Pax Url - reference: (104) provides:
------------------------------------------
org.osgi.service.cm.ManagedService


Yours, Alexey Romanov
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I enable reference URL handler?

Alexey Romanov
Actually, it turns out that reference: URL works for installing files:

karaf@root> install reference:file:/home/aromanov/workspaces/odp-server/ru.focusmedia.jsr-275/generated/ru.focusmedia.jsr-275.jar
Bundle ID: 105

but not for features!

karaf@root> feature:install ODP-Server
Error executing command: Unknown protocol: reference

Why could that be?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I enable reference URL handler?

Freeman-2
Hi,

As you put ODP-Server in featuresBoot, so the reference URLStreamHandlerService should be available at very early stage, so you need put pax-url-reference bundle into $KARAF_HOME/etc/startup.properties,  just like what we do for 
org/ops4j/pax/url/pax-url-mvn/1.2.8/pax-url-mvn-1.2.8.jar=5
org/ops4j/pax/url/pax-url-wrap/1.2.8/pax-url-wrap-1.2.8.jar=5

Basically you need add pax-url-reference bundle in startup.properties, also you need ensure add this bundle in $KARAF_HOME/system folder, as when load bundles from startup.properties, won't use mvn to download it remotely, so need ensure it's on your local disk.

Take a look at how we do for pax-url-mvn and pax-url-wrap, do same for the pax-reference.

Freeman
On 2012-5-22, at 下午2:36, Alexey Romanov wrote:

Actually, it turns out that reference: URL works for installing files:

karaf@root> install
reference:file:/home/aromanov/workspaces/odp-server/ru.focusmedia.jsr-275/generated/ru.focusmedia.jsr-275.jar
Bundle ID: 105

but not for features!

karaf@root> feature:install ODP-Server
Error executing command: Unknown protocol: reference

Why could that be?

--
View this message in context: http://karaf.922171.n3.nabble.com/How-can-I-enable-reference-URL-handler-tp3988050p4006097.html
Sent from the Karaf - User mailing list archive at Nabble.com.

---------------------------------------------
Freeman Fang

FuseSource
Twitter: freemanfang










Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I enable reference URL handler?

Alexey Romanov
Great, thank you!

Yours, Alexey Romanov


On Tue, May 22, 2012 at 11:47 AM, Freeman-2 [via Karaf]
<[hidden email]> wrote:

> Hi,
>
> As you put ODP-Server in featuresBoot, so the reference
> URLStreamHandlerService should be available at very early stage, so you need
> put pax-url-reference bundle into $KARAF_HOME/etc/startup.properties,  just
> like what we do for
> org/ops4j/pax/url/pax-url-mvn/1.2.8/pax-url-mvn-1.2.8.jar=5
> org/ops4j/pax/url/pax-url-wrap/1.2.8/pax-url-wrap-1.2.8.jar=5
>
> Basically you need add pax-url-reference bundle in startup.properties, also
> you need ensure add this bundle in $KARAF_HOME/system folder, as when load
> bundles from startup.properties, won't use mvn to download it remotely, so
> need ensure it's on your local disk.
>
> Take a look at how we do for pax-url-mvn and pax-url-wrap, do same for the
> pax-reference.
>
> Freeman
> On 2012-5-22, at 下午2:36, Alexey Romanov wrote:
>
> Actually, it turns out that reference: URL works for installing files:
>
> karaf@root> install
> reference:file:/home/aromanov/workspaces/odp-server/ru.focusmedia.jsr-275/generated/ru.focusmedia.jsr-275.jar
> Bundle ID: 105
>
> but not for features!
>
> karaf@root> feature:install ODP-Server
> Error executing command: Unknown protocol: reference
>
> Why could that be?
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/How-can-I-enable-reference-URL-handler-tp3988050p4006097.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:[hidden email][hidden email]
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: http://weibo.com/u/1473905042
>
>
>
>
>
>
>
>
>
>
>
>
> ________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://karaf.922171.n3.nabble.com/How-can-I-enable-reference-URL-handler-tp3988050p4006193.html
> To unsubscribe from How can I enable reference URL handler?, click here.
> NAML
Loading...