You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Setya <js...@gmail.com> on 2015/12/10 11:26:38 UTC

Deploy CXF DOSGI WS based apps to Eclipse Virgo

Hi all,

Since CXF DOSGI comes with its own Jetty, when deploying to Eclipse Virgo we
need to stripped it down, is it possible at all?

Any help would be greatly appreciated.

Thanks & Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Setya <js...@gmail.com>.
Hi Christian,

According to  this
<http://cxf.547215.n5.nabble.com/Use-of-OSGi-http-service-instead-of-jetty-engine-td547907.html>  
I should be able to change the context by setting it in config
org.apache.cxf.osgi#org.apache.cxf.servlet.context. 

I've tried it and able to change the context to something else but
unfortunately not '/'.

Another thing, when I deploy another bundle that exposes WS, will it start
another Jetty instance or just reuse the existing ?

Thanks & Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5764461.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Christian Schneider <ch...@die-schneider.net>.
It is not possible to get rid of the cxf prefix as it is the name of the
CXF servlet. So if you want to use the HttpService and servlet based
transport it is necessary.
We can maybe change this in the future and install one servlet per service
but this need changes in the cxf code.

Christian

2016-01-06 16:56 GMT+01:00 Setya <js...@gmail.com>:

> Hi Christian,
>
> Thanks.
>
> I've implemented your suggestion and now I can access the WS w/ this URL:
>
> http://localhost:8181/cxf/cxfservice
>
> Is it possible to get rid of the 'cxf' prefix ?
>
> Regards,
> Setya
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5764443.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Setya <js...@gmail.com>.
Hi Christian,

Thanks.

I've implemented your suggestion and now I can access the WS w/ this URL:

http://localhost:8181/cxf/cxfservice

Is it possible to get rid of the 'cxf' prefix ?

Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5764443.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Christian Schneider <ch...@die-schneider.net>.
Try only the ws address property. See
https://github.com/cschneider/Karaf-Tutorial/blob/master/tasklist-ds/service/src/main/java/net/lr/tasklist/service/TaskServiceRest.java
It is org.apache.cxf.rs.address for rest and org.apache.cxf.ws.address for
SOAP.

Christian

2016-01-06 9:39 GMT+01:00 Setya <js...@gmail.com>:

> Hi Christian,
>
> I've tried the same with Apache Karaf 4.0.3, the problem is exactly the
> same. It seems that org.apache.cxf.ws.httpservice.context flag is ignored,
> but it registered the service successfully:
>
> Below is from the log:
>
> /2016-01-06 12:07:50,603 | INFO  | pool-39-thread-1 |
> RemoteServiceAdminCore
> | 53 - cxf-dosgi-ri-dsw-cxf - 1.8.0.SNAPSHOT | created server for interface
> com.phincon.service.CXFService
> 2016-01-06 12:07:50,607 | INFO  | pool-39-thread-1 | TopologyManagerExport
> | 55 - cxf-dosgi-ri-topology-manager - 1.8.0.SNAPSHOT | TopologyManager:
> export succeeded for
>
> {com.phincon.service.CXFService}={org.apache.cxf.ws.httpservice.context=/cxfservice,
> service.exported.configs=org.apache.cxf.ws, service.exported.interfaces=*,
> service.id=176, service.bundleid=121, service.scope=singleton}, endpoint
> 2016-01-06 12:07:50,607 | INFO  | pool-39-thread-1 | TopologyManagerExport
> | 55 - cxf-dosgi-ri-topology-manager - 1.8.0.SNAPSHOT | TopologyManager:
> export successful for
>
> {com.phincon.service.CXFService}={org.apache.cxf.ws.httpservice.context=/cxfservice,
> service.exported.configs=org.apache.cxf.ws, service.exported.interfaces=*,
> service.id=176, service.bundleid=121, service.scope=singleton}, endpoints:
> [{endpoint.framework.uuid=609d561c-2bb4-0015-1f66-86e3c458cd40,
> endpoint.id=http://localhost:9000/com/phincon/service/CXFService,
> endpoint.package.version.com.phincon.service=0.0.0, endpoint.service.id
> =176,
> objectClass=[com.phincon.service.CXFService],
> org.apache.cxf.ws.address=
> http://localhost:9000/com/phincon/service/CXFService,
> org.apache.cxf.ws.httpservice.context=/cxfservice, service.bundleid=121,
> service.imported=true, service.imported.configs=[org.apache.cxf.ws],
> service.intents=[SOAP.1_1, HTTP, SOAP], service.scope=singleton}]
> /
> I refer to this  DOSGI Reference
> <https://cxf.apache.org/distributed-osgi-reference.html>   to set up the
> configuration.
>
> Thanks & Regards,
> Setya
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5764410.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>



-- 
-- 
Christian Schneider
http://www.liquid-reality.de
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.liquid-reality.de>

Open Source Architect
http://www.talend.com
<https://owa.talend.com/owa/redir.aspx?C=3aa4083e0c744ae1ba52bd062c5a7e46&URL=http%3a%2f%2fwww.talend.com>

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Setya <js...@gmail.com>.
Hi Christian,

I've tried the same with Apache Karaf 4.0.3, the problem is exactly the
same. It seems that org.apache.cxf.ws.httpservice.context flag is ignored,
but it registered the service successfully:

Below is from the log:

/2016-01-06 12:07:50,603 | INFO  | pool-39-thread-1 | RemoteServiceAdminCore          
| 53 - cxf-dosgi-ri-dsw-cxf - 1.8.0.SNAPSHOT | created server for interface
com.phincon.service.CXFService
2016-01-06 12:07:50,607 | INFO  | pool-39-thread-1 | TopologyManagerExport           
| 55 - cxf-dosgi-ri-topology-manager - 1.8.0.SNAPSHOT | TopologyManager:
export succeeded for
{com.phincon.service.CXFService}={org.apache.cxf.ws.httpservice.context=/cxfservice,
service.exported.configs=org.apache.cxf.ws, service.exported.interfaces=*,
service.id=176, service.bundleid=121, service.scope=singleton}, endpoint 
2016-01-06 12:07:50,607 | INFO  | pool-39-thread-1 | TopologyManagerExport           
| 55 - cxf-dosgi-ri-topology-manager - 1.8.0.SNAPSHOT | TopologyManager:
export successful for
{com.phincon.service.CXFService}={org.apache.cxf.ws.httpservice.context=/cxfservice,
service.exported.configs=org.apache.cxf.ws, service.exported.interfaces=*,
service.id=176, service.bundleid=121, service.scope=singleton}, endpoints:
[{endpoint.framework.uuid=609d561c-2bb4-0015-1f66-86e3c458cd40,
endpoint.id=http://localhost:9000/com/phincon/service/CXFService,
endpoint.package.version.com.phincon.service=0.0.0, endpoint.service.id=176,
objectClass=[com.phincon.service.CXFService],
org.apache.cxf.ws.address=http://localhost:9000/com/phincon/service/CXFService,
org.apache.cxf.ws.httpservice.context=/cxfservice, service.bundleid=121,
service.imported=true, service.imported.configs=[org.apache.cxf.ws],
service.intents=[SOAP.1_1, HTTP, SOAP], service.scope=singleton}]
/
I refer to this  DOSGI Reference
<https://cxf.apache.org/distributed-osgi-reference.html>   to set up the
configuration.

Thanks & Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5764410.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Setya <js...@gmail.com>.
Hi Christian,

I've managed to deploy & run DOSGI CXF WS app in Eclipse Virgo, but no
matter what I do I just can't have it published in intended port & context.
It keeps getting published under
http://localhost:9000/<package>/<interface>.

I've set the following properties in the bundle Activator but the context
seems to be ignored:

/Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put("service.exported.interfaces", "*");
properties.put("service.exported.configs", "org.apache.cxf.ws");
properties.put("org.apache.cxf.ws.httpservice.context", "/cxfservice");
/

I want to publish it using the same port as Eclipse Virgo's so that I can
access it with the following URL:

/http://localhost:8080/cxfservice/

Any example using multi-bundles would be appreciated.

Thanks & Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5764360.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Christian Schneider <ch...@die-schneider.net>.
No idea. I am not familiar with the Virgo environment. I think the best 
way is to experiment what can be removed.
The karaf features might also give you a clue.

Christian

On 10.12.2015 12:01, Setya wrote:
> Hi Christian,
>
> In order to use it without Jetty, which bundles do I need to remove other
> than Jetty bundles ?
>
> Thanks & Regards,
> Setya
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5763773.html
> Sent from the cxf-user mailing list archive at Nabble.com.


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

Open Source Architect
http://www.talend.com


Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Setya <js...@gmail.com>.
Hi Christian,

In order to use it without Jetty, which bundles do I need to remove other
than Jetty bundles ?

Thanks & Regards,
Setya



--
View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771p5763773.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Deploy CXF DOSGI WS based apps to Eclipse Virgo

Posted by Christian Schneider <ch...@die-schneider.net>.
If you use a path starting with "/ " for the address property CXF will 
use the
servlet transport and register with the HttpService. So that might work 
for Virgo.

Christian


On 10.12.2015 11:26, Setya wrote:
> Hi all,
>
> Since CXF DOSGI comes with its own Jetty, when deploying to Eclipse Virgo we
> need to stripped it down, is it possible at all?
>
> Any help would be greatly appreciated.
>
> Thanks & Regards,
> Setya
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Deploy-CXF-DOSGI-WS-based-apps-to-Eclipse-Virgo-tp5763771.html
> Sent from the cxf-user mailing list archive at Nabble.com.


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

Open Source Architect
http://www.talend.com