You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Driesen Gert <Ge...@cegeka.be> on 2012/08/18 12:39:39 UTC
cxf-codegen-plugin/wsdl2java: relative paths in WSDL/XSD not
resolved relative to the WSDL/XSD in which they are referenced
Hello,
I'm having the issue with the cxf-codegen-plugin and wsdl2java:
I'm attempting use CXF to generate the java (client) sources for a given WSDL (specified with absolute path).
In that WSDL I import another WSDL with a relative path (../SomeWSDL.wsdl).
I would expect CXF to resolve that imported WSDL relative to the importing WSDL, but apparently it is resolved relative to the current directory.
Hence the following error:
WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/D:/RSVZ/GWYSecurity/Gateway/Implementation/GWYSecurity_Gateway_Services/target/generated-resources/GWYSecurity/GWYSecurity_V1.wsdl
Caused by : WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing '../Helper_V1.wsdl'.: java.io.FileNotFoundException: D:\RSVZ\GWYSecurity\Gateway\Implementation\Helper_V1.wsdl (The system cannot find the file specified)
where the current directory is "D:\RSVZ\GWYSecurity\Gateway\Implementation\GWYSecurity_Gateway_Services".
I need CXF to always resolve ANY imported WSDL or XSD to the importing WSDL/XSD.
Can I somehow configure the cxf-codegen-plugin for this to work ?
I'm not sure if this can be considered a bug in CXF.
Thanks!
Gert
This e-mail and all files transmitted as attachment(s) thereto are confidential and solely intended for the individual to whom or the organization to which they are addressed. If you received this e-mail by mistake, please notify Cegeka's Service Desk at cegeka.support@cegeka.be or call +32 (0)11 240 363. We thank you in advance. Cegeka hereby confirms that this message has been swept by Sophos for the presence of viruses.
Re: cxf-codegen-plugin/wsdl2java: relative paths in WSDL/XSD not
resolved relative to the WSDL/XSD in which they are referenced
Posted by Mark Streit <mc...@gmail.com>.
Did the WSDL/XSDs get generated with some IDE tool (wizard) before and then
you are using this Maven plugin to generate the proxy artifacts from them?
Just curious why there would be "hardened" physical paths like that.
As Glen indicates, one would normally never see absolute paths to a file
system in WSDL and XSDs - (unless someone purposely wrote the WSDL/XSD by
hand and that way could never really work).
As stated, these are usually RELATIVE on a classpath for packaged artifacts
like /META-INF/wsdl or /WEB-INF/wsdl --- this is a common pattern when
"localizing" the WSDL/XSDs with the generated artifacts.
Take a look at these threads:
http://cxf.547215.n5.nabble.com/WSDLException-faultCode-PARSER-ERROR-Connection-reset-td5711085.html#a5711241
http://cxf.547215.n5.nabble.com/WSDL-Service-Creation-Exception-td5711590.html
Perhaps they can help.
On Sat, Aug 18, 2012 at 12:46 PM, Glen Mazza <gm...@talend.com> wrote:
> Your request seems unusual--file-referencing in Java is usually done from
> the current directory or the classpath root, not inherited from the
> physical location of the file making that reference. Are you aware of any
> other place in Java-ville that would reference files in the manner you're
> requesting?
>
> Glen
>
>
> On 08/18/2012 06:39 AM, Driesen Gert wrote:
>
>> Hello,
>>
>> I'm having the issue with the cxf-codegen-plugin and wsdl2java:
>>
>> I'm attempting use CXF to generate the java (client) sources for a given
>> WSDL (specified with absolute path).
>> In that WSDL I import another WSDL with a relative path
>> (../SomeWSDL.wsdl).
>> I would expect CXF to resolve that imported WSDL relative to the
>> importing WSDL, but apparently it is resolved relative to the current
>> directory.
>> Hence the following error:
>>
>> WSDLToJava Error: org.apache.cxf.wsdl11.**WSDLRuntimeException: Fail to
>> create wsdl definition from : file:/D:/RSVZ/GWYSecurity/**
>> Gateway/Implementation/**GWYSecurity_Gateway_Services/**
>> target/generated-resources/**GWYSecurity/GWYSecurity_V1.**wsdl
>> Caused by : WSDLException (at /wsdl:definitions/wsdl:import)**:
>> faultCode=PARSER_ERROR: Problem parsing '../Helper_V1.wsdl'.:
>> java.io.FileNotFoundException: D:\RSVZ\GWYSecurity\Gateway\**Implementation\Helper_V1.wsdl
>> (The system cannot find the file specified)
>>
>> where the current directory is "D:\RSVZ\GWYSecurity\Gateway\**
>> Implementation\GWYSecurity_**Gateway_Services".
>>
>> I need CXF to always resolve ANY imported WSDL or XSD to the importing
>> WSDL/XSD.
>> Can I somehow configure the cxf-codegen-plugin for this to work ?
>> I'm not sure if this can be considered a bug in CXF.
>>
>> Thanks!
>> Gert
>>
>>
>> This e-mail and all files transmitted as attachment(s) thereto are
>> confidential and solely intended for the individual to whom or the
>> organization to which they are addressed. If you received this e-mail by
>> mistake, please notify Cegeka's Service Desk at cegeka.support@cegeka.beor call +32
>> (0)11 240 363. We thank you in advance. Cegeka hereby confirms that this
>> message has been swept by Sophos for the presence of viruses.
>>
>>
>
--
Mark
***
*
Re: cxf-codegen-plugin/wsdl2java: relative paths in WSDL/XSD not
resolved relative to the WSDL/XSD in which they are referenced
Posted by Glen Mazza <gm...@talend.com>.
Your request seems unusual--file-referencing in Java is usually done
from the current directory or the classpath root, not inherited from the
physical location of the file making that reference. Are you aware of
any other place in Java-ville that would reference files in the manner
you're requesting?
Glen
On 08/18/2012 06:39 AM, Driesen Gert wrote:
> Hello,
>
> I'm having the issue with the cxf-codegen-plugin and wsdl2java:
>
> I'm attempting use CXF to generate the java (client) sources for a given WSDL (specified with absolute path).
> In that WSDL I import another WSDL with a relative path (../SomeWSDL.wsdl).
> I would expect CXF to resolve that imported WSDL relative to the importing WSDL, but apparently it is resolved relative to the current directory.
> Hence the following error:
>
> WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/D:/RSVZ/GWYSecurity/Gateway/Implementation/GWYSecurity_Gateway_Services/target/generated-resources/GWYSecurity/GWYSecurity_V1.wsdl
> Caused by : WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing '../Helper_V1.wsdl'.: java.io.FileNotFoundException: D:\RSVZ\GWYSecurity\Gateway\Implementation\Helper_V1.wsdl (The system cannot find the file specified)
>
> where the current directory is "D:\RSVZ\GWYSecurity\Gateway\Implementation\GWYSecurity_Gateway_Services".
>
> I need CXF to always resolve ANY imported WSDL or XSD to the importing WSDL/XSD.
> Can I somehow configure the cxf-codegen-plugin for this to work ?
> I'm not sure if this can be considered a bug in CXF.
>
> Thanks!
> Gert
>
>
> This e-mail and all files transmitted as attachment(s) thereto are confidential and solely intended for the individual to whom or the organization to which they are addressed. If you received this e-mail by mistake, please notify Cegeka's Service Desk at cegeka.support@cegeka.be or call +32 (0)11 240 363. We thank you in advance. Cegeka hereby confirms that this message has been swept by Sophos for the presence of viruses.
>
RE: cxf-codegen-plugin/wsdl2java: relative paths in WSDL/XSD not
resolved relative to the WSDL/XSD in which they are referenced
Posted by Driesen Gert <Ge...@cegeka.be>.
Hello Dan (and everyone else that responsed),
After performing a clean, I can no longer reproduce the issue.
Sorry for the false alert :p
I'm still using 2.5.4 because of a blocking issue in 2.6.1where the TrustManagers - that I set using TLSClientParameters on the HTTPConduit - are ignored.
Let me dig a little deeper -and try 2.6.2 - before I report this issue.
Thanks,
Gert
________________________________________
From: Daniel Kulp [dkulp@apache.org]
Sent: Tuesday, August 21, 2012 7:18 PM
To: users@cxf.apache.org
Subject: Re: cxf-codegen-plugin/wsdl2java: relative paths in WSDL/XSD not resolved relative to the WSDL/XSD in which they are referenced
In theory, this should be working fine providing the URL's passed into wsdl2java are proper. If it's not working, please log a bug with a test case.
That said, also make sure you are using the latest CXF. Could be a bug that's already been fixed.
Dan
On Aug 18, 2012, at 6:39 AM, Driesen Gert <Ge...@cegeka.be> wrote:
> Hello,
>
> I'm having the issue with the cxf-codegen-plugin and wsdl2java:
>
> I'm attempting use CXF to generate the java (client) sources for a given WSDL (specified with absolute path).
> In that WSDL I import another WSDL with a relative path (../SomeWSDL.wsdl).
> I would expect CXF to resolve that imported WSDL relative to the importing WSDL, but apparently it is resolved relative to the current directory.
> Hence the following error:
>
> WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/D:/RSVZ/GWYSecurity/Gateway/Implementation/GWYSecurity_Gateway_Services/target/generated-resources/GWYSecurity/GWYSecurity_V1.wsdl
> Caused by : WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing '../Helper_V1.wsdl'.: java.io.FileNotFoundException: D:\RSVZ\GWYSecurity\Gateway\Implementation\Helper_V1.wsdl (The system cannot find the file specified)
>
> where the current directory is "D:\RSVZ\GWYSecurity\Gateway\Implementation\GWYSecurity_Gateway_Services".
>
> I need CXF to always resolve ANY imported WSDL or XSD to the importing WSDL/XSD.
> Can I somehow configure the cxf-codegen-plugin for this to work ?
> I'm not sure if this can be considered a bug in CXF.
>
> Thanks!
> Gert
>
>
> This e-mail and all files transmitted as attachment(s) thereto are confidential and solely intended for the individual to whom or the organization to which they are addressed. If you received this e-mail by mistake, please notify Cegeka's Service Desk at cegeka.support@cegeka.be or call +32 (0)11 240 363. We thank you in advance. Cegeka hereby confirms that this message has been swept by Sophos for the presence of viruses.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com
Re: cxf-codegen-plugin/wsdl2java: relative paths in WSDL/XSD not resolved relative to the WSDL/XSD in which they are referenced
Posted by Daniel Kulp <dk...@apache.org>.
In theory, this should be working fine providing the URL's passed into wsdl2java are proper. If it's not working, please log a bug with a test case.
That said, also make sure you are using the latest CXF. Could be a bug that's already been fixed.
Dan
On Aug 18, 2012, at 6:39 AM, Driesen Gert <Ge...@cegeka.be> wrote:
> Hello,
>
> I'm having the issue with the cxf-codegen-plugin and wsdl2java:
>
> I'm attempting use CXF to generate the java (client) sources for a given WSDL (specified with absolute path).
> In that WSDL I import another WSDL with a relative path (../SomeWSDL.wsdl).
> I would expect CXF to resolve that imported WSDL relative to the importing WSDL, but apparently it is resolved relative to the current directory.
> Hence the following error:
>
> WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsdl definition from : file:/D:/RSVZ/GWYSecurity/Gateway/Implementation/GWYSecurity_Gateway_Services/target/generated-resources/GWYSecurity/GWYSecurity_V1.wsdl
> Caused by : WSDLException (at /wsdl:definitions/wsdl:import): faultCode=PARSER_ERROR: Problem parsing '../Helper_V1.wsdl'.: java.io.FileNotFoundException: D:\RSVZ\GWYSecurity\Gateway\Implementation\Helper_V1.wsdl (The system cannot find the file specified)
>
> where the current directory is "D:\RSVZ\GWYSecurity\Gateway\Implementation\GWYSecurity_Gateway_Services".
>
> I need CXF to always resolve ANY imported WSDL or XSD to the importing WSDL/XSD.
> Can I somehow configure the cxf-codegen-plugin for this to work ?
> I'm not sure if this can be considered a bug in CXF.
>
> Thanks!
> Gert
>
>
> This e-mail and all files transmitted as attachment(s) thereto are confidential and solely intended for the individual to whom or the organization to which they are addressed. If you received this e-mail by mistake, please notify Cegeka's Service Desk at cegeka.support@cegeka.be or call +32 (0)11 240 363. We thank you in advance. Cegeka hereby confirms that this message has been swept by Sophos for the presence of viruses.
--
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com