You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by hsinchen <hc...@gmail.com> on 2015/04/15 09:42:01 UTC

Cave - HTTP Wrapper Service

Hi,

I could not access the Cave repository from a remote Karaf with obr. 
In remote karaf:
1. feature:install obr
2. obr:url-add cave repository url
3. obr:list and obr:info -> ok
4. use browser to access http://cave:8181/cave/my-repository.xml -> ok
At 3 and 4, the bundle url is like "file:/D:/xxxx. That is the Cave server's
local disk. But, not http://...
5. obr:deploy  -> not ok (can not find bundle in file:/D:/xxx)
5. use browser to access http://cave:8181/cave/bundlexxxxx.jar -> not ok
(can not find bundle in file:/D:/xxx)

Please help to advise it. Thanks.



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
Yes. 

I tried 
1. cave:repository-create my9
2. cave:repository-populate my9 file:/d:/maven/.m2/repository
The problem is that the uri is not http wrapper

Then, tired
cave:repository-create -l file:///d:/maven/.m2/repository m24
-> Error executing command: Error accessing
file:/d:/apache-karaf-3.0.3/file:/d:/maven/.m2/repository

cave:repository-create -l file:/d:/maven/.m2/repository m25
-> Error executing command: Error accessing
file:/d:/apache-karaf-3.0.3/file:/d:/maven/.m2/repository

cave:repository-create -l d:/maven/.m2/repository m26
-> OK, but no repository xml and /cave/m26 folder generated.



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4040584.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by Achim Nierbeck <bc...@googlemail.com>.
As this is windows does the user running Karaf have the privileges to
access and alter those directories?

Regards, Achim

sent from mobile device
Am 27.05.2015 2:17 vorm. schrieb "hsinchen" <hc...@gmail.com>:

> Hi,
>
> I have tried to create a Cave repository by cave:repository-create -l
> d:/maven/.m2/repository m2. But, no repository xml and m2 folder generated.
> If using file:/d:/xxx, then it would show error below.
>
> Error executing command: Error accessing
> file:/d:/apache-karaf-3.0.3/file:/d:/maven/.m2/repository
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4040581.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
Hi,

I have tried to create a Cave repository by cave:repository-create -l
d:/maven/.m2/repository m2. But, no repository xml and m2 folder generated.
If using file:/d:/xxx, then it would show error below.

Error executing command: Error accessing
file:/d:/apache-karaf-3.0.3/file:/d:/maven/.m2/repository



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4040581.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update.

Maybe the problem is related to this:

https://issues.apache.org/jira/browse/KARAF-3727

As the URL should be related, and it's actually not on Windows, the http 
wrapper uses the absolute path (not the relative as it should).

I gonna fix that for next release.

As a workaround, you may try to use -l option when creating the repository.

Regards
JB

On 05/22/2015 09:26 AM, hsinchen wrote:
> I have tested it again.
> 1. Download Karar 3.0.3 adn Unzip it
> 2. Set JDK 1.7 and start it
> 3. feature:repo-add
> mvn:org.apache.karaf.cave/apache-karaf-cave/3.0.0/xml/features
> 4. feature:install cave-server
> 5. cave:repository-create my-repository
> 6. cave:repository-populate my-repository file:/d:/maven/.m2/repository
> 7. http://localhost:8181/cave/my-repository-repository.xml
> 8. obr:info org.apache.servicemix.bundles.commons-dbcp
>
> The url is uri:
> file:/D:/apache-karaf-3.0.3Cavea/cave/my-repository/org.apache.servicemix.bundles.commons-dbcp-1.4_3.jar
>
> 9. by browse
> http://localhost:8181/cave/my-repository-repository.xml
>
> The url is uri:
> file:/D:/apache-karaf-3.0.3Cavea/cave/my-repository/org.apache.servicemix.bundles.commons-dbcp-1.4_3.jar
>
> No HTTP Wrapper.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4040539.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
I have tested it again.
1. Download Karar 3.0.3 adn Unzip it
2. Set JDK 1.7 and start it
3. feature:repo-add
mvn:org.apache.karaf.cave/apache-karaf-cave/3.0.0/xml/features
4. feature:install cave-server
5. cave:repository-create my-repository
6. cave:repository-populate my-repository file:/d:/maven/.m2/repository
7. http://localhost:8181/cave/my-repository-repository.xml
8. obr:info org.apache.servicemix.bundles.commons-dbcp

The url is uri:
file:/D:/apache-karaf-3.0.3Cavea/cave/my-repository/org.apache.servicemix.bundles.commons-dbcp-1.4_3.jar

9. by browse
http://localhost:8181/cave/my-repository-repository.xml

The url is uri:
file:/D:/apache-karaf-3.0.3Cavea/cave/my-repository/org.apache.servicemix.bundles.commons-dbcp-1.4_3.jar

No HTTP Wrapper.



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4040539.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
I means that you can just obr:deploy a bundle in a karaf a which the Cave is
installed. If a remote Karaf B wants to obr:deploy a bunlde from the karaf
A, it will fail. Just like what I met. The HTTP Wrapper doesn't work. 

As I posted early, if Karaf B adds the Karaf A (with Cave) as OBR
repository, it will show the file system path but not http path in url when
browsing the repository or provisioning.



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4040148.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Not sure I follow you. What do you mean by "local" provisioning, but not 
for remote Karaf ?

Cave can proxy remote repo, and Cave can be used by remote Karaf (as 
soon as you update etc/org.ops4j.pax.url.mvn.cfg file or use OBR).

Regards
JB

On 04/23/2015 05:13 PM, hsinchen wrote:
> Ok!
>
> Cave seems only support local provision, but not for remote karaf. The HTTP
> Wrapper is only for remote download by a browser from Cave host. You could
> not execute obr:deploy or obr:start command in a karaf without Cave
> installation.
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039950.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
Ok!

Cave seems only support local provision, but not for remote karaf. The HTTP
Wrapper is only for remote download by a browser from Cave host. You could
not execute obr:deploy or obr:start command in a karaf without Cave
installation.




--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039950.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
Hi, JB,

Try 3 ways
1. Manually put org.foo.paint-4.0.0.jar into my-repository and run
cave:repository-update my-repository
2. Use cave:repository-upload my-repository
file:/D:/apache-karaf-3.0.3/cave/org.foo.paint-4.0.0.jar
3. Also try to populate my local Maven repository for other bundles use the
command cave:repository-populate my-repository file:D:/maven/.m2/repository

I could browse them with browser or download them. But, the url of each
bundle in http://cave:8181/cave/my-repository-repository.xml is file path
like <resource id="org.foo.paint/4.0.0" symbolicname="org.foo.paint"
presentationname="paint"
uri="file:/D:/apache-karaf-3.0.3/cave/my-repository/org.foo.paint-4.0.0.jar"
version="4.0.0"> 

Thanks.



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039735.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Do you mind to share the cave command that you did ?

Just to see if the cave repo is correct populated with repository.xml.

Thanks,
Regards
JB

On 04/15/2015 04:44 PM, hsinchen wrote:
> Still no idea why the error occurs
>
> Use obr:deploy org.aaaa.bbbb (symbolic name) -> not ok. The message is
> Error accessing
> file:/D:/apache-karaf-3.0.3/cave/my-repository/org.aaaa.bbbb-version.jar
>
> The url of each bundle in http://cave:8181/cave/my-repository-repository.xml
> is a file path "file:/D:/karaf-3.0.3/cave/my-repoisitory/xxx", but not
> http://cave:8181/my-repository/xxx.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039723.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
Still no idea why the error occurs

Use obr:deploy org.aaaa.bbbb (symbolic name) -> not ok. The message is 
Error accessing
file:/D:/apache-karaf-3.0.3/cave/my-repository/org.aaaa.bbbb-version.jar 

The url of each bundle in http://cave:8181/cave/my-repository-repository.xml
is a file path "file:/D:/karaf-3.0.3/cave/my-repoisitory/xxx", but not
http://cave:8181/my-repository/xxx.



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039723.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Cool ;)

Regards
JB

On 04/15/2015 11:05 AM, hsinchen wrote:
> Hi JB,
>
> Correct my question!
>
> 1. Use http://cave:8181/cave/my-repository.xml. The url is the file path
> (file:/D:/karaf-3.0.3/cave/my-repoisitory/xxx), but not
> http://cave:8181/my-repository/xxx
> 2. Use browser to access http://cave:8181/cave/org.aaaa.bbbb-version.jar ->
> ok. The jar file could be downloaded.
> 3. Use obr:deploy org.aaaa.bbbb (symbolic name) -> not ok. The message is
> Error accessing
> file:/D:/apache-karaf-3.0.3/cave/my-repository/org.aaaa.bbbb-version.jar
>
> Just follows the link to add bundles into Cave repository.
> http://karaf.apache.org/manual/cave/latest/user-guide/populate-repository.html
>
> Thanks
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039703.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Cave - HTTP Wrapper Service

Posted by hsinchen <hc...@gmail.com>.
Hi JB,

Correct my question! 

1. Use http://cave:8181/cave/my-repository.xml. The url is the file path
(file:/D:/karaf-3.0.3/cave/my-repoisitory/xxx), but not
http://cave:8181/my-repository/xxx
2. Use browser to access http://cave:8181/cave/org.aaaa.bbbb-version.jar ->
ok. The jar file could be downloaded.
3. Use obr:deploy org.aaaa.bbbb (symbolic name) -> not ok. The message is
Error accessing
file:/D:/apache-karaf-3.0.3/cave/my-repository/org.aaaa.bbbb-version.jar

Just follows the link to add bundles into Cave repository.
http://karaf.apache.org/manual/cave/latest/user-guide/populate-repository.html

Thanks



--
View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700p4039703.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Cave - HTTP Wrapper Service

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi

How did you populate/create the Cave repo ?

Regards
JB

On 04/15/2015 09:42 AM, hsinchen wrote:
> Hi,
>
> I could not access the Cave repository from a remote Karaf with obr.
> In remote karaf:
> 1. feature:install obr
> 2. obr:url-add cave repository url
> 3. obr:list and obr:info -> ok
> 4. use browser to access http://cave:8181/cave/my-repository.xml -> ok
> At 3 and 4, the bundle url is like "file:/D:/xxxx. That is the Cave server's
> local disk. But, not http://...
> 5. obr:deploy  -> not ok (can not find bundle in file:/D:/xxx)
> 5. use browser to access http://cave:8181/cave/bundlexxxxx.jar -> not ok
> (can not find bundle in file:/D:/xxx)
>
> Please help to advise it. Thanks.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Cave-HTTP-Wrapper-Service-tp4039700.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com