Web service client generation problem
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?
Please sign in to leave a comment.
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.
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?
It looks like some Apache Axis specific issue, similar to https://issues.apache.org/jira/browse/AXIS2-4334.
So IntelliJ's web service code generator doesn't work out of the box?
I can't find any similar reports, so it may be specific to your project configuration, the libraries you are using and Axis version.
Have any recommendations?
Try using a different Axis version (can be configured here: http://i.imgur.com/CgPiy3L.png). Check the dependencies of your module.