You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Asen <as...@gmail.com> on 2009/08/12 16:42:27 UTC

Re:

Excuse my jumping into this, but the same would happen if the the element
name is as
<xs:element name="string" ... /> and the generated 'String' extending the
ADB binding will conflict
with the java.lang.String class.
I think this is a limitation of the ADB binding.
I have not experienced this problem when using the JiBX bindings with Axis2.
I have not tried that yet,  but you may try to tweak the ADB binding as per
[1].

[1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html


On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:

> Hi folks,
> I am generating from a wsdl Client Server Java code, by using the
> axis2-wsdl2code-maven-plugin.
> The wsdl file contains the following element:
> <xs:complexType name="ErrorReportType">
> <xs:sequence>…  <xs:element name="Class" form="unqualified"
> type="xs:string"/>… </xs:sequence>
> </xs:complexType>
>
> While compilation phase a class named  “ErrorReporType” containing a field
> named “Class”,  and the getter and setter methods are tried to be generated,
> without success. The compilation of the stub failures with the message
> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
>
> The problem is the wsdl element "Class" as shown above and final declared
> method getClass()on java side. Is there any chance to solve this problem?
>
>
> I would appreciate any hints…
>
> Thanks
> Ike
>

Re: Re:

Posted by Andreas Veithen <an...@gmail.com>.
You are right. ADB does it correctly for "class", but not for "Class".
Can you open a JIRA report for this issue, please?

Andreas

On Thu, Aug 13, 2009 at 10:07, <tu...@gmx.de> wrote:
> Hi,
> i just tried to compile with axis2 v.1.5 and still got the same prob.
> I try to compile the the generated code of a wsdl containing:
>
>            <xs:complexType name="ErrorReportType">
>                <xs:sequence>...
>
>                    <xs:element name="Class" form="unqualified" type="xs:string"/>...
>
>                </xs:sequence>
>            </xs:complexType>
>
> The console returns the following:
>
> C:\svn\mytestproject\src\main\java\test\MyServiceStub.java:[62057,52] getClass() in test.MyServiceStub.ErrorReportType cannot override getClass() in java.lang.Object; overridden method is final
>
>
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
>        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
> C:\svn\mytestproject\src\main\java\test\MyServiceStub.java:[62057,52] getClass() in test.MyServiceStub.ErrorReportType cannot override getClass() in java.lang.Object; overridden method is final[62057,52]
>
>        at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
>        at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
>        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
>        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
>        ... 16 more
>
> I appreciate any help...
>
> Thanks Ike
>
>
> -------- Original-Nachricht --------
>> Datum: Wed, 12 Aug 2009 14:20:25 -0500
>> Von: Asen <as...@gmail.com>
>> An: axis-user@ws.apache.org
>> Betreff: Re: Re:
>
>> Thanks.
>> I am using standard 1.4.1 and I do not think this fix made it to it.
>> Just tested with 1.5 and saw the fix !!!
>>
>> - private static synchronized String getUniqueSuffix(){
>> + private static synchronized java.lang.String getUniqueSuffix(){
>>
>> On Wed, Aug 12, 2009 at 1:27 PM, Andreas Veithen
>> <an...@gmail.com>wrote:
>>
>> > Ike,
>> >
>> > Probably it is sufficient to upgrade to Axis2 1.5. I tested this with
>> > the current trunk, and ADB now generates a method with name
>> > "get_class". Probably the fix went into the 1.5 release.
>> >
>> > Andreas
>> >
>> > On Wed, Aug 12, 2009 at 17:08, <tu...@gmx.de> wrote:
>> > > I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this
>> > problem ,if i run the wsdlfile trough axis1, axis1 places indeed an
>> > underscore, so that the get_Class() method is beeing created.
>> > >
>> > > How can I solve this prob with axis2? do i need to tweak the adb
>> > framework ?
>> > >
>> > > if yes, how this can be implemented if take a look on
>> > http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear
>> how
>> > to implement the org.apache.axis2.schema.typemap.JavaTypeMap interface
>> and
>> > link it to the adb framework to catch it up.
>> > >
>> > > thanks
>> > > Ike
>> > >
>> > >
>> > > -------- Original-Nachricht --------
>> > >> Datum: Wed, 12 Aug 2009 16:55:34 +0200
>> > >> Von: Andreas Veithen <an...@gmail.com>
>> > >> An: axis-user@ws.apache.org
>> > >> Betreff: Re:
>> > >
>> > >> That is not true. If the element is named "string" and part of a
>> > >> sequence, ADB doesn't generate anything called String, but only
>> > >> methods called setString and getString. There is no conflict here. If
>> > >> the element is a root element, ADB will indeed generate a class
>> called
>> > >> String, but since it is in a different package than java.lang and the
>> > >> ADB generated code uses fully qualified class names everywhere, there
>> > >> is again no conflict here. For names that match a Java primitive
>> type,
>> > >> ADB is smart enough to add an underscore to avoid name collisions. It
>> > >> seems that the only case that is not addressed is collision with the
>> > >> getClass method.
>> > >>
>> > >> Andreas
>> > >>
>> > >> On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
>> > >> > Excuse my jumping into this, but the same would happen if the the
>> > >> element
>> > >> > name is as
>> > >> > <xs:element name="string" ... /> and the generated 'String'
>> extending
>> > >> the
>> > >> > ADB binding will conflict
>> > >> > with the java.lang.String class.
>> > >> > I think this is a limitation of the ADB binding.
>> > >> > I have not experienced this problem when using the JiBX bindings
>> with
>> > >> Axis2.
>> > >> > I have not tried that yet,  but you may try to tweak the ADB
>> binding
>> > as
>> > >> per
>> > >> > [1].
>> > >> >
>> > >> > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
>> > >> >
>> > >> >
>> > >> > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
>> > >> >>
>> > >> >> Hi folks,
>> > >> >> I am generating from a wsdl Client Server Java code, by using the
>> > >> >> axis2-wsdl2code-maven-plugin.
>> > >> >> The wsdl file contains the following element:
>> > >> >> <xs:complexType name="ErrorReportType">
>> > >> >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
>> > >> >> type="xs:string"/>… </xs:sequence>
>> > >> >> </xs:complexType>
>> > >> >>
>> > >> >> While compilation phase a class named  “ErrorReporType”
>> containing
>> > >> a field
>> > >> >> named “Class”,  and the getter and setter methods are tried to
>> be
>> > >> generated,
>> > >> >> without success. The compilation of the stub failures with the
>> > message
>> > >> >> “…myPackage.MyStub.ErrorReportType cannot override
>> getClass()”
>> > >> >>
>> > >> >> The problem is the wsdl element "Class" as shown above and final
>> > >> declared
>> > >> >> method getClass()on java side. Is there any chance to solve this
>> > >> problem?
>> > >> >>
>> > >> >>
>> > >> >> I would appreciate any hints…
>> > >> >>
>> > >> >> Thanks
>> > >> >> Ike
>> > >> >
>> > >> >
>> > >
>> >
>

Re: Re:

Posted by tu...@gmx.de.
Hi,
i just tried to compile with axis2 v.1.5 and still got the same prob.
I try to compile the the generated code of a wsdl containing:

            <xs:complexType name="ErrorReportType">
                <xs:sequence>...
 
                    <xs:element name="Class" form="unqualified" type="xs:string"/>...
                  
                </xs:sequence>
            </xs:complexType>

The console returns the following:

C:\svn\mytestproject\src\main\java\test\MyServiceStub.java:[62057,52] getClass() in test.MyServiceStub.ErrorReportType cannot override getClass() in java.lang.Object; overridden method is final


	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
C:\svn\mytestproject\src\main\java\test\MyServiceStub.java:[62057,52] getClass() in test.MyServiceStub.ErrorReportType cannot override getClass() in java.lang.Object; overridden method is final[62057,52] 

	at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
	at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
	... 16 more

I appreciate any help... 

Thanks Ike


-------- Original-Nachricht --------
> Datum: Wed, 12 Aug 2009 14:20:25 -0500
> Von: Asen <as...@gmail.com>
> An: axis-user@ws.apache.org
> Betreff: Re: Re:

> Thanks.
> I am using standard 1.4.1 and I do not think this fix made it to it.
> Just tested with 1.5 and saw the fix !!!
> 
> - private static synchronized String getUniqueSuffix(){
> + private static synchronized java.lang.String getUniqueSuffix(){
> 
> On Wed, Aug 12, 2009 at 1:27 PM, Andreas Veithen
> <an...@gmail.com>wrote:
> 
> > Ike,
> >
> > Probably it is sufficient to upgrade to Axis2 1.5. I tested this with
> > the current trunk, and ADB now generates a method with name
> > "get_class". Probably the fix went into the 1.5 release.
> >
> > Andreas
> >
> > On Wed, Aug 12, 2009 at 17:08, <tu...@gmx.de> wrote:
> > > I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this
> > problem ,if i run the wsdlfile trough axis1, axis1 places indeed an
> > underscore, so that the get_Class() method is beeing created.
> > >
> > > How can I solve this prob with axis2? do i need to tweak the adb
> > framework ?
> > >
> > > if yes, how this can be implemented if take a look on
> > http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear
> how
> > to implement the org.apache.axis2.schema.typemap.JavaTypeMap interface
> and
> > link it to the adb framework to catch it up.
> > >
> > > thanks
> > > Ike
> > >
> > >
> > > -------- Original-Nachricht --------
> > >> Datum: Wed, 12 Aug 2009 16:55:34 +0200
> > >> Von: Andreas Veithen <an...@gmail.com>
> > >> An: axis-user@ws.apache.org
> > >> Betreff: Re:
> > >
> > >> That is not true. If the element is named "string" and part of a
> > >> sequence, ADB doesn't generate anything called String, but only
> > >> methods called setString and getString. There is no conflict here. If
> > >> the element is a root element, ADB will indeed generate a class
> called
> > >> String, but since it is in a different package than java.lang and the
> > >> ADB generated code uses fully qualified class names everywhere, there
> > >> is again no conflict here. For names that match a Java primitive
> type,
> > >> ADB is smart enough to add an underscore to avoid name collisions. It
> > >> seems that the only case that is not addressed is collision with the
> > >> getClass method.
> > >>
> > >> Andreas
> > >>
> > >> On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
> > >> > Excuse my jumping into this, but the same would happen if the the
> > >> element
> > >> > name is as
> > >> > <xs:element name="string" ... /> and the generated 'String'
> extending
> > >> the
> > >> > ADB binding will conflict
> > >> > with the java.lang.String class.
> > >> > I think this is a limitation of the ADB binding.
> > >> > I have not experienced this problem when using the JiBX bindings
> with
> > >> Axis2.
> > >> > I have not tried that yet,  but you may try to tweak the ADB
> binding
> > as
> > >> per
> > >> > [1].
> > >> >
> > >> > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
> > >> >
> > >> >
> > >> > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
> > >> >>
> > >> >> Hi folks,
> > >> >> I am generating from a wsdl Client Server Java code, by using the
> > >> >> axis2-wsdl2code-maven-plugin.
> > >> >> The wsdl file contains the following element:
> > >> >> <xs:complexType name="ErrorReportType">
> > >> >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
> > >> >> type="xs:string"/>… </xs:sequence>
> > >> >> </xs:complexType>
> > >> >>
> > >> >> While compilation phase a class named  “ErrorReporType”
> containing
> > >> a field
> > >> >> named “Class”,  and the getter and setter methods are tried to
> be
> > >> generated,
> > >> >> without success. The compilation of the stub failures with the
> > message
> > >> >> “…myPackage.MyStub.ErrorReportType cannot override
> getClass()”
> > >> >>
> > >> >> The problem is the wsdl element "Class" as shown above and final
> > >> declared
> > >> >> method getClass()on java side. Is there any chance to solve this
> > >> problem?
> > >> >>
> > >> >>
> > >> >> I would appreciate any hints…
> > >> >>
> > >> >> Thanks
> > >> >> Ike
> > >> >
> > >> >
> > >
> >

Re: Re:

Posted by Asen <as...@gmail.com>.
Thanks.
I am using standard 1.4.1 and I do not think this fix made it to it.
Just tested with 1.5 and saw the fix !!!

- private static synchronized String getUniqueSuffix(){
+ private static synchronized java.lang.String getUniqueSuffix(){

On Wed, Aug 12, 2009 at 1:27 PM, Andreas Veithen
<an...@gmail.com>wrote:

> Ike,
>
> Probably it is sufficient to upgrade to Axis2 1.5. I tested this with
> the current trunk, and ADB now generates a method with name
> "get_class". Probably the fix went into the 1.5 release.
>
> Andreas
>
> On Wed, Aug 12, 2009 at 17:08, <tu...@gmx.de> wrote:
> > I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this
> problem ,if i run the wsdlfile trough axis1, axis1 places indeed an
> underscore, so that the get_Class() method is beeing created.
> >
> > How can I solve this prob with axis2? do i need to tweak the adb
> framework ?
> >
> > if yes, how this can be implemented if take a look on
> http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear how
> to implement the org.apache.axis2.schema.typemap.JavaTypeMap interface and
> link it to the adb framework to catch it up.
> >
> > thanks
> > Ike
> >
> >
> > -------- Original-Nachricht --------
> >> Datum: Wed, 12 Aug 2009 16:55:34 +0200
> >> Von: Andreas Veithen <an...@gmail.com>
> >> An: axis-user@ws.apache.org
> >> Betreff: Re:
> >
> >> That is not true. If the element is named "string" and part of a
> >> sequence, ADB doesn't generate anything called String, but only
> >> methods called setString and getString. There is no conflict here. If
> >> the element is a root element, ADB will indeed generate a class called
> >> String, but since it is in a different package than java.lang and the
> >> ADB generated code uses fully qualified class names everywhere, there
> >> is again no conflict here. For names that match a Java primitive type,
> >> ADB is smart enough to add an underscore to avoid name collisions. It
> >> seems that the only case that is not addressed is collision with the
> >> getClass method.
> >>
> >> Andreas
> >>
> >> On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
> >> > Excuse my jumping into this, but the same would happen if the the
> >> element
> >> > name is as
> >> > <xs:element name="string" ... /> and the generated 'String' extending
> >> the
> >> > ADB binding will conflict
> >> > with the java.lang.String class.
> >> > I think this is a limitation of the ADB binding.
> >> > I have not experienced this problem when using the JiBX bindings with
> >> Axis2.
> >> > I have not tried that yet,  but you may try to tweak the ADB binding
> as
> >> per
> >> > [1].
> >> >
> >> > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
> >> >
> >> >
> >> > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
> >> >>
> >> >> Hi folks,
> >> >> I am generating from a wsdl Client Server Java code, by using the
> >> >> axis2-wsdl2code-maven-plugin.
> >> >> The wsdl file contains the following element:
> >> >> <xs:complexType name="ErrorReportType">
> >> >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
> >> >> type="xs:string"/>… </xs:sequence>
> >> >> </xs:complexType>
> >> >>
> >> >> While compilation phase a class named  “ErrorReporType” containing
> >> a field
> >> >> named “Class”,  and the getter and setter methods are tried to be
> >> generated,
> >> >> without success. The compilation of the stub failures with the
> message
> >> >> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
> >> >>
> >> >> The problem is the wsdl element "Class" as shown above and final
> >> declared
> >> >> method getClass()on java side. Is there any chance to solve this
> >> problem?
> >> >>
> >> >>
> >> >> I would appreciate any hints…
> >> >>
> >> >> Thanks
> >> >> Ike
> >> >
> >> >
> >
>

Re: Re:

Posted by Andreas Veithen <an...@gmail.com>.
Ike,

Probably it is sufficient to upgrade to Axis2 1.5. I tested this with
the current trunk, and ADB now generates a method with name
"get_class". Probably the fix went into the 1.5 release.

Andreas

On Wed, Aug 12, 2009 at 17:08, <tu...@gmx.de> wrote:
> I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this problem ,if i run the wsdlfile trough axis1, axis1 places indeed an underscore, so that the get_Class() method is beeing created.
>
> How can I solve this prob with axis2? do i need to tweak the adb framework ?
>
> if yes, how this can be implemented if take a look on http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear how to implement the org.apache.axis2.schema.typemap.JavaTypeMap interface and link it to the adb framework to catch it up.
>
> thanks
> Ike
>
>
> -------- Original-Nachricht --------
>> Datum: Wed, 12 Aug 2009 16:55:34 +0200
>> Von: Andreas Veithen <an...@gmail.com>
>> An: axis-user@ws.apache.org
>> Betreff: Re:
>
>> That is not true. If the element is named "string" and part of a
>> sequence, ADB doesn't generate anything called String, but only
>> methods called setString and getString. There is no conflict here. If
>> the element is a root element, ADB will indeed generate a class called
>> String, but since it is in a different package than java.lang and the
>> ADB generated code uses fully qualified class names everywhere, there
>> is again no conflict here. For names that match a Java primitive type,
>> ADB is smart enough to add an underscore to avoid name collisions. It
>> seems that the only case that is not addressed is collision with the
>> getClass method.
>>
>> Andreas
>>
>> On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
>> > Excuse my jumping into this, but the same would happen if the the
>> element
>> > name is as
>> > <xs:element name="string" ... /> and the generated 'String' extending
>> the
>> > ADB binding will conflict
>> > with the java.lang.String class.
>> > I think this is a limitation of the ADB binding.
>> > I have not experienced this problem when using the JiBX bindings with
>> Axis2.
>> > I have not tried that yet,  but you may try to tweak the ADB binding as
>> per
>> > [1].
>> >
>> > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
>> >
>> >
>> > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
>> >>
>> >> Hi folks,
>> >> I am generating from a wsdl Client Server Java code, by using the
>> >> axis2-wsdl2code-maven-plugin.
>> >> The wsdl file contains the following element:
>> >> <xs:complexType name="ErrorReportType">
>> >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
>> >> type="xs:string"/>… </xs:sequence>
>> >> </xs:complexType>
>> >>
>> >> While compilation phase a class named  “ErrorReporType” containing
>> a field
>> >> named “Class”,  and the getter and setter methods are tried to be
>> generated,
>> >> without success. The compilation of the stub failures with the message
>> >> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
>> >>
>> >> The problem is the wsdl element "Class" as shown above and final
>> declared
>> >> method getClass()on java side. Is there any chance to solve this
>> problem?
>> >>
>> >>
>> >> I would appreciate any hints…
>> >>
>> >> Thanks
>> >> Ike
>> >
>> >
>

Re: Re:

Posted by Andreas Veithen <an...@gmail.com>.
Asen,

This particular issue was fixed in AXIS2-3921.

Andreas

On Wed, Aug 12, 2009 at 19:52, Asen<as...@gmail.com> wrote:
> Andreas, I won't say it if it was not true, but I think you need lettle more
> backgaound in the way I have produce it.
> I do not judge the smartness of the ADB binding, just saying that I have
> encountered a problem using them and also have found a work around for it in
> my particular case.
>
> The deal here is that the "string" element is not part of any sequence of
> elements of some complex type one.
> It is just an simple element part of a schema imported to the .wsdl. Here is
> a sample schema:
>
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="http://tempuri.org/"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>     xmlns:tns="http://tempuri.org/">
>     <xs:element name="string" nillable="true" type="xs:string" />
> </xs:schema>
>
> I found similar schema imported into a .wsdl I have worked with.
>
> The ADB binding has number of option and let me tell you how I am using it
> so I am getting the conflict I have mentioned above. I am using the simple
> wrapped binding, which I belive is the default for ADB binding in axis2
> 1.4.1
> and also using the following options:
> -uri
> --noWSDL
> --noBuildXML
> -d abd
> -o
> -S
> -p
>
>
> You may want to try it your self to get convinced or I can provide you with
> an example in which the generated ADBBeans will not compile due to:
>
> wsdl2java:
> Retrieving document at '/home/user/test/wsdl/user.wsdl'.
> Retrieving document at './import/userimport.wsdl', relative to
> 'file:/home/user/test/wsdl/user.wsdl'.
> Retrieving schema at './xsd0.xsd', relative to
> 'file:/home/user/test/wsdl/import/userimport.wsdl'.
> .....
> Generated Java webservice stubs for /home/user/test/wsdl/user.wsdl in
> com.soap.wsdl.user
>
> Compiling 93 source files to /home/user/test/build/classes
> /home/user/test/src/java/com/soap/wsdl/user/UserStub.java:34: incompatible
> types
> found   : java.lang.String
> required: com.soap.wsdl.user.UserStub.String
>             return Long.toString(System.currentTimeMillis()) + "_" +
> counter;
>                                                                    ^
>
> So, there is really a case when the ADB generates a class named String !!!!
> as inner class into the Stub class and the conflict is  there.
> That is an issue with the wrapped ADB's. Are you agree ?
> What I have said is from what I have expirienced and if proof is needed I
> will provide it.
>
>
>
> On Wed, Aug 12, 2009 at 10:08 AM, <tu...@gmx.de> wrote:
>>
>> I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this
>> problem ,if i run the wsdlfile trough axis1, axis1 places indeed an
>> underscore, so that the get_Class() method is beeing created.
>>
>> How can I solve this prob with axis2? do i need to tweak the adb framework
>> ?
>>
>> if yes, how this can be implemented if take a look on
>> http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear how to
>> implement the org.apache.axis2.schema.typemap.JavaTypeMap interface and link
>> it to the adb framework to catch it up.
>>
>> thanks
>> Ike
>>
>>
>> -------- Original-Nachricht --------
>> > Datum: Wed, 12 Aug 2009 16:55:34 +0200
>> > Von: Andreas Veithen <an...@gmail.com>
>> > An: axis-user@ws.apache.org
>> > Betreff: Re:
>>
>> > That is not true. If the element is named "string" and part of a
>> > sequence, ADB doesn't generate anything called String, but only
>> > methods called setString and getString. There is no conflict here. If
>> > the element is a root element, ADB will indeed generate a class called
>> > String, but since it is in a different package than java.lang and the
>> > ADB generated code uses fully qualified class names everywhere, there
>> > is again no conflict here. For names that match a Java primitive type,
>> > ADB is smart enough to add an underscore to avoid name collisions. It
>> > seems that the only case that is not addressed is collision with the
>> > getClass method.
>> >
>> > Andreas
>> >
>> > On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
>> > > Excuse my jumping into this, but the same would happen if the the
>> > element
>> > > name is as
>> > > <xs:element name="string" ... /> and the generated 'String' extending
>> > the
>> > > ADB binding will conflict
>> > > with the java.lang.String class.
>> > > I think this is a limitation of the ADB binding.
>> > > I have not experienced this problem when using the JiBX bindings with
>> > Axis2.
>> > > I have not tried that yet,  but you may try to tweak the ADB binding
>> > > as
>> > per
>> > > [1].
>> > >
>> > > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
>> > >
>> > >
>> > > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
>> > >>
>> > >> Hi folks,
>> > >> I am generating from a wsdl Client Server Java code, by using the
>> > >> axis2-wsdl2code-maven-plugin.
>> > >> The wsdl file contains the following element:
>> > >> <xs:complexType name="ErrorReportType">
>> > >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
>> > >> type="xs:string"/>… </xs:sequence>
>> > >> </xs:complexType>
>> > >>
>> > >> While compilation phase a class named  “ErrorReporType” containing
>> > a field
>> > >> named “Class”,  and the getter and setter methods are tried to be
>> > generated,
>> > >> without success. The compilation of the stub failures with the
>> > >> message
>> > >> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
>> > >>
>> > >> The problem is the wsdl element "Class" as shown above and final
>> > declared
>> > >> method getClass()on java side. Is there any chance to solve this
>> > problem?
>> > >>
>> > >>
>> > >> I would appreciate any hints…
>> > >>
>> > >> Thanks
>> > >> Ike
>> > >
>> > >
>
>

Re: Re:

Posted by Asen <as...@gmail.com>.
Andreas, I won't say it if it was not true, but I think you need lettle more
backgaound in the way I have produce it.
I do not judge the smartness of the ADB binding, just saying that I have
encountered a problem using them and also have found a work around for it in
my particular case.

The deal here is that the "string" element is not part of any sequence of
elements of some complex type one.
It is just an simple element part of a schema imported to the .wsdl. Here is
a sample schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://tempuri.org/" xmlns:xs="
http://www.w3.org/2001/XMLSchema"
    xmlns:tns="http://tempuri.org/">
    <xs:element name="string" nillable="true" type="xs:string" />
</xs:schema>

I found similar schema imported into a .wsdl I have worked with.

The ADB binding has number of option and let me tell you how I am using it
so I am getting the conflict I have mentioned above. I am using the simple
wrapped binding, which I belive is the default for ADB binding in axis2
1.4.1
and also using the following options:
-uri
--noWSDL
--noBuildXML
-d abd
-o
-S
-p


You may want to try it your self to get convinced or I can provide you with
an example in which the generated ADBBeans will not compile due to:

wsdl2java:
Retrieving document at '/home/user/test/wsdl/user.wsdl'.
Retrieving document at './import/userimport.wsdl', relative to
'file:/home/user/test/wsdl/user.wsdl'.
Retrieving schema at './xsd0.xsd', relative to
'file:/home/user/test/wsdl/import/userimport.wsdl'.
.....
Generated Java webservice stubs for /home/user/test/wsdl/user.wsdl in
com.soap.wsdl.user

Compiling 93 source files to /home/user/test/build/classes
/home/user/test/src/java/com/soap/wsdl/user/UserStub.java:34: incompatible
types
found   : java.lang.String
required: com.soap.wsdl.user.UserStub.String
            return Long.toString(System.currentTimeMillis()) + "_" +
counter;
                                                                   ^

So, there is really a case when the ADB generates a class named String !!!!
as inner class into the Stub class and the conflict is  there.
That is an issue with the wrapped ADB's. Are you agree ?
What I have said is from what I have expirienced and if proof is needed I
will provide it.



On Wed, Aug 12, 2009 at 10:08 AM, <tu...@gmx.de> wrote:

> I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this
> problem ,if i run the wsdlfile trough axis1, axis1 places indeed an
> underscore, so that the get_Class() method is beeing created.
>
> How can I solve this prob with axis2? do i need to tweak the adb framework
> ?
>
> if yes, how this can be implemented if take a look on
> http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear how
> to implement the org.apache.axis2.schema.typemap.JavaTypeMap interface and
> link it to the adb framework to catch it up.
>
> thanks
> Ike
>
>
> -------- Original-Nachricht --------
> > Datum: Wed, 12 Aug 2009 16:55:34 +0200
> > Von: Andreas Veithen <an...@gmail.com>
> > An: axis-user@ws.apache.org
> > Betreff: Re:
>
> > That is not true. If the element is named "string" and part of a
> > sequence, ADB doesn't generate anything called String, but only
> > methods called setString and getString. There is no conflict here. If
> > the element is a root element, ADB will indeed generate a class called
> > String, but since it is in a different package than java.lang and the
> > ADB generated code uses fully qualified class names everywhere, there
> > is again no conflict here. For names that match a Java primitive type,
> > ADB is smart enough to add an underscore to avoid name collisions. It
> > seems that the only case that is not addressed is collision with the
> > getClass method.
> >
> > Andreas
> >
> > On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
> > > Excuse my jumping into this, but the same would happen if the the
> > element
> > > name is as
> > > <xs:element name="string" ... /> and the generated 'String' extending
> > the
> > > ADB binding will conflict
> > > with the java.lang.String class.
> > > I think this is a limitation of the ADB binding.
> > > I have not experienced this problem when using the JiBX bindings with
> > Axis2.
> > > I have not tried that yet,  but you may try to tweak the ADB binding as
> > per
> > > [1].
> > >
> > > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
> > >
> > >
> > > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
> > >>
> > >> Hi folks,
> > >> I am generating from a wsdl Client Server Java code, by using the
> > >> axis2-wsdl2code-maven-plugin.
> > >> The wsdl file contains the following element:
> > >> <xs:complexType name="ErrorReportType">
> > >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
> > >> type="xs:string"/>… </xs:sequence>
> > >> </xs:complexType>
> > >>
> > >> While compilation phase a class named  “ErrorReporType” containing
> > a field
> > >> named “Class”,  and the getter and setter methods are tried to be
> > generated,
> > >> without success. The compilation of the stub failures with the message
> > >> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
> > >>
> > >> The problem is the wsdl element "Class" as shown above and final
> > declared
> > >> method getClass()on java side. Is there any chance to solve this
> > problem?
> > >>
> > >>
> > >> I would appreciate any hints…
> > >>
> > >> Thanks
> > >> Ike
> > >
> > >
>

Re: Re:

Posted by tu...@gmx.de.
I got this problem with axis2 1.4.1. .  Axis1 doesnt seem to have this problem ,if i run the wsdlfile trough axis1, axis1 places indeed an underscore, so that the get_Class() method is beeing created.

How can I solve this prob with axis2? do i need to tweak the adb framework ? 

if yes, how this can be implemented if take a look on http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html,  i am not clear how to implement the org.apache.axis2.schema.typemap.JavaTypeMap interface and link it to the adb framework to catch it up. 

thanks
Ike

 
-------- Original-Nachricht --------
> Datum: Wed, 12 Aug 2009 16:55:34 +0200
> Von: Andreas Veithen <an...@gmail.com>
> An: axis-user@ws.apache.org
> Betreff: Re:

> That is not true. If the element is named "string" and part of a
> sequence, ADB doesn't generate anything called String, but only
> methods called setString and getString. There is no conflict here. If
> the element is a root element, ADB will indeed generate a class called
> String, but since it is in a different package than java.lang and the
> ADB generated code uses fully qualified class names everywhere, there
> is again no conflict here. For names that match a Java primitive type,
> ADB is smart enough to add an underscore to avoid name collisions. It
> seems that the only case that is not addressed is collision with the
> getClass method.
> 
> Andreas
> 
> On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
> > Excuse my jumping into this, but the same would happen if the the
> element
> > name is as
> > <xs:element name="string" ... /> and the generated 'String' extending
> the
> > ADB binding will conflict
> > with the java.lang.String class.
> > I think this is a limitation of the ADB binding.
> > I have not experienced this problem when using the JiBX bindings with
> Axis2.
> > I have not tried that yet,  but you may try to tweak the ADB binding as
> per
> > [1].
> >
> > [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
> >
> >
> > On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
> >>
> >> Hi folks,
> >> I am generating from a wsdl Client Server Java code, by using the
> >> axis2-wsdl2code-maven-plugin.
> >> The wsdl file contains the following element:
> >> <xs:complexType name="ErrorReportType">
> >> <xs:sequence>…  <xs:element name="Class" form="unqualified"
> >> type="xs:string"/>… </xs:sequence>
> >> </xs:complexType>
> >>
> >> While compilation phase a class named  “ErrorReporType” containing
> a field
> >> named “Class”,  and the getter and setter methods are tried to be
> generated,
> >> without success. The compilation of the stub failures with the message
> >> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
> >>
> >> The problem is the wsdl element "Class" as shown above and final
> declared
> >> method getClass()on java side. Is there any chance to solve this
> problem?
> >>
> >>
> >> I would appreciate any hints…
> >>
> >> Thanks
> >> Ike
> >
> >

Re:

Posted by Andreas Veithen <an...@gmail.com>.
That is not true. If the element is named "string" and part of a
sequence, ADB doesn't generate anything called String, but only
methods called setString and getString. There is no conflict here. If
the element is a root element, ADB will indeed generate a class called
String, but since it is in a different package than java.lang and the
ADB generated code uses fully qualified class names everywhere, there
is again no conflict here. For names that match a Java primitive type,
ADB is smart enough to add an underscore to avoid name collisions. It
seems that the only case that is not addressed is collision with the
getClass method.

Andreas

On Wed, Aug 12, 2009 at 16:42, Asen<as...@gmail.com> wrote:
> Excuse my jumping into this, but the same would happen if the the element
> name is as
> <xs:element name="string" ... /> and the generated 'String' extending the
> ADB binding will conflict
> with the java.lang.String class.
> I think this is a limitation of the ADB binding.
> I have not experienced this problem when using the JiBX bindings with Axis2.
> I have not tried that yet,  but you may try to tweak the ADB binding as per
> [1].
>
> [1] http://ws.apache.org/axis2/1_5/adb/adb-tweaking.html
>
>
> On Wed, Aug 12, 2009 at 9:22 AM, <tu...@gmx.de> wrote:
>>
>> Hi folks,
>> I am generating from a wsdl Client Server Java code, by using the
>> axis2-wsdl2code-maven-plugin.
>> The wsdl file contains the following element:
>> <xs:complexType name="ErrorReportType">
>> <xs:sequence>…  <xs:element name="Class" form="unqualified"
>> type="xs:string"/>… </xs:sequence>
>> </xs:complexType>
>>
>> While compilation phase a class named  “ErrorReporType” containing a field
>> named “Class”,  and the getter and setter methods are tried to be generated,
>> without success. The compilation of the stub failures with the message
>> “…myPackage.MyStub.ErrorReportType cannot override getClass()”
>>
>> The problem is the wsdl element "Class" as shown above and final declared
>> method getClass()on java side. Is there any chance to solve this problem?
>>
>>
>> I would appreciate any hints…
>>
>> Thanks
>> Ike
>
>