Re: Loading Resources with Jetty in Karaf

2013-05-05 Thread Achim Nierbeck
Hi,

you need to make sure you're using the "WebContainer" HTTP-Service, it's
the one provided by Pax-Web. Take also
a look at the samples of Pax-Web[1].

Another way of registering your resources might be to use the whiteboard
mechanism.

Greetings, Achim

[1] -
https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/helloworld-wc/src/main/java/org/ops4j/pax/web/samples/helloworld/wc/internal/Activator.java#L122


2013/5/4 Clement Jebakumar 

>
> Hi,
>
> I have a bundle which supplies css/img folder. I tried with below code,
> looks like jetty is not recognizing it. How to enable files in those
> folders be served by Jetty
>
> ServiceReference sRef = context.getServiceReference(HttpService.class
> .getName());
>  HttpService service = (HttpService) context.getService(sRef);
> service.registerResources("/", "/htmls", null);
>  // service.registerResources("/js", "js", null);
> String webDir = getClass().getClassLoader().getResource("css")
>  .toExternalForm();
> service.registerResources("/css", webDir, null);
> service.registerResources("/img", "/img", null);
>
> Files are put insider bundle. In eclipse devlopment, we have an unpack
> option which solved the issue in Eclipse. But in karaf, i am not sure how
> to make jetty to work with this.
>
>
> *Clement Jebakumar,*
>
> 111/27 Keelamutharamman Kovil Street,
> Tenkasi, 627 811
> http://www.declum.com/clement.html
>
>


-- 

Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
OPS4J Pax for Vaadin 
Commiter & Project Lead
blog 


Re: GWT in Karaf

2013-05-05 Thread Achim Nierbeck
btw. if you installed the war features no need to install the http feature
anymore since it's included. :)

Regarding your json issue, you should check with packages:exports 207 if it
really exports the required packages.

regards, Achim


2013/5/5 Jacob Sheck 

> Jean-Baptiste,
>
> Thanks for the pointer.  I am still stuck with the json issue.  I'll post
> back when I get this figured out.
>
> karaf@savoir> features:install  war
> karaf@savoir> features:install  http
> karaf@savoir> install -s
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsr305/1.3.9_1
> Bundle ID: 205
> karaf@savoir> install -s
> mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr303-api-1.0.0/1.9.0
> Bundle ID: 206
> karaf@savoir> install -s
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
> Bundle ID: 207
> karaf@savoir> install -s
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-dev/2.4.0_1
> Bundle ID: 208
> karaf@savoir> install -s
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-user/2.4.0_1
> org.osgi.framework.BundleException: The bundle
> "org.apache.servicemix.bundles.gwt-user_2.4.0.1 [209]" could not be
> resolved. Reason: Missing Constraint: Import-Package: org.json;
> version="0.0.0"
> Bundle ID: 209
> karaf@savoir>
>
> Appreciatively
> Jacob
>
> -Original Message-
> From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
> Sent: Friday, May 03, 2013 11:51 PM
> To: user@karaf.apache.org
> Subject: Re: GWT in Karaf
>
> Hi Jacob,
>
> try to use ServiceMix json-lib bundle:
>
> install -s
>
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
>
> Regards
> JB
>
> On 05/04/2013 06:20 AM, Jacob Sheck wrote:
> > I am would like to run a simple web service Karaf.  This example looks
> > promising.
> >
> > http://cmoulliard.blogspot.com/2011/12/run-google-web-toolkit-2-projec
> > t-on.html
> >
> >
> > I am not able to resolve the json dependency.
> >
> > karaf@savoir> install -s
> > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/2
> > 0090211_1
> >
> > java.lang.RuntimeException: URL
> > [mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/
> > 20090211_1]
> > could not be resolved.
> >
> > I tried with  Geronimo, but gwt-user doesn' recognize it.
> >
> > karaf@savoir> install -s
> > mvn:org.apache.geronimo.bundles/org.json/20090211
> >
> > Bundle ID: 305
> >
> > karaf@savoir> install -s
> > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-us
> > er/2.4.0_1
> >
> > org.osgi.framework.BundleException: The bundle
> > "org.apache.servicemix.bundles.gwt-user_2.4.0.1 [300]" could not be
> > resolved. Reason: Missing Constraint: Import-Package: org.json;
> > version="0.0.0"
> >
> > Help with this issue, or guidance to a more recent example would be
> > greatly appreciated.
> >
> > Thanks
> >
> > Jacob
> >
> >
> > --
> > --
> >
> > CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the
> > intended recipient(s) and may contain confidential and privileged
> > information. Any unauthorized review, use, disclosure or distribution
> > of any kind is strictly prohibited. If you are not the intended
> > recipient, please contact the sender via reply e-mail and destroy all
> > copies of the original message. Thank you.
>
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Karaf  Committer & PMC
OPS4J Pax Web  Committer &
Project Lead
OPS4J Pax for Vaadin 
Commiter & Project Lead
blog 


Re: GWT in Karaf

2013-05-05 Thread Łukasz Dywicki
I've tried to answer gwt-user problems with osgi few times. I hope this time it 
will help and finally solve gwt-user issue. The way od deploying application 
described in blog post is wrong. Also gwt quickstart is wrong.

You don't need gwt-user at runtime because:
- Java application written with GWT is compiled to Java Script
- Java .class files are not needed at all to run it
- Java Script do not depend on any Java classes

What you actually need is only to collect generated resources package them in 
jar with additional classifier and install it instead of compiled Java 
artifact. Below you might find example of maven-jar-plugin configuration which 
catches generated artifacts from GWT project and package it with -gwt 
classifier.


org.apache.maven.plugins
maven-jar-plugin
2.3


gwt

jar



${basedir}/target/${pom.artifactId}-${pom.version}/Application
gwt





Cheers,
Łukasz Dywicki
--
l...@code-house.org
Twitter: ldywicki
Blog: http://dywicki.pl
Code-House - http://code-house.org

Wiadomość napisana przez Achim Nierbeck  w dniu 5 maj 
2013, o godz. 12:34:

> btw. if you installed the war features no need to install the http feature 
> anymore since it's included. :)
> 
> Regarding your json issue, you should check with packages:exports 207 if it 
> really exports the required packages. 
> 
> regards, Achim 
> 
> 
> 2013/5/5 Jacob Sheck 
> Jean-Baptiste,
> 
> Thanks for the pointer.  I am still stuck with the json issue.  I'll post 
> back when I get this figured out.
> 
> karaf@savoir> features:install  war
> karaf@savoir> features:install  http
> karaf@savoir> install -s 
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jsr305/1.3.9_1
> Bundle ID: 205
> karaf@savoir> install -s 
> mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jsr303-api-1.0.0/1.9.0
> Bundle ID: 206
> karaf@savoir> install -s 
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
> Bundle ID: 207
> karaf@savoir> install -s 
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-dev/2.4.0_1
> Bundle ID: 208
> karaf@savoir> install -s 
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-user/2.4.0_1
> org.osgi.framework.BundleException: The bundle 
> "org.apache.servicemix.bundles.gwt-user_2.4.0.1 [209]" could not be resolved. 
> Reason: Missing Constraint: Import-Package: org.json; version="0.0.0"
> Bundle ID: 209
> karaf@savoir>
> 
> Appreciatively
> Jacob
> 
> -Original Message-
> From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net]
> Sent: Friday, May 03, 2013 11:51 PM
> To: user@karaf.apache.org
> Subject: Re: GWT in Karaf
> 
> Hi Jacob,
> 
> try to use ServiceMix json-lib bundle:
> 
> install -s
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json-lib/2.4_1
> 
> Regards
> JB
> 
> On 05/04/2013 06:20 AM, Jacob Sheck wrote:
> > I am would like to run a simple web service Karaf.  This example looks
> > promising.
> >
> > http://cmoulliard.blogspot.com/2011/12/run-google-web-toolkit-2-projec
> > t-on.html
> >
> >
> > I am not able to resolve the json dependency.
> >
> > karaf@savoir> install -s
> > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/2
> > 0090211_1
> >
> > java.lang.RuntimeException: URL
> > [mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.json/
> > 20090211_1]
> > could not be resolved.
> >
> > I tried with  Geronimo, but gwt-user doesn' recognize it.
> >
> > karaf@savoir> install -s
> > mvn:org.apache.geronimo.bundles/org.json/20090211
> >
> > Bundle ID: 305
> >
> > karaf@savoir> install -s
> > mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.gwt-us
> > er/2.4.0_1
> >
> > org.osgi.framework.BundleException: The bundle
> > "org.apache.servicemix.bundles.gwt-user_2.4.0.1 [300]" could not be
> > resolved. Reason: Missing Constraint: Import-Package: org.json;
> > version="0.0.0"
> >
> > Help with this issue, or guidance to a more recent example would be
> > greatly appreciated.
> >
> > Thanks
> >
> > Jacob
> >
> >
> > --
> > --
> >
> > CONFIDENTIALITY NOTICE: This e-mail message is for the sole use of the
> > intended recipient(s) and may contain confidential and privileged
> > information. Any unauthorized review, use, disclosure or distribution
> > of any kind is strictly prohibited. If you are not the intended
> > recipient, please contact the sender via reply e-mail and destroy all
> > copies of the original message. Thank you.
> 
> --
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
> 
>

Re: Loading Resources with Jetty in Karaf

2013-05-05 Thread Ioan Eugen Stan
Hi,

Pax-Web is the way to go. Here is some sample blueprint code for
serving static html pages from Karaf. This will serve 'index.html' and
other static resources directly from your bundle. Put files under
src/main/resources in your maven project.

Cheers,

  










index.html






On Sun, May 5, 2013 at 1:32 PM, Achim Nierbeck  wrote:
> Hi,
>
> you need to make sure you're using the "WebContainer" HTTP-Service, it's the
> one provided by Pax-Web. Take also
> a look at the samples of Pax-Web[1].
>
> Another way of registering your resources might be to use the whiteboard
> mechanism.
>
> Greetings, Achim
>
> [1] -
> https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/helloworld-wc/src/main/java/org/ops4j/pax/web/samples/helloworld/wc/internal/Activator.java#L122
>
>
> 2013/5/4 Clement Jebakumar 
>>
>>
>> Hi,
>>
>> I have a bundle which supplies css/img folder. I tried with below code,
>> looks like jetty is not recognizing it. How to enable files in those folders
>> be served by Jetty
>>
>> ServiceReference sRef = context.getServiceReference(HttpService.class
>> .getName());
>> HttpService service = (HttpService) context.getService(sRef);
>> service.registerResources("/", "/htmls", null);
>> // service.registerResources("/js", "js", null);
>> String webDir = getClass().getClassLoader().getResource("css")
>> .toExternalForm();
>> service.registerResources("/css", webDir, null);
>> service.registerResources("/img", "/img", null);
>>
>> Files are put insider bundle. In eclipse devlopment, we have an unpack
>> option which solved the issue in Eclipse. But in karaf, i am not sure how to
>> make jetty to work with this.
>>
>>
>> Clement Jebakumar,
>>
>> 111/27 Keelamutharamman Kovil Street,
>> Tenkasi, 627 811
>> http://www.declum.com/clement.html
>>
>
>
>
> --
>
> Apache Karaf  Committer & PMC
> OPS4J Pax Web  Committer &
> Project Lead
> OPS4J Pax for Vaadin 
> Commiter & Project Lead
> blog 



-- 
Ioan Eugen Stan
0720 898 747


Re: "Tabbing" for command list in 3.0.0-SNAPSHOT

2013-05-05 Thread rkmoquin
Yeah, I know, I always feel like I should ask first rather than risk opening
a duplicate issue and wasting developer's time.  Or maybe I'm wasting more
of your time by asking first?  I can definitely open one if it persists in
the latest snapshot (I'll give the newest a try).

Thanks!



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Tabbing-for-command-list-in-3-0-0-SNAPSHOT-tp4028517p4028562.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: How can I obtain a file as a resource from within a Karaf bundle

2013-05-05 Thread rkmoquin
I ran into this problem a few months back and after a lot of research, I
discovered that there is a bundle specific way to load resources.  The
example below will allow you to load multiple xsd files from the root of the
bundle if I remember correctly.



Anyhow, look at the javadocs related to findEntries and related methods
which will help you do what you need.

Ryan



--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-can-I-obtain-a-file-as-a-resource-from-within-a-Karaf-bundle-tp4028549p4028563.html
Sent from the Karaf - User mailing list archive at Nabble.com.


Re: Karaf, JPA and ConfigAdmin

2013-05-05 Thread lbu
Issue logged here: https://issues.apache.org/jira/browse/ARIES-1023



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-JPA-and-ConfigAdmin-tp3667564p4028564.html
Sent from the Karaf - User mailing list archive at Nabble.com.