Web service client generation problem

Answered

I created a module and gave it the web services facet, then tried generating code from a WSDL. I got this result:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:290)
at org.apache.axis.components.logger.LogFactory.getLog(LogFactory.java:37)
at org.apache.axis.i18n.ProjectResourceBundle.<clinit>(ProjectResourceBundle.java:53)
at org.apache.axis.i18n.MessagesConstants.<clinit>(MessagesConstants.java:32)
at org.apache.axis.utils.Messages.<clinit>(Messages.java:36)
at org.apache.axis.wsdl.WSDL2Java.<clinit>(WSDL2Java.java:112)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
Done

 

Any idea about how to fix this?

7 comments
Comment actions Permalink

Logging dependencies are missing, see http://stackoverflow.com/a/3738036/104891 for a similar problem.

If your project is not Maven based, add them manually in the Project Structure: http://www.jetbrains.com/idea/webhelp/configuring-module-dependencies-and-libraries.html.

0
Comment actions Permalink

Our logging works fine throughout the rest of the application; it's just in generating a service client that it's blowing up. Do I need to add the dependency to the web service client module also? And why is this blowing up the code generator?

0
Comment actions Permalink

It looks like some Apache Axis specific issue, similar to https://issues.apache.org/jira/browse/AXIS2-4334.

0
Comment actions Permalink

So IntelliJ's web service code generator doesn't work out of the box?

0
Comment actions Permalink

I can't find any similar reports, so it may be specific to your project configuration, the libraries you are using and Axis version.

0
Comment actions Permalink

Have any recommendations? 

0
Comment actions Permalink

Try using a different Axis version (can be configured here: http://i.imgur.com/CgPiy3L.png). Check the dependencies of your module.

0

Please sign in to leave a comment.