You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Peter Nerg <pe...@gmail.com> on 2011/12/20 14:52:16 UTC
Fail to deploy webservice with httpj:engine-factory config
I'm using Felix + DOSGi 1.2.
My goal is to configure the amount of threads in the Jetty HTTP service and
from what I gather the only way to do so is to provide the configuration via
a spring context.
I have a bit difficulties following the provided examples as they are only
fragments not providing a end-to-end example, starting with the code and how
to configure my bundle to make it deploy.
So I modified my spring context (META-INF/spring/beans.xml) that exposes a
WS endpoint as follows:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd
http://cxf.apache.org/transports/http-jetty/configuration
http://cxf.apache.org/schemas/configuration/http-jetty.xsd">
<httpj:engine-factory bus="cxf">
<httpj:engine port="6969">
<httpj:threadingParameters minThreads="5"
maxThreads="100" />
<httpj:connector>
<beans:bean class="org.mortbay.jetty.bio.SocketConnector">
<beans:property name="port" value="6969" />
</beans:bean>
</httpj:connector>
<httpj:handlers>
<beans:bean class="org.mortbay.jetty.handler.DefaultHandler" />
</httpj:handlers>
<httpj:sessionSupport>true</httpj:sessionSupport>
</httpj:engine>
</httpj:engine-factory>
<jaxws:endpoint
id="test"
implementor="xxxx"
address="yyyy"/>
</beans>
However this fails with an error stating that there is no bean called "cxf".
Searching for this error message I find that I must import a number of
context files.
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
Having added these I now get an error stating :
java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml
I only assume that the imported files are provided somehow by the DOSGi
bundles.
For some reason I fail to import them.
Is there something that should be added to the manifest file of my bundle to
import these?
--
View this message in context: http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5088923.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Fail to deploy webservice with httpj:engine-factory config
Posted by Peter Nerg <pe...@gmail.com>.
Thanx a lot for your patience. My experience with OSGi frameworks is rather
thin so far. I'm trying to apply my knowledge from various app servers to
this domain.
In fact I'm looking at a migration from Glassfish to a pure OSGi platform.
I'll dig into the material you provided.
-----------------------------
Sent from my Android
On Dec 20, 2011 4:54 PM, "Sergey Beryozkin-5 [via CXF]" <
ml-node+s547215n5089258h60@n5.nabble.com> wrote:
> On 20/12/11 14:17, Peter Nerg wrote:
>
> > Ok, that was a swift answer...
> >
> > However I'm not sure I follow your suggestion.
> > Basically the only thing I want to do is to ramp up the number of
> executing
> > threads in Jetty.
> > Not sure what the default settings are but it doesn't seem to scale much
> > beyond 5 concurrent threads from my load test in soap ui.
> >
> > Is there a better way to configure this on a global level or do I
> actually
> > have to do it per deployed end point?
> >
> > If I have to do it per endpoint then I'm not sure I follow your
> suggestion
> > to /"Consider binding the DOSGI endpoints to HttpService which may help
> with
> > picking up container-specific HTTP configs"/
> > Do you mean to create BundleActivator and somehow deploy my endpoint to
> the
> > HTTPService?
> > I have not found any examples/documentation on how this would be done.
>
> Sorry, I was referring to org.apache.cxf.ws.httpservice.context &
> org.apache.cxf.rs.httpservice.context properties, see
> http://cxf.apache.org/distributed-osgi-reference.html
>
> This way it is HttpService configuration (have a look at what pax-web
> related bundles can do) that will be applied
>
> > So far I've spent a considerable amount of hours to figure out how to
> > perform a configuration that should be a basic task so I'm a bit
> confused
> > why it must be so complicated.
> >
>
> Well, getting DOSGI picking up the spring context and applying it to the
> created endpoints is complicated; so using HttpService can help, IMHO it
> is a better strategy anyway, getting the endpoints relying on OSGI
> HTTPService.
>
> Sergey
>
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5088979.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
> Blog: http://sberyozkin.blogspot.com
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5089258.html
> To unsubscribe from Fail to deploy webservice with httpj:engine-factory
> config, click here<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5088923&code=cGV0ZXIubmVyZ0BnbWFpbC5jb218NTA4ODkyM3w5NjEyMzgxMDk=>
> .
> NAML<http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
--
View this message in context: http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5089740.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Fail to deploy webservice with httpj:engine-factory config
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 20/12/11 14:17, Peter Nerg wrote:
> Ok, that was a swift answer...
>
> However I'm not sure I follow your suggestion.
> Basically the only thing I want to do is to ramp up the number of executing
> threads in Jetty.
> Not sure what the default settings are but it doesn't seem to scale much
> beyond 5 concurrent threads from my load test in soap ui.
>
> Is there a better way to configure this on a global level or do I actually
> have to do it per deployed end point?
>
> If I have to do it per endpoint then I'm not sure I follow your suggestion
> to /"Consider binding the DOSGI endpoints to HttpService which may help with
> picking up container-specific HTTP configs"/
> Do you mean to create BundleActivator and somehow deploy my endpoint to the
> HTTPService?
> I have not found any examples/documentation on how this would be done.
Sorry, I was referring to org.apache.cxf.ws.httpservice.context &
org.apache.cxf.rs.httpservice.context properties, see
http://cxf.apache.org/distributed-osgi-reference.html
This way it is HttpService configuration (have a look at what pax-web
related bundles can do) that will be applied
> So far I've spent a considerable amount of hours to figure out how to
> perform a configuration that should be a basic task so I'm a bit confused
> why it must be so complicated.
>
Well, getting DOSGI picking up the spring context and applying it to the
created endpoints is complicated; so using HttpService can help, IMHO it
is a better strategy anyway, getting the endpoints relying on OSGI
HTTPService.
Sergey
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5088979.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: Fail to deploy webservice with httpj:engine-factory config
Posted by Peter Nerg <pe...@gmail.com>.
Ok, that was a swift answer...
However I'm not sure I follow your suggestion.
Basically the only thing I want to do is to ramp up the number of executing
threads in Jetty.
Not sure what the default settings are but it doesn't seem to scale much
beyond 5 concurrent threads from my load test in soap ui.
Is there a better way to configure this on a global level or do I actually
have to do it per deployed end point?
If I have to do it per endpoint then I'm not sure I follow your suggestion
to /"Consider binding the DOSGI endpoints to HttpService which may help with
picking up container-specific HTTP configs"/
Do you mean to create BundleActivator and somehow deploy my endpoint to the
HTTPService?
I have not found any examples/documentation on how this would be done.
So far I've spent a considerable amount of hours to figure out how to
perform a configuration that should be a basic task so I'm a bit confused
why it must be so complicated.
--
View this message in context: http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5088979.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Fail to deploy webservice with httpj:engine-factory config
Posted by Sergey Beryozkin <sb...@gmail.com>.
On 20/12/11 13:52, Peter Nerg wrote:
> I'm using Felix + DOSGi 1.2.
> My goal is to configure the amount of threads in the Jetty HTTP service and
> from what I gather the only way to do so is to provide the configuration via
> a spring context.
> I have a bit difficulties following the provided examples as they are only
> fragments not providing a end-to-end example, starting with the code and how
> to configure my bundle to make it deploy.
>
> So I modified my spring context (META-INF/spring/beans.xml) that exposes a
> WS endpoint as follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
> xmlns:beans="http://www.springframework.org/schema/beans"
> xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws
> http://cxf.apache.org/schemas/jaxws.xsd
> http://cxf.apache.org/transports/http/configuration
> http://cxf.apache.org/schemas/configuration/http-conf.xsd
> http://cxf.apache.org/transports/http-jetty/configuration
> http://cxf.apache.org/schemas/configuration/http-jetty.xsd">
>
> <httpj:engine-factory bus="cxf">
> <httpj:engine port="6969">
> <httpj:threadingParameters minThreads="5"
> maxThreads="100" />
> <httpj:connector>
> <beans:bean class="org.mortbay.jetty.bio.SocketConnector">
> <beans:property name="port" value="6969" />
> </beans:bean>
> </httpj:connector>
> <httpj:handlers>
> <beans:bean class="org.mortbay.jetty.handler.DefaultHandler" />
> </httpj:handlers>
> <httpj:sessionSupport>true</httpj:sessionSupport>
> </httpj:engine>
> </httpj:engine-factory>
>
making DOSGI recognize the context configuration such as
<httpj:engine-factory> has been on the map for a long time but it's a
big enough effort that no one has found the time to look into yet.
Consider binding the DOSGI endpoints to HttpService which may help with
picking up container-specific HTTP configs
>
> <jaxws:endpoint
> id="test"
> implementor="xxxx"
> address="yyyy"/>
> </beans>
>
jaxws:endpoint bypasses the DOSGI runtime
Cheers, Sergey
> However this fails with an error stating that there is no bean called "cxf".
> Searching for this error message I find that I must import a number of
> context files.
>
> <import resource="classpath:META-INF/cxf/cxf.xml"/>
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
> <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
>
> Having added these I now get an error stating :
> java.io.FileNotFoundException: OSGi resource[classpath:META-INF/cxf/cxf.xml
>
> I only assume that the imported files are provided somehow by the DOSGi
> bundles.
> For some reason I fail to import them.
>
> Is there something that should be added to the manifest file of my bundle to
> import these?
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Fail-to-deploy-webservice-with-httpj-engine-factory-config-tp5088923p5088923.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com