You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by lionceau <fl...@gmail.Com> on 2014/06/17 21:22:28 UTC

Karaf Tutorial Part 4 - CXF Services in OSGi

Hi, 

From
http://www.liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
Using apache Karaf 3 I try to do :

I try to do :
karaf@root()> install -s
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
Bundle IDs:
Error executing command: Error installing bundles:
        Unable to install bundle
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
karaf@root()>

This tutorial is from 2011 , then now, in 2014 using Karaf 3 What's going on
? what's wrong ?What's the problem ?

Thank you, 





--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Tutorial Part 4 - CXF Services in OSGi

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
AFAIR, Christian fixed the examples on his github.

Anyway, the Karaf cookbook contains updating sample as well.

Regards
JB

On 06/17/2014 09:22 PM, lionceau wrote:
> Hi,
>
> From
> http://www.liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
> Using apache Karaf 3 I try to do :
>
> I try to do :
> karaf@root()> install -s
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
> Bundle IDs:
> Error executing command: Error installing bundles:
>          Unable to install bundle
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
> karaf@root()>
>
> This tutorial is from 2011 , then now, in 2014 using Karaf 3 What's going on
> ? what's wrong ?What's the problem ?
>
> Thank you,
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586.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: Karaf Tutorial Part 4 - CXF Services in OSGi

Posted by parker <pa...@yahoo.com>.
Hi, 


Yes it's working well, I would like to use this project inside eclipse or
netbeans, I am new with maven and eclipse .

that is the project imported : 
<http://karaf.922171.n3.nabble.com/file/n4033684/scshotv1.png> 



For example if i try to change person1.xml inside the project :
personservice-webui/src/test/resources

How can I make the new jar to use inside Karaf ?

Thank you for your advice and help, 







--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586p4033684.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Tutorial Part 4 - CXF Services in OSGi

Posted by parker <pa...@yahoo.com>.
Hi Christian,


I said that to you because I want to check how can i use your tutorial,my
question was how to add new default users ,  I have found the answer of the
question , i just need to change from package
net.lr.tutorial.karaf.cxf.personservice.impl; that: 
 public PersonServiceImpl() {
        personMap = new HashMap<String, Person>();
        Person person = createExamplePerson();
        personMap.put("1", person);
    }

    private Person createExamplePerson() {
        Person person = new Person();
        person.setId("1");
        person.setName("Chris");
        return person;
    }



Another question about the "Karaf Tutorial Part 4 " is , why in the project
you don't have an "public class ProviderActivator implements BundleActivator
" with "public void start(BundleContext bundleContext) throws Exception {"
and "    public void stop(BundleContext bundleContext) throws Exception { "
I want to understand and to use your tutorial then where are the class
ProviderActivator and the start and the stop in your project ? 


Than you for your help.





--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586p4033793.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Tutorial Part 4 - CXF Services in OSGi

Posted by Christian Schneider <ch...@die-schneider.net>.
It is fine to edit the project using eclipse and maven. You should also 
consider to use m2e if you do not already do.
The install -s for the bundles is not so good for long term. Better use 
a feature. (I use this in some other tutorials).

Not sure I understand what you mean by add 2 users? Do you mean karaf 
users?

Christian

Am 22.06.2014 23:01, schrieb lionceau:
> Hi
>
> Thank you for your answer,  it's working well ,the problem came form maven.
>
> How can I change the project ? using eclipse and the shell I try to edit the
> project , I do  "mvn clean install" and
> install -s
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
> install -s
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-server/1.0-SNAPSHOT
> install -s
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-proxy/1.0-SNAPSHOT
> install -s
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-webui/1.0-SNAPSHOT
>
> it 's good ?
> I want to know if it's the good way ?
>
> How  can I add by default 2 new users ?
>
>
> thank you,
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586p4033685.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Karaf Tutorial Part 4 - CXF Services in OSGi

Posted by lionceau <fl...@gmail.Com>.
Hi 

Thank you for your answer,  it's working well ,the problem came form maven.

How can I change the project ? using eclipse and the shell I try to edit the
project , I do  "mvn clean install" and 
install -s
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
install -s
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-server/1.0-SNAPSHOT
install -s
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-proxy/1.0-SNAPSHOT
install -s
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-webui/1.0-SNAPSHOT

it 's good ? 
I want to know if it's the good way ? 

How  can I add by default 2 new users ? 


thank you, 





--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586p4033685.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf Tutorial Part 4 - CXF Services in OSGi

Posted by Christian Schneider <ch...@die-schneider.net>.
I just tried the steps myself with a fresh clone of the Karaf Tutorial 
github repo.

I first did mvn clean install in the cxf/personservice dir.

Then downloaded and start karaf 3.0.1.

In the Karaf shell I did this:
  feature:repo-add cxf 2.7.4
  feature:install http cxf

install -s 
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
install -s 
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-server/1.0-SNAPSHOT
install -s 
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-proxy/1.0-SNAPSHOT
install -s 
mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-webui/1.0-SNAPSHOT

Worked fine for me. I was then able to do the next steps and access the 
rest service as well as the personui.

If a bundle fails to install like you wrote, try to start it with start 
bundleid. Then karaf will tell you in detail which requirement of the 
bundle was not met.
In my first attempt I did only feature:repo-add and forgot the 
feature:install. So the model bundle already did not install as it was 
missing the javax.ws.rs package.

Christian


Am 17.06.2014 21:22, schrieb lionceau:
> Hi,
>
> From
> http://www.liquid-reality.de/display/liquid/2011/12/22/Karaf+Tutorial+Part+4+-+CXF+Services+in+OSGi
> Using apache Karaf 3 I try to do :
>
> I try to do :
> karaf@root()> install -s
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
> Bundle IDs:
> Error executing command: Error installing bundles:
>          Unable to install bundle
> mvn:net.lr.tutorial.karaf.cxf.personservice/personservice-model/1.0-SNAPSHOT
> karaf@root()>
>
> This tutorial is from 2011 , then now, in 2014 using Karaf 3 What's going on
> ? what's wrong ?What's the problem ?
>
> Thank you,
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Tutorial-Part-4-CXF-Services-in-OSGi-tp4033586.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com