You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Stevo Slavić <ss...@gmail.com> on 2011/08/22 11:36:28 UTC

cxf-codegen-plugin, wsdl2java and spaces in wsdl path

Hello cxf users,

cxf-codegen-plugin v 2.1.x (tried 2.1.3 & 2.1.10), 2.2.12 and 2.3.6
have issue with spaces in wsdl path when generating Java classes
(tried with 2.4.2 too but dependencies of plugin and project are not
compatible).

In use case where issue is reproduced there are two child modules W
(for wsdl) and J (for java) of parent module P, W has WSDL files, J
has wsdl2java configured. J declares property wsdl.project.location
equal to ../W, while wsdlOption/wsdl references this property. When P
is built on a path with spaces build fails, otherwise it's successful.

It seems wsdl2java wrongly interprets full path with spaces as
relative path and then decides to append current directory prefix
twice.

Can anyone reproduce this?

Regards,
Stevo.

cxf-codegen-plugin, wsdl2java and spaces in wsdl path

Posted by Stevo Slavić <ss...@gmail.com>.
It turned out to be issue with configuration - bindings were
configured via extraargs (one with -b switch, followed by other
extraarg with value file:${basedir}/pathtowsdl). Since I'm working on
Windows those path separators in basedir are "\" and with spaces in
between it would cause generation to fail. I've change configuration
to use bindingFiles/bindingFile configuration parameter instead and it
works. Maybe extraargs approach would work if configured with addition
of quotes.

I'm trying now to implement m2e connector for cxf-codegen-plugin so
that it can be used at least to generate java from wsdl. There is a
support ticket for this at
https://bugs.eclipse.org/bugs/show_bug.cgi?id=350081 I'm using
https://github.com/bitstrings/m2e-jaxb2-connector as starting point,
hoping it won't be much different for cxf. Did any of cxf developers
already do anything on that issue? I've seen there's some work done at
https://github.com/mtpettyp/m2eclipse-extras/tree/master/org.sonatype.m2e.cxf

Regards,
Stevo.

On Tue, Aug 23, 2011 at 9:08 PM, Daniel Kulp <dk...@apache.org> wrote:
>
>
> Can you produce a full maven base testcase using a hello-world wsdl or similar
> and file a JIRA?
>
> Our Windows nightly at:
> https://builds.apache.org/view/A-F/view/CXF/job/CXF-trunk-windows/
>
> is specifically setup to run in a directory with a space as well as to have a
> maven-repo in a directory with a space.  We pretty much did that to test  some
> of the handling of the various pieces when there are spaces there.   Thus, I'm
> slightly surprised by this.
>
> Dan
>
>
> On Monday, August 22, 2011 12:36:28 PM Stevo Slavić wrote:
>> Hello cxf users,
>>
>> cxf-codegen-plugin v 2.1.x (tried 2.1.3 & 2.1.10), 2.2.12 and 2.3.6
>> have issue with spaces in wsdl path when generating Java classes
>> (tried with 2.4.2 too but dependencies of plugin and project are not
>> compatible).
>>
>> In use case where issue is reproduced there are two child modules W
>> (for wsdl) and J (for java) of parent module P, W has WSDL files, J
>> has wsdl2java configured. J declares property wsdl.project.location
>> equal to ../W, while wsdlOption/wsdl references this property. When P
>> is built on a path with spaces build fails, otherwise it's successful.
>>
>> It seems wsdl2java wrongly interprets full path with spaces as
>> relative path and then decides to append current directory prefix
>> twice.
>>
>> Can anyone reproduce this?
>>
>> Regards,
>> Stevo.
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com
>

Re: cxf-codegen-plugin, wsdl2java and spaces in wsdl path

Posted by Daniel Kulp <dk...@apache.org>.
On Wednesday, August 24, 2011 9:20:09 PM Stevo Slavić wrote:
> It would help if cxf-codegen-plugin had its configuration object model
> as separate module and if that module was an OSGi bundle. If not
> separate module for the config model, then at least entire plugin
> module to be an OSGi bundle. In either case I'd be able to access
> cxf-codegen-plugin maven execution configuration with WsdlOption
> array, and check if sourceRoot doesn't exist, or if any wsdl or
> bindingFile has changed, and only in that case let execution of
> wsdl2java perform. Until that happens, might try achieving same by
> wrapping cxf-codegen-plugin jar into OSGi bundle.

Well, I'm really not sure what your trying to achieve by making this an osgi 
bundle.   For the most part, all the codegen-plugin does is build up a command 
line and then call the wsdl2java tool's main method with the list of args.   
You could pretty much do the same thing.  I suppose we COULD move the options 
classes into tools/wsdlto/common someplace, but since they are only used in 
the codegen plugin specifically just for Maven, I'm hesitant to do that.

> 
> I've found several tickects in CXF JIRA on OSGi which are marked as
> implemented, but even in latest cxf-rt-core-2.4.2.jar I don't see OSGi
> headers (like Bundle-SymbolicName and Bundle-Version) in
> META-INF/MANIFEST.MF.

The OSGi stuff is just related to the cxf-bundle jar, not the individual 
modules.

Dan


> 
> Regards,
> Stevo.
> 
> On Wed, Aug 24, 2011 at 4:31 PM, Daniel Kulp <dk...@apache.org> wrote:
> > On Wednesday, August 24, 2011 9:44:22 AM Stevo Slavić wrote:
> >> It turned out to be issue with configuration - bindings were
> >> configured via extraargs (one with -b switch, followed by other
> >> extraarg with value file:${basedir}/pathtowsdl). Since I'm working on
> >> Windows those path separators in basedir are "\" and with spaces in
> >> between it would cause generation to fail. I've change configuration
> >> to use bindingFiles/bindingFile configuration parameter instead and it
> >> works. Maybe extraargs approach would work if configured with addition
> >> of quotes.
> > 
> > Interesting.  Thanks for the headsup.
> > 
> >> I'm trying now to implement m2e connector for cxf-codegen-plugin so
> >> that it can be used at least to generate java from wsdl. There is a
> >> support ticket for this at
> >> https://bugs.eclipse.org/bugs/show_bug.cgi?id=350081 I'm using
> >> https://github.com/bitstrings/m2e-jaxb2-connector as starting point,
> >> hoping it won't be much different for cxf. Did any of cxf developers
> >> already do anything on that issue? I've seen there's some work done at
> >> https://github.com/mtpettyp/m2eclipse-extras/tree/master/org.sonatype.
> >> m2e.cx f
> > 
> > I don't think anyone has really looked into this at all.    Good luck
> > with it.> 
> > :-)
> > 
> > Dan
> > 
> >> Regards,
> >> Stevo.
> >> 
> >> On Tue, Aug 23, 2011 at 9:08 PM, Daniel Kulp <dk...@apache.org> wrote:
> >> > Can you produce a full maven base testcase using a hello-world
> >> > wsdl or
> >> > similar and file a JIRA?
> >> > 
> >> > Our Windows nightly at:
> >> > https://builds.apache.org/view/A-F/view/CXF/job/CXF-trunk-windows/
> >> > 
> >> > is specifically setup to run in a directory with a space as well
> >> > as to
> >> > have a maven-repo in a directory with a space.  We pretty much did
> >> > that to test  some of the handling of the various pieces when
> >> > there are spaces there.   Thus, I'm slightly surprised by this.
> >> > 
> >> > Dan
> >> > 
> >> > On Monday, August 22, 2011 12:36:28 PM Stevo Slavić wrote:
> >> >> Hello cxf users,
> >> >> 
> >> >> cxf-codegen-plugin v 2.1.x (tried 2.1.3 & 2.1.10), 2.2.12 and
> >> >> 2.3.6
> >> >> have issue with spaces in wsdl path when generating Java classes
> >> >> (tried with 2.4.2 too but dependencies of plugin and project are
> >> >> not
> >> >> compatible).
> >> >> 
> >> >> In use case where issue is reproduced there are two child
> >> >> modules W
> >> >> (for wsdl) and J (for java) of parent module P, W has WSDL
> >> >> files, J
> >> >> has wsdl2java configured. J declares property
> >> >> wsdl.project.location
> >> >> equal to ../W, while wsdlOption/wsdl references this property.
> >> >> When P
> >> >> is built on a path with spaces build fails, otherwise it's
> >> >> successful.
> >> >> 
> >> >> It seems wsdl2java wrongly interprets full path with spaces as
> >> >> relative path and then decides to append current directory
> >> >> prefix
> >> >> twice.
> >> >> 
> >> >> Can anyone reproduce this?
> >> >> 
> >> >> Regards,
> >> >> Stevo.
> >> > 
> >> > --
> >> > Daniel Kulp
> >> > dkulp@apache.org
> >> > http://dankulp.com/blog
> >> > Talend - http://www.talend.com
> > 
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog
> > Talend - http://www.talend.com
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: cxf-codegen-plugin, wsdl2java and spaces in wsdl path

Posted by Stevo Slavić <ss...@gmail.com>.
It would help if cxf-codegen-plugin had its configuration object model
as separate module and if that module was an OSGi bundle. If not
separate module for the config model, then at least entire plugin
module to be an OSGi bundle. In either case I'd be able to access
cxf-codegen-plugin maven execution configuration with WsdlOption
array, and check if sourceRoot doesn't exist, or if any wsdl or
bindingFile has changed, and only in that case let execution of
wsdl2java perform. Until that happens, might try achieving same by
wrapping cxf-codegen-plugin jar into OSGi bundle.

I've found several tickects in CXF JIRA on OSGi which are marked as
implemented, but even in latest cxf-rt-core-2.4.2.jar I don't see OSGi
headers (like Bundle-SymbolicName and Bundle-Version) in
META-INF/MANIFEST.MF.

Regards,
Stevo.

On Wed, Aug 24, 2011 at 4:31 PM, Daniel Kulp <dk...@apache.org> wrote:
> On Wednesday, August 24, 2011 9:44:22 AM Stevo Slavić wrote:
>> It turned out to be issue with configuration - bindings were
>> configured via extraargs (one with -b switch, followed by other
>> extraarg with value file:${basedir}/pathtowsdl). Since I'm working on
>> Windows those path separators in basedir are "\" and with spaces in
>> between it would cause generation to fail. I've change configuration
>> to use bindingFiles/bindingFile configuration parameter instead and it
>> works. Maybe extraargs approach would work if configured with addition
>> of quotes.
>
> Interesting.  Thanks for the headsup.
>
>
>> I'm trying now to implement m2e connector for cxf-codegen-plugin so
>> that it can be used at least to generate java from wsdl. There is a
>> support ticket for this at
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=350081 I'm using
>> https://github.com/bitstrings/m2e-jaxb2-connector as starting point,
>> hoping it won't be much different for cxf. Did any of cxf developers
>> already do anything on that issue? I've seen there's some work done at
>> https://github.com/mtpettyp/m2eclipse-extras/tree/master/org.sonatype.m2e.cx
>> f
>
> I don't think anyone has really looked into this at all.    Good luck with it.
> :-)
>
> Dan
>
>
>>
>> Regards,
>> Stevo.
>>
>> On Tue, Aug 23, 2011 at 9:08 PM, Daniel Kulp <dk...@apache.org> wrote:
>> > Can you produce a full maven base testcase using a hello-world wsdl or
>> > similar and file a JIRA?
>> >
>> > Our Windows nightly at:
>> > https://builds.apache.org/view/A-F/view/CXF/job/CXF-trunk-windows/
>> >
>> > is specifically setup to run in a directory with a space as well as to
>> > have a maven-repo in a directory with a space.  We pretty much did that
>> > to test  some of the handling of the various pieces when there are
>> > spaces there.   Thus, I'm slightly surprised by this.
>> >
>> > Dan
>> >
>> > On Monday, August 22, 2011 12:36:28 PM Stevo Slavić wrote:
>> >> Hello cxf users,
>> >>
>> >> cxf-codegen-plugin v 2.1.x (tried 2.1.3 & 2.1.10), 2.2.12 and 2.3.6
>> >> have issue with spaces in wsdl path when generating Java classes
>> >> (tried with 2.4.2 too but dependencies of plugin and project are not
>> >> compatible).
>> >>
>> >> In use case where issue is reproduced there are two child modules W
>> >> (for wsdl) and J (for java) of parent module P, W has WSDL files, J
>> >> has wsdl2java configured. J declares property wsdl.project.location
>> >> equal to ../W, while wsdlOption/wsdl references this property. When P
>> >> is built on a path with spaces build fails, otherwise it's successful.
>> >>
>> >> It seems wsdl2java wrongly interprets full path with spaces as
>> >> relative path and then decides to append current directory prefix
>> >> twice.
>> >>
>> >> Can anyone reproduce this?
>> >>
>> >> Regards,
>> >> Stevo.
>> >
>> > --
>> > Daniel Kulp
>> > dkulp@apache.org
>> > http://dankulp.com/blog
>> > Talend - http://www.talend.com
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com
>

Re: cxf-codegen-plugin, wsdl2java and spaces in wsdl path

Posted by Daniel Kulp <dk...@apache.org>.

Can you produce a full maven base testcase using a hello-world wsdl or similar 
and file a JIRA?

Our Windows nightly at:
https://builds.apache.org/view/A-F/view/CXF/job/CXF-trunk-windows/

is specifically setup to run in a directory with a space as well as to have a 
maven-repo in a directory with a space.  We pretty much did that to test  some 
of the handling of the various pieces when there are spaces there.   Thus, I'm 
slightly surprised by this.

Dan


On Monday, August 22, 2011 12:36:28 PM Stevo Slavić wrote:
> Hello cxf users,
> 
> cxf-codegen-plugin v 2.1.x (tried 2.1.3 & 2.1.10), 2.2.12 and 2.3.6
> have issue with spaces in wsdl path when generating Java classes
> (tried with 2.4.2 too but dependencies of plugin and project are not
> compatible).
> 
> In use case where issue is reproduced there are two child modules W
> (for wsdl) and J (for java) of parent module P, W has WSDL files, J
> has wsdl2java configured. J declares property wsdl.project.location
> equal to ../W, while wsdlOption/wsdl references this property. When P
> is built on a path with spaces build fails, otherwise it's successful.
> 
> It seems wsdl2java wrongly interprets full path with spaces as
> relative path and then decides to append current directory prefix
> twice.
> 
> Can anyone reproduce this?
> 
> Regards,
> Stevo.
-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com