简体   繁体   中英

Error in generating WSDL from Java

Below is the exception I got, while trying to start a web service with my java code using bottomup approach. server used apache tomcat7.2

IWAB0398E Error in generating WSDL from Java:  java.lang.ClassNotFoundException: com.test.Complextype
    java.lang.ClassNotFoundException: com.test.Complextype
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.apache.tools.ant.AntClassLoader.findBaseClass(AntClassLoader.java:1387)
    at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1080)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)

Here is the code I have used to generate WSDL

package com.test;

public class Complexdata {
    void Complexdata(){
        String a = "WELCOME";
        String b = "COMPLEX DATA TYPE";
    }
}
package com.test;

public class Complexdata {
    void Complexdata(){
        String a = "WELCOME";
        String b = "COMPLEX DATA TYPE";
    }
}
  • Step 1: Pack your 'com.test.Complextype.class' into jar file

  • Step 2: Be sure that the path in jar file is respected (com.test)

  • Step 3: Add your jar file under WebProject WEB-INF/lib directory

i've encountered same error. I resolved it by, right click on the project name and choose build path->configure build path. under libraries,go to JRE system libraries,click edit. choose execution environment instead of alternate JRE .apply and close. refresh your project Worked for me .None other methods worked for this error in my project. build path

JRE config

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM