DEV Community

alinelsilva
alinelsilva

Posted on • Updated on

Error - Exception occurred during code generation for the WSDL

I'm trying to generate the java classes from the .wsdl file, but when trying to generate the following error:

Image description

Image description

Image description

Exception occurred during code generation for the WSDL : java.lang.NoClassDefFoundError: org/apache/ws/commons/schema/utils/NamespacePrefixList
     java.lang.reflect.InvocationTargetException
Enter fullscreen mode Exit fullscreen mode

In the pom I added the lib:

<dependency>
<groupId>org.apache.ws.xmlschema</groupId>
<artifactId>xmlschema-core</artifactId>
<version>2.2.1</version>
</dependency>
Enter fullscreen mode Exit fullscreen mode

But the error remains.

Solution:

As decker's comment, I added the lib below in the pom and it worked, after that I managed to generate the class.

<dependency>
            <groupId>org.apache.ws.xmlschema</groupId>
            <artifactId>xmlschema-core</artifactId>
            <version>2.0.2</version>
        </dependency>
Enter fullscreen mode Exit fullscreen mode

Top comments (5)

Collapse
 
decker67 profile image
decker

I would think it has to do with not found class NameSpacePrefixList.

Try to Google in which Jar it is and add it to the dependency.

Collapse
 
alinelsilva profile image
alinelsilva • Edited

Added a lib about NameSpacePrefixList , but the error still persists.

<!-- https://mvnrepository.com/artifact/org.apache.ws.xmlschema/xmlschema -->
<dependency>
    <groupId>org.apache.ws.xmlschema</groupId>
    <artifactId>xmlschema</artifactId>
    <version>2.3.0</version>
    <type>pom</type>
</dependency>

Enter fullscreen mode Exit fullscreen mode
Collapse
 
decker67 profile image
decker

I found this

<!-- https://mvnrepository.com/artifact/org.apache.ws.commons.schema/xmlschema-core -->
<dependency>
    <groupId>org.apache.ws.commons.schema</groupId>
    <artifactId>xmlschema-core</artifactId>
    <version>2.0.2</version>
</dependency>
Enter fullscreen mode Exit fullscreen mode

Maybe it is the wrong group id in your example. Do you need type pom, because I did not find it in the example.

Thread Thread
 
alinelsilva profile image
alinelsilva

Thanks for the help, it worked.

Thread Thread
 
decker67 profile image
decker

You're welcome!