You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by bst <st...@gmail.com> on 2011/09/09 16:56:00 UTC

osgi problem since 2.4.0

Hi,

I'm running the application on Equinox platform and my concept is to
register osgiServlet to existing httpService using pax-whiteboard. Then
registering my own webServices through JaxWsServerFactoryBean using the
service-reference to the osgiServlet. Everything worked great until I
upgraded to the cxf-bundle-2.4.0. 

In sping-context file I'm using only these two imports as suggested
somewhere in this forum:

    <import resource="classpath:META-INF/cxf/cxf.xml"/>
    <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml"/>

Even though I can not spot any problems from the logfiles the standard
services-list page shows no content ("No services have been found.").
Obviously the osgiServlet is up and running but the webServices are not. The
console shows practically the same output as it does with the
cxf-bundle-2.2.11 (which works fine):

/09.09.2011 16:18:42
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {urn:ihe:iti:xds-b:2007}DocumentRepository_Service
from WSDL: wsdl/iti41.wsdl
09.09.2011 16:18:42 org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory
createEndpoint
WARNUNG: Could not find endpoint/port for
{urn:ihe:iti:xds-b:2007}DocumentRepository_PortTypePort in wsdl. Using
{urn:ihe:iti:xds-b:2007}DocumenRepository_Port_Soap12.
09.09.2011 16:18:42 org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be /xds-iti41/

Any ideas?

Many thanks,
Cheers,
Boris


--
View this message in context: http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4786635.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: osgi problem since 2.4.0

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

I think what you encounter should be another issue, or even not an  
issue in CXF at all.
IIRC you mentioned you use equinox directly which means you need  
ensure you install a bunch of  bundles correctly which can make cxf  
stuff work there.
Anyway, if you can provide a testcase which we can build and deploy in  
KARAF/SMX based container we can narrow down the real problem.

Freeman
On 2011-10-17, at 下午7:23, bst wrote:

> Hi Daniel,
>
> just tested on the 2.4.4.SNAPSHOT, the problem still exists!
>
> Cheers,
> Boris
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4909573.html
> Sent from the cxf-user mailing list archive at Nabble.com.

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

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: osgi problem since 2.4.0

Posted by bst <st...@gmail.com>.
Hi Daniel,

just tested on the 2.4.4.SNAPSHOT, the problem still exists!

Cheers,
Boris

--
View this message in context: http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4909573.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: osgi problem since 2.4.0

Posted by bst <st...@gmail.com>.
Hi Daniel,

I do use Equinox 3.6 for my tests; I will checkout the snapshots as you've
suggested and post the results;

Cheers,
Boris

--
View this message in context: http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4903079.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: osgi problem since 2.4.0

Posted by Daniel Kulp <dk...@apache.org>.
I think this is similar to what Freeman and I spent a couple hours debugging 
yesterday.   I couldn't reproduce it at first as it didn't seem to appear when 
using Equinox (which is what I normally use).  It only appeared with Felix.     
I was finally able to reproduce it with Felix and put a fix in place 
yesterday.   Any chance you could try with the latest snapshots of 2.4.4-
SNAPSHOT of 2.5.0-SNAPSHOT?   Also, could you try flipping to Equinox and 
seeing if the problem goes away?


Dan





On Friday, October 14, 2011 7:48:50 AM bst wrote:
> Hi Freeman,
> 
> well I did some debugging lately and found out what really caused my
> problem. Actually it is the
> org.apache.cxf.transport.servlet.CXFNonSpringServlet who gets
> spring-initiated with the "empty" DestinationRegistry which doesn't have
> reference to any TransportFactory respectively no transportId gets
> registered:
> 
>    <bean id="osgiServlet"
> class="org.apache.cxf.transport.servlet.CXFNonSpringServlet">
>         <constructor-arg ref="destinationRegistry"/>
>     </bean>
> 
> My workaround which did the trick is to use default-constructor:
> 
>    <bean id="osgiServlet"
> class="org.apache.cxf.transport.servlet.CXFNonSpringServlet" />
> 
>  ... and let the CXFNonSpringServlet create the DestinationFactory itself
> with reference to the HTTPTransportFactory:
> 
>         if (destinationRegistry == null) {
>             // no destination registry associated -> create the new one
>             this.destinationRegistry =
> getDestinationRegistryFromBus(this.bus);
>         }
> 
> Cheers,
> Boris
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4902843.
> html Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: osgi problem since 2.4.0

Posted by bst <st...@gmail.com>.
Hi Freeman,

well I did some debugging lately and found out what really caused my
problem. Actually it is the
org.apache.cxf.transport.servlet.CXFNonSpringServlet who gets
spring-initiated with the "empty" DestinationRegistry which doesn't have
reference to any TransportFactory respectively no transportId gets
registered:

   <bean id="osgiServlet"
class="org.apache.cxf.transport.servlet.CXFNonSpringServlet">
        <constructor-arg ref="destinationRegistry"/>
    </bean>

My workaround which did the trick is to use default-constructor:

   <bean id="osgiServlet"
class="org.apache.cxf.transport.servlet.CXFNonSpringServlet" />

 ... and let the CXFNonSpringServlet create the DestinationFactory itself
with reference to the HTTPTransportFactory:

        if (destinationRegistry == null) {
            // no destination registry associated -> create the new one
            this.destinationRegistry =
getDestinationRegistryFromBus(this.bus);
        }

Cheers,
Boris

--
View this message in context: http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4902843.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: osgi problem since 2.4.0

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

If I understand correctly, you just want to use cxf http-osgi  
transport which leverage osgi http service(pax-web underlying), right?
You're using Equinox directly? Not with Karaf or Servicemix?
If you use Equinox directly, you need install a dozen of bundles  
yourself(from cxf 2.211 to cxf 2.4.0 a lot of bundles need change), I  
suggest you take a look at apache-cxf-features.xml[1] to get some  
details about the bundles you need install.

I suggest you consider to use Apache Servicemix which support cxf out  
of the box, you needn't install cxf related bundles yourself, and  
there's a cxf-osgi example which should be exactly same as your  
scenario, the import package of that example should be still helpful  
even you use Equinox directly, so you need check your customer  
bundle's Import-Package, it should be
                             javax.jws,
                             javax.wsdl,
                             javax.xml.namespace,
                             META-INF.cxf,
                             META-INF.cxf.osgi,
                             org.apache.cxf.bus,
                             org.apache.cxf.bus.spring,
                             org.apache.cxf.bus.resource,
                             org.apache.cxf.configuration.spring,
                             org.apache.cxf.resource,
                             org.apache.cxf.transport.http,
                             org.apache.servicemix.util,
                             org.springframework.beans.factory.config

[1]http://repo2.maven.org/maven2/org/apache/cxf/karaf/apache-cxf/2.4.0/apache-cxf-2.4.0-features.xml

Freeman
On 2011-9-9, at 下午10:56, bst wrote:

> Hi,
>
> I'm running the application on Equinox platform and my concept is to
> register osgiServlet to existing httpService using pax-whiteboard.  
> Then
> registering my own webServices through JaxWsServerFactoryBean using  
> the
> service-reference to the osgiServlet. Everything worked great until I
> upgraded to the cxf-bundle-2.4.0.
>
> In sping-context file I'm using only these two imports as suggested
> somewhere in this forum:
>
>    <import resource="classpath:META-INF/cxf/cxf.xml"/>
>    <import resource="classpath:META-INF/cxf/osgi/cxf-extension- 
> osgi.xml"/>
>
> Even though I can not spot any problems from the logfiles the standard
> services-list page shows no content ("No services have been found.").
> Obviously the osgiServlet is up and running but the webServices are  
> not. The
> console shows practically the same output as it does with the
> cxf-bundle-2.2.11 (which works fine):
>
> /09.09.2011 16:18:42
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {urn:ihe:iti:xds-b: 
> 2007}DocumentRepository_Service
> from WSDL: wsdl/iti41.wsdl
> 09.09.2011 16:18:42  
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory
> createEndpoint
> WARNUNG: Could not find endpoint/port for
> {urn:ihe:iti:xds-b:2007}DocumentRepository_PortTypePort in wsdl. Using
> {urn:ihe:iti:xds-b:2007}DocumenRepository_Port_Soap12.
> 09.09.2011 16:18:42 org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be /xds-iti41/
>
> Any ideas?
>
> Many thanks,
> Cheers,
> Boris
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4786635.html
> Sent from the cxf-user mailing list archive at Nabble.com.

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

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: osgi problem since 2.4.0

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

You can also grab the latest FUSE ESB(which is based on Apache  
Servicemix) release[1] which already use CXF 2.4.x and take a look the  
cxf-osgi example there :-)

Btw, Apache SMX4.4 should be out soon.
[1]http://repo.fusesource.com/nexus/content/repositories/releases/org/apache/servicemix/apache-servicemix/4.4.0-fuse-00-43/

Freeman
On 2011-9-10, at 上午1:26, Daniel Kulp wrote:

>
> Well,  there isn't a released version of ServiceMix that supports  
> CXF 2.4.x
> yet.  Thus, that suggestion from Freeman wouldn't work.   :-)
>
> My best suggestion right now (until SMX 4.4 is out) is to grab the  
> Talend
> Service Factory download ( http://talend.com/products/tsf ) and try  
> running
> your application in there.   We have examples that show that the osgi
> transport stuff is working there.  (Although on a different port and  
> context
> than a default Karaf/cxf install)(port 8080 instead of 9000 and / 
> services
> instead of /cxf)   If it works there, then you may be able to look  
> at the
> installed bundles and configurations and such to figure out what's  
> different
> between it and your setup.
>
> One note: I'm pretty sure the CXF OSGi HTTP transport thing  
> currently requires
> spring-dm as it configured and created via a META-INF/spring/ 
> osgiservlet.xml
> file.   Thus, if you don't have spring-dm in your OSGi container,  
> you might
> need to redo some of that.
>
>
> Dan
>
>
>
> On Friday, September 09, 2011 7:56:00 AM bst wrote:
>> Hi,
>>
>> I'm running the application on Equinox platform and my concept is to
>> register osgiServlet to existing httpService using pax-whiteboard.  
>> Then
>> registering my own webServices through JaxWsServerFactoryBean using  
>> the
>> service-reference to the osgiServlet. Everything worked great until I
>> upgraded to the cxf-bundle-2.4.0.
>>
>> In sping-context file I'm using only these two imports as suggested
>> somewhere in this forum:
>>
>>    <import resource="classpath:META-INF/cxf/cxf.xml"/>
>>    <import resource="classpath:META-INF/cxf/osgi/cxf-extension- 
>> osgi.xml"/>
>>
>> Even though I can not spot any problems from the logfiles the  
>> standard
>> services-list page shows no content ("No services have been found.").
>> Obviously the osgiServlet is up and running but the webServices are  
>> not. The
>> console shows practically the same output as it does with the
>> cxf-bundle-2.2.11 (which works fine):
>>
>> /09.09.2011 16:18:42
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
>> buildServiceFromWSDL
>> INFO: Creating Service {urn:ihe:iti:xds-b: 
>> 2007}DocumentRepository_Service
>> from WSDL: wsdl/iti41.wsdl
>> 09.09.2011 16:18:42  
>> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory
>> createEndpoint
>> WARNUNG: Could not find endpoint/port for
>> {urn:ihe:iti:xds-b:2007}DocumentRepository_PortTypePort in wsdl.  
>> Using
>> {urn:ihe:iti:xds-b:2007}DocumenRepository_Port_Soap12.
>> 09.09.2011 16:18:42 org.apache.cxf.endpoint.ServerImpl  
>> initDestination
>> INFO: Setting the server's publish address to be /xds-iti41/
>>
>> Any ideas?
>>
>> Many thanks,
>> Cheers,
>> Boris
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4786635 
>> .
>> html Sent from the cxf-user mailing list archive at Nabble.com.
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com

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

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com










Re: osgi problem since 2.4.0

Posted by Daniel Kulp <dk...@apache.org>.
Well,  there isn't a released version of ServiceMix that supports CXF 2.4.x 
yet.  Thus, that suggestion from Freeman wouldn't work.   :-)

My best suggestion right now (until SMX 4.4 is out) is to grab the Talend 
Service Factory download ( http://talend.com/products/tsf ) and try running 
your application in there.   We have examples that show that the osgi 
transport stuff is working there.  (Although on a different port and context 
than a default Karaf/cxf install)(port 8080 instead of 9000 and /services 
instead of /cxf)   If it works there, then you may be able to look at the 
installed bundles and configurations and such to figure out what's different 
between it and your setup.

One note: I'm pretty sure the CXF OSGi HTTP transport thing currently requires 
spring-dm as it configured and created via a META-INF/spring/osgiservlet.xml 
file.   Thus, if you don't have spring-dm in your OSGi container, you might 
need to redo some of that. 


Dan



On Friday, September 09, 2011 7:56:00 AM bst wrote:
> Hi,
> 
> I'm running the application on Equinox platform and my concept is to
> register osgiServlet to existing httpService using pax-whiteboard. Then
> registering my own webServices through JaxWsServerFactoryBean using the
> service-reference to the osgiServlet. Everything worked great until I
> upgraded to the cxf-bundle-2.4.0.
> 
> In sping-context file I'm using only these two imports as suggested
> somewhere in this forum:
> 
>     <import resource="classpath:META-INF/cxf/cxf.xml"/>
>     <import resource="classpath:META-INF/cxf/osgi/cxf-extension-osgi.xml"/>
> 
> Even though I can not spot any problems from the logfiles the standard
> services-list page shows no content ("No services have been found.").
> Obviously the osgiServlet is up and running but the webServices are not. The
> console shows practically the same output as it does with the
> cxf-bundle-2.2.11 (which works fine):
> 
> /09.09.2011 16:18:42
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {urn:ihe:iti:xds-b:2007}DocumentRepository_Service
> from WSDL: wsdl/iti41.wsdl
> 09.09.2011 16:18:42 org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory
> createEndpoint
> WARNUNG: Could not find endpoint/port for
> {urn:ihe:iti:xds-b:2007}DocumentRepository_PortTypePort in wsdl. Using
> {urn:ihe:iti:xds-b:2007}DocumenRepository_Port_Soap12.
> 09.09.2011 16:18:42 org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be /xds-iti41/
> 
> Any ideas?
> 
> Many thanks,
> Cheers,
> Boris
> 
> 
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/osgi-problem-since-2-4-0-tp4786635p4786635.
> html Sent from the cxf-user mailing list archive at Nabble.com.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com