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 "Palakovich, Jim" <jp...@rightnow.com> on 2006/02/08 19:23:59 UTC

wsdl2java DuplicateFileException

Hi,

 

I'm seeing some strange behavior with WSDL2Java that I cannot explain
(which is probably not surprising, since I'm fairly new to web
services).  When attempting to generate stub classes, I'm getting the
following exception:

 

org.apache.axis.wsdl.toJava.DuplicateFileException: Duplicate file name:
com\acme\api\obj\Int_valref.java.

Hint: you may have mapped two namespaces with elements of the same name
to the same package name.

        at
org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:110)

        at
org.apache.axis.wsdl.toJava.JavaBeanWriter.generate(JavaBeanWriter.java:
1406)

        at
org.apache.axis.wsdl.toJava.JavaTypeWriter.generate(JavaTypeWriter.java:
113)

        at
org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGe
neratorFactory.java:421)

        at
org.apache.axis.wsdl.gen.Parser.generateTypes(Parser.java:547)

        at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:432)

        at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:45)

        at
org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:362)

        at java.lang.Thread.run(Thread.java:595)

 

The snippet in question from my schema is:

 

    <xs:complexType name="int_valref">

        <xs:simpleContent>

            <xs:extension base="xs:int">

                <xs:attribute name="iv_ref" />

                <xs:attribute name="rv_ref" />

            </xs:extension>

        </xs:simpleContent>

    </xs:complexType>

 

    <xs:complexType name="ref_obj1" id="ref_obj1">

        <xs:simpleContent>

            <xs:restriction base="int_valref">

                <xs:minInclusive value="1" />

            </xs:restriction>

        </xs:simpleContent>

    </xs:complexType>

 

    <xs:complexType name="ref_obj2" id="ref_obj2">

        <xs:simpleContent>

            <xs:restriction base="int_valref">

                <xs:minInclusive value="1" />

            </xs:restriction>

        </xs:simpleContent>

    </xs:complexType>

 

Also, in the Int_valref.java file that gets generated, the Int_valref
class attempts to extend itself.

 

If I change all the above references of 'simpleContent' to
'complexContent', the stub generation completes successfully, but class
Int_valref still tries to extend itself.

 

Note that this same WSDL/Schema combination works just fine with both
the .NET and Sun JWSDP wsdl compilers.

 

Any suggestions on what might be going on here would be graciously
appreciated.

 

I've attached the full wsdl and schema files, if necessary.

 

 

Thanks,

Jim