You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Vincent Girard-Reydet (JIRA)" <ji...@apache.org> on 2010/02/04 10:04:32 UTC

[jira] Created: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Schema files relative to WSDL file break CxfEndpoint
----------------------------------------------------

                 Key: CAMEL-2449
                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-cxf
    Affects Versions: 2.1.0
         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
Camel 2.1.0 with CXF 2.2.5
Sun JDK 1.6.17
Windows XP SP3
            Reporter: Vincent Girard-Reydet


I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :

<c:camelContext>
    <c:route>
        <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
        <c:to uri="log:test"/>
     </c:route>
</c:camelContext>

 There are 2 problems:

1. If the XSD is imported like this (without "./" in schemaLocation):
   <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
    </xs:schema>

then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
		address="/AlarmServices2" 
		serviceClass="eu.diva.tis.alert.internal.Test"
		endpointName="alarm:AlarmServicesSOAP12port_http" 
		serviceName="alarm:AlarmServices"
		xmlns:alarm="http://diva.thales"/>
but if I use the Service Provider API it will fail:
    <cxf:cxfEndpoint id="alarmServiceEndpoint"
		address="/AlarmServices" 
		serviceClass="com.thales.diva.AlarmServicesProvider"
		endpointName="alarm:AlarmServicesSOAP12port_http" 
		serviceName="alarm:AlarmServices"
		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
		xmlns:alarm="http://diva.thales" />
with the following exception:
Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
        at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
        ...
Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
        at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
        at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
        at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
        at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
        ... 28 more

2. Now if I change my WSDL to use a relative location for the XSD import:
    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
    </xs:schema>

In *both* cases, I get the following, very strange error:

Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
        at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
        at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
        ... 
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
        at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
        at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
       ...
Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
o org.apache.camel.spring.SpringCamelContext
        at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
        at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
        at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
        at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
       ...

Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Vincent Girard-Reydet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57374#action_57374 ] 

Vincent Girard-Reydet commented on CAMEL-2449:
----------------------------------------------

I must add that this it seems to be a regression. In another environment with the environment below it works perfectly. This was done with the Servicemix 4.1.0-SNAPSTHOT from 2009/12/03 (before Camel 2.1.0 was released). The Servicemix was patched to circumvene the deployment problems with teh web deployers.

karaf@root> osgi:list | grep camel
[  82] [Active     ] [            ] [       ] [   60] camel-core (2.1.0.SNAPSHOT)
[  85] [Active     ] [            ] [       ] [   60] camel-spring (2.1.0.SNAPSHOT)
[  86] [Active     ] [            ] [       ] [   60] camel-osgi (2.1.0.SNAPSHOT)
[ 170] [Active     ] [            ] [       ] [   60] camel-spring-osgi (2.1.0.SNAPSHOT)
[ 187] [Active     ] [            ] [       ] [   60] camel-cxf (2.1.0.SNAPSHOT)
[ 188] [Active     ] [            ] [       ] [   60] activemq-camel (5.3.0)
[ 189] [Active     ] [            ] [       ] [   60] camel-jms (2.1.0.SNAPSHOT)
[ 190] [Active     ] [            ] [       ] [   60] camel-jaxb (2.1.0.SNAPSHOT)
[ 191] [Active     ] [            ] [       ] [   60] camel-stream (2.1.0.SNAPSHOT)
karaf@root> osgi:list | grep CXF
[ 137] [Active     ] [            ] [       ] [   60] Apache CXF Bundle Jar (2.2.5)
[ 138] [Active     ] [            ] [       ] [   60] ServiceMix :: CXF Binding Component (2009.02.0.SNAPSHOT)
[ 166] [Active     ] [            ] [       ] [   60] Apache CXF Runtime JBI Binding (2.2.5)
[ 167] [Active     ] [            ] [       ] [   60] Apache CXF Runtime JBI Transport (2.2.5)
[ 168] [Active     ] [            ] [       ] [   60] ServiceMix :: CXF Service Engine (2009.02.0.SNAPSHOT)
[ 169] [Active     ] [            ] [       ] [   60] Apache ServiceMix Example :: CXF OSGi (4.1.0.SNAPSHOT)


> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>         Attachments: upload.zip
>
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Vincent Girard-Reydet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57379#action_57379 ] 

Vincent Girard-Reydet commented on CAMEL-2449:
----------------------------------------------

OK, it seems to fix the problem. By the way I was not able to reproduce my problem in a genuine SMX4 build, so it seems my environment has become somewhat corrupted. Closing the bug for now.

Willem, did you have a chance to discuss with JB Onofré about the version conflict problem ? Seems that you have fixed it in the Fuse version and I think it would be great having it in the genuine SMX4 distro.

> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>         Attachments: upload.zip
>
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57375#action_57375 ] 

Willem Jiang commented on CAMEL-2449:
-------------------------------------

Hi Vincent,
I tried to build the test case on my box by fixing the jmx-ri issue, and jaxb, jaxws issue ( I'm using JDK 1.5).
Now I'm blocked with this error
{code}

upload/src/main/java/com/thales/diva/Test2.java:[3,26] cannot find symbol
symbol  : class CmdApisServicesPortType
location: package eu.diva.tis.api.ws

upload/src/main/java/com/thales/diva/Test2.java:[9,30] cannot find symbol
symbol: class CmdApisServicesPortType
public class Test2 implements CmdApisServicesPortType {

{code}

Can you submit a newer test case?


> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>         Attachments: upload.zip
>
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Vincent Girard-Reydet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Girard-Reydet closed CAMEL-2449.
----------------------------------------

    Resolution: Cannot Reproduce

Closing the bug unless I find how the environment became corrupted.

> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>         Attachments: upload.zip
>
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Vincent Girard-Reydet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57371#action_57371 ] 

Vincent Girard-Reydet commented on CAMEL-2449:
----------------------------------------------

I deploy the camel-context inside an OSGi bundle (files to come, I'm cleaning up things). As for Camel and cxf bundles, here is the list:

[  43] [Active     ] [            ] [       ] [   60] camel-core (2.1.0)
[  44] [Active     ] [            ] [       ] [   60] camel-stream (2.1.0)
[  67] [Active     ] [            ] [       ] [   60] Apache CXF Bundle Jar (2.2.5)
[  88] [Active     ] [            ] [       ] [   60] camel-jms (2.1.0)
[  89] [Active     ] [            ] [       ] [   60] camel-jaxb (2.1.0)
[ 108] [Active     ] [            ] [       ] [   60] camel-spring (2.1.0)
[ 109] [Active     ] [            ] [       ] [   60] camel-osgi (2.1.0)
[ 110] [Active     ] [            ] [       ] [   60] camel-spring-osgi (2.1.0)
[ 125] [Active     ] [            ] [       ] [   60] camel-cxf (2.1.0)
[ 128] [Active     ] [            ] [       ] [   60] activemq-camel (5.3.0)

Note: I removed all the servicemix components because of the integration bug with Camel.

> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Vincent Girard-Reydet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Girard-Reydet updated CAMEL-2449:
-----------------------------------------

    Attachment: upload.zip

A minimum test case to reproduce the problem

> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>         Attachments: upload.zip
>
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57369#action_57369 ] 

Willem Jiang commented on CAMEL-2449:
-------------------------------------

Do you wrap the camel-context as the ServiceUnit?
Or just deploy the camel-context as osgi bundle?

There may have more than one version of camel in the servicemix, please uninstall the useless one.


> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CAMEL-2449) Schema files relative to WSDL file break CxfEndpoint

Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/CAMEL-2449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=57376#action_57376 ] 

Willem Jiang commented on CAMEL-2449:
-------------------------------------

Did you try to use the Fuse ESB, which should be will tested and there is no version conflict between servicemix , camel, cxf.
You can find the latest 4.1.0-psc-01-RC1 [here|http://fusesource.com/products/enterprise-servicemix4/] 

> Schema files relative to WSDL file break CxfEndpoint
> ----------------------------------------------------
>
>                 Key: CAMEL-2449
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2449
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.1.0
>         Environment: ServiceMix 4.1.0 SNAPSHOT (head:904129), without the JBI components
> Camel 2.1.0 with CXF 2.2.5
> Sun JDK 1.6.17
> Windows XP SP3
>            Reporter: Vincent Girard-Reydet
>         Attachments: upload.zip
>
>
> I have a WSDL (see files attached) that imports a schema file. I create a Camel-CXF route from a SOAP endpoint to a logger :
> <c:camelContext>
>     <c:route>
>         <c:from uri="cxf:bean:alarmServiceEndpoint2"/>
>         <c:to uri="log:test"/>
>      </c:route>
> </c:camelContext>
>  There are 2 problems:
> 1. If the XSD is imported like this (without "./" in schemaLocation):
>    <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="AlarmServices.xsd"/>
>     </xs:schema>
> then it is possible to create a CXF Endpoint using an implementation class (see files attached, the Test class is an implementation os the AlarmServices SEI):
> 	<cxf:cxfEndpoint id="alarmServiceEndpoint2"
> 		address="/AlarmServices2" 
> 		serviceClass="eu.diva.tis.alert.internal.Test"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		xmlns:alarm="http://diva.thales"/>
> but if I use the Service Provider API it will fail:
>     <cxf:cxfEndpoint id="alarmServiceEndpoint"
> 		address="/AlarmServices" 
> 		serviceClass="com.thales.diva.AlarmServicesProvider"
> 		endpointName="alarm:AlarmServicesSOAP12port_http" 
> 		serviceName="alarm:AlarmServices"
> 		wsdlURL="classpath:/diva/schemas/AlarmServices.wsdl"
> 		xmlns:alarm="http://diva.thales" />
> with the following exception:
> Exception in thread "SpringOsgiExtenderThread-56" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
>         at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1039)
>         at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
>         ...
> Caused by: javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:types/xs:schema): faultCode=PARSER_ERROR: Problem parsing 'AlarmServices.xsd'.: java.io.FileNotFoundException: D:\smx4\build2\AlarmServices.xsd (The specified file cannot be found)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseSchema(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseTypes(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:229)
>         at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
>         at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
>         ... 28 more
> 2. Now if I change my WSDL to use a relative location for the XSD import:
>     <xs:schema xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://diva.thales/xsd" schemaLocation="./AlarmServices.xsd"/>
>     </xs:schema>
> In *both* cases, I get the following, very strange error:
> Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route10: Route[[From[cxf:bean:alarmServiceEndpoint2]] -> [To[log:test... because of Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:141)
>         at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:601)
>         at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1156)
>         at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1073)
>         ... 
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: cxf://bean:alarmServiceEndpoint2 due to: org.apache.camel.spring.SpringCamelContext cannot be cast to org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:437)
>         at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:46)
>        ...
> Caused by: java.lang.ClassCastException: org.apache.camel.spring.SpringCamelContext cannot be cast t
> o org.apache.camel.spring.SpringCamelContext
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.init(CxfSpringEndpoint.java:68)
>         at org.apache.camel.component.cxf.CxfSpringEndpoint.<init>(CxfSpringEndpoint.java:61)
>         at org.apache.camel.component.cxf.CxfComponent.createEndpoint(CxfComponent.java:63)
>         at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:78)
>        ...
> Using a debugger I checked in the CxfSpringEndpoint init() method that the  CamelContext instance retrieved is really a SpringCamelContext. In the Manifest.MF of my bundle I have imported nearly all Camel packages (including org.apache.camel.spring) but it does not change anything.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.