You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rsteppac2 <ra...@steppacher.name> on 2014/10/29 12:35:25 UTC

Bundle using camel-spring-ws failes to deploy in Karaf

Hi all,

I have a small test project that uses camel-spring-ws (2.14.0). It runs just
fine in a Spring context and the WS client calls are acted on by my routes.
Now I want to convert it to blueprints to deploy it in Karaf (3.0.2).
However, the deployment of the bundle fails with:

   waiting for namespace handlers
[http://www.springframework.org/schema/web-services]

Can anyone tell me which bundle/feature is supposed to contribute this
namespace handler? The feature descriptor I am using to deploy the bundle
("pas-webservice-hp") looks like this:

<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.1"
name="ams-feature">
    <feature name="pas-webservice-hp" version="3.0.0-SNAPSHOT"
description="PAS Webservice for HPs">
        <feature version="2.14.0">camel-core</feature>
        <feature version="2.14.0">camel-spring</feature>
        <feature version="2.14.0">camel-blueprint</feature>
        <feature version="2.14.0">camel-spring-ws</feature>
        <bundle
dependency="true">mvn:ch.vivates.ams/base/3.0.0-SNAPSHOT</bundle>
        <bundle>mvn:ch.vivates.ams/pas-webservice-hp/3.0.0-SNAPSHOT</bundle>
    </feature>
</features>

The offending part of the blueprints descriptor is this:

<sws:static-wsdl id="ams_hp_ws" location="wsdl/v1/ams_hp_ws.wsdl" />

which is required by this:

<bean id="wsdlHandler"
class="org.springframework.ws.transport.http.WsdlDefinitionHttpHandler">
    <property name="definition" ref="ams_hp_ws" />
</bean>

Might be I am going about it the wrong way altogether... In the Spring
context descriptor I used the JDK HTTP server as described  here
<http://docs.spring.io/spring-ws/docs/2.2.0.RELEASE/reference/htmlsingle/#d4e1003>  
to avoid having to run a servlet container. I copied the same configuration
over to the blueprint descriptor to get started. Is this approach going to
work at all when deploying to Karaf?
The WsdlDefinitionHttpHandler is specific to using the embedded HTTP server,
but using the dispatcher servlet in a container still requires me to provide
the WSDL I want to expose with a <sws:static-wsdl ..> tag.


Thanks for your help!
Ralf 

PS.: This is a resend with slightly modified subject because the first
message was rejected due to a too high spam score. If both make it to the
list, my apologies!



--
View this message in context: http://camel.465427.n5.nabble.com/Bundle-using-camel-spring-ws-failes-to-deploy-in-Karaf-tp5758291.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Bundle using camel-spring-ws failes to deploy in Karaf

Posted by rsteppac2 <ra...@steppacher.name>.
Hello Willem,

there is no Spring 4 involved. Unless you add camel-test-spring 2.14.0 as a
dependency, which I have not done at this point in time. camel-spring 2.14.0
pulls in Spring 3.2.11.RELEASE as its dependency.

Same with the Karaf features. Installing my feature with the descriptor
above leads to the following features to be installed:

karaf@root()> feature:list -i |grep -i spring
spring-dm         | 1.2.1            | x         | spring-3.0.2            |
Spring DM support
spring            | 3.2.11.RELEASE_1 | x         | spring-3.0.2            |
Spring 3.2.x support
spring-jms        | 3.2.11.RELEASE_1 | x         | spring-3.0.2            |
Spring 3.2.x JMS support
spring-oxm        | 3.2.11.RELEASE_1 | x         | spring-3.0.2            |
Spring 3.2.x OXM support
spring-tx         | 3.2.11.RELEASE_1 | x         | spring-3.0.2            |
Spring 3.2.x Transaction (TX) support
spring-web        | 3.2.11.RELEASE_1 | x         | spring-3.0.2            |
Spring 3.2.x Web support
camel-spring      | 2.14.0           | x         | camel-2.14.0            |
camel-spring-ws   | 2.14.0           | x         | camel-2.14.0            |

karaf@root()> bundle:list |grep -i spring
 88 | Active   |  50 | 2.14.0         | camel-spring
114 | Active   |  50 | 2.1.4.RELEASE  | Spring XML
115 | Active   |  50 | 2.1.4.RELEASE  | Spring Web Services Core, Fragments:
116
116 | Resolved |  50 | 2.1.4.RELEASE  | Spring Web Services Support, Hosts:
115
117 | Active   |  50 | 2.14.0         | camel-spring-ws

For now I have settled for deploying a spring context instead of blueprint.
However, that deployment is far from straight forward, too. I had to add
additional system parameters to the Karaf start script.

-Djavax.xml.soap.MessageFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl 
-Djavax.xml.soap.MetaFactory=com.sun.xml.internal.messaging.saaj.soap.SAAJMetaFactoryImpl 
-Djavax.xml.soap.SOAPFactory=com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPFactory1_1Impl

Plus a dynamic import header in the manifest of my bundle: 

DynamicImport-Package: *

Without those additions I end up with this in the log:

Caused by: javax.xml.soap.SOAPException: Unable to create MessageFactory:
Provider for javax.xml.soap.MessageFactory cannot be found
	at
javax.xml.soap.MessageFactory.newInstance(MessageFactory.java:90)[:2.4.0]
	at
org.springframework.ws.soap.saaj.SaajSoapMessageFactory.afterPropertiesSet(SaajSoapMessageFactory.java:147)[115:org.springframework.ws:2.1.4.RELEASE]
	... 16 more

The original exception, which is only visible in the debugger, sais:

javax.xml.soap.SOAPException: Provider
org.apache.axis2.saaj.SAAJMetaFactoryImpl not found


Ralf



--
View this message in context: http://camel.465427.n5.nabble.com/Bundle-using-camel-spring-ws-failes-to-deploy-in-Karaf-tp5758291p5758358.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Bundle using camel-spring-ws failes to deploy in Karaf

Posted by Willem Jiang <wi...@gmail.com>.
I’m afraid Spring-DM cannot work with Spring4.x, you need to use Karaf 2.4.x which still use spring 3.2.x to deploy the camel-spring-ws feature.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On October 29, 2014 at 7:35:53 PM, rsteppac2 (ralf@steppacher.name) wrote:
> Hi all,
>  
> I have a small test project that uses camel-spring-ws (2.14.0). It runs just
> fine in a Spring context and the WS client calls are acted on by my routes.
> Now I want to convert it to blueprints to deploy it in Karaf (3.0.2).
> However, the deployment of the bundle fails with:
>  
> waiting for namespace handlers
> [http://www.springframework.org/schema/web-services]
>  
> Can anyone tell me which bundle/feature is supposed to contribute this
> namespace handler? The feature descriptor I am using to deploy the bundle
> ("pas-webservice-hp") looks like this:
>  
> > name="ams-feature">
> > description="PAS Webservice for HPs">
> camel-core
> camel-spring
> camel-blueprint
> camel-spring-ws
> > dependency="true">mvn:ch.vivates.ams/base/3.0.0-SNAPSHOT
> mvn:ch.vivates.ams/pas-webservice-hp/3.0.0-SNAPSHOT
>  
>  
>  
> The offending part of the blueprints descriptor is this:
>  
>  
>  
> which is required by this:
>  
> > class="org.springframework.ws.transport.http.WsdlDefinitionHttpHandler">  
>  
>  
>  
> Might be I am going about it the wrong way altogether... In the Spring
> context descriptor I used the JDK HTTP server as described here
>  
> to avoid having to run a servlet container. I copied the same configuration
> over to the blueprint descriptor to get started. Is this approach going to
> work at all when deploying to Karaf?
> The WsdlDefinitionHttpHandler is specific to using the embedded HTTP server,
> but using the dispatcher servlet in a container still requires me to provide
> the WSDL I want to expose with a tag.
>  
>  
> Thanks for your help!
> Ralf
>  
> PS.: This is a resend with slightly modified subject because the first
> message was rejected due to a too high spam score. If both make it to the
> list, my apologies!
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Bundle-using-camel-spring-ws-failes-to-deploy-in-Karaf-tp5758291.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.
>