WSDL Exception in webservice - java

I created my first axis2 webservice and I got following error when I try to invoke the web service through my client which is created using stub.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/WSDLException
at com.test.first.TestStub.populateAxisService(TestStub.java:41)
at com.test.first.TestStub.<init>(TestStub.java:88)
at com.test.first.TestStub.<init>(TestStub.java:77)
at com.test.first.TestStub.<init>(TestStub.java:126)
at com.test.first.TestStub.<init>(TestStub.java:118)
at com.test.first.TestTest.main(TestTest.java:11)
Caused by: java.lang.ClassNotFoundException: javax.wsdl.WSDLException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Laun``cher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 6 more
What could be the root cause for this exception?
Note: I have included wsdl4j and log4j libraries.

Likely a classpath issue? Can't find javax.wsdl.WSDLException. Ensure this is available.

Related

Error in Loading SQLSERVER Driver in jdbc

I am using SQLSERVER 2008 R2
While loading SQLServer Driver in jdbc using statement
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
I am getting error with
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at ConnectMSSQL.main(ConnectMSSQL.java:19)
I also set sqljdbc4.jar file in classpath but still getting same error, please help guys, my task is almost in delay.
As per the following mentioned sit:
http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/b425c201-9882-4a48-b049-4004f202b0c6
you need to set the path of the jar file into your classpath. For more details please visit the above mentioned site.

java.lang.ClassNotFoundException: org.apache.log4j.Level

I'm trying to use hibernate 3.5.1 final in a swing application
and here are the jars I'm using:
hibernate-core-3.5.1-Final
hibernate-entitymanager-3.5.1-Final
hibernate-jpa-2.0-api-1.0.0.Final
hibernate-annotations-3.5.1-Final
hibernate-commons-annotations-3.2.0.Final
dom4j-1.6.1
slf4j-api-1.6.4
slf4j-log4j12-1.6.4
When I try to run the application, I get the following error:
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:127)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at com.xeno.xecamp.desktopManagement.Main.main(Main.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 11 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:165)
at org.hibernate.ejb.Ejb3Configuration.<clinit>(Ejb3Configuration.java:127)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:32)
at com.xeno.xecamp.desktopManagement.Main.main(Main.java:16)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
You also need to include the Log4J JAR file in the classpath.
Note that slf4j-log4j12-1.6.4.jar is only an adapter to make it possible to use Log4J via the SLF4J API. It does not contain the actual implementation of Log4J.
You need to download log4j and add in your classpath.
In my environment, I just added the two files to class path. And is work fine.
slf4j-jdk14-1.7.25.jar
slf4j-api-1.7.25.jar

NoClassDefFoundError error on Mac with NetBeans

I am getting a NoClassDefFoundError error when I run my program. Here is the stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: ex7/Ex7
Caused by: java.lang.ClassNotFoundException: ex7.Ex7
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Java Result: 1
How do I fix this? I'm on a Mac and running NetBeans.
It seems class Ex7class from package ex7 isn't in classpath. recheck the class try clean build

I put the xmlbeans-2.3.0.jar into path and it says another exception while reading .xslx file using apache poi

I put the xmlbeans-2.3.0.jar into path and it says another exception while reading .xslx file using apache poi.
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at org.apache.poi.openxml4j.opc.OPCPackage.init(OPCPackage.java:149)
at org.apache.poi.openxml4j.opc.OPCPackage.<init>(OPCPackage.java:136)
at org.apache.poi.openxml4j.opc.Package.<init>(Package.java:54)
at org.apache.poi.openxml4j.opc.ZipPackage.<init>(ZipPackage.java:98)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:199)
at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:178)
at org.apache.poi.util.PackageHelper.open(PackageHelper.java:53)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.<init>(XSSFWorkbook.java:176)
at setTargetPlan.setTask(setTargetPlan.java:152)
at userVerification.main(userVerification.java:204)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 10 more
Same as your earlier problem.
For each ClassNotFound exception, search for the jar on the site below which contains this class and put the jar in your classpath
http://www.jarfinder.com/index.php/java/info/org.dom4j.DocumentException shows you need dom4j.jar

java.lang.NoClassDefFoundError

i am geting following error
Am i missing some jar file?
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.slf4j.impl.JCLLoggerFactory.getLogger(JCLLoggerFactory.java:69)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:243)
at org.smslib.helper.Logger.<init>(Logger.java:34)
at org.smslib.Service.<init>(Service.java:93)
at SendMessage.doIt(SendMessage.java:28)
at SendMessage.main(SendMessage.java:82)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 6 more
Java Result: 1
Yes, you need the Apache Logging JAR file on your classpath. Download it here: http://commons.apache.org/downloads/download_logging.cgi
Adding the jar files to ant lib will make them available for ant's java process and not your applications java process. Setting your application's classpath correctly must work.

Categories

Resources