This discussion is archived
5 Replies Latest reply: Sep 25, 2012 4:09 AM by 964234 RSS

Error using wsdlc ANT task: NoClassDefFoundError

Chris Everett NL Newbie
Currently Being Moderated
I'm trying to generate Java code from an existing WSDL using the wsdlc ant task.
I've added all weblogic libraries (as they were installed during weblogic installation) to the path in the ant build file.

<path id="weblogic.classpath">
     <fileset dir="lib">
     <include name="*.jar" />
</fileset>
</path>     

I've created the following taskdef for the wsdlc task:

<taskdef name="wsdlc"
classname="weblogic.wsee.tools.anttasks.WsdlcTask">
<classpath refid="weblogic.classpath" />
</taskdef>

And I've created the wsdlc target to execute:

<target name="generate-from-wsdl">
     <wsdlc
     srcWsdl="BS_LowTax_v01.wsdl"
     destJwsDir="src"
     destImplDir="src"
     packageName="com.everett.nl.taxservices"
     type="JAXWS"/>
</target>

When I run the generate-from-wsdl ant target, I run in to the following exception: java.lang.NoClassDefFoundError: weblogic/utils/classloaders/FilteringClassLoader
My first idea was that a library is missing. However as I already mentioned, I've added all libraries available from $BEA_HOME/wlserver_10.3/server/lib.
Anyone got a clue on what my problem is and how I can resolve it? Many thanks
  • 1. Re: Error using wsdlc ANT task: NoClassDefFoundError
    672676 Newbie
    Currently Being Moderated
    Hi,

    seems your dir is a relative path, your should define it as bellow or you must run the build file at the $BEA_HOME/wlserver_10.3/server directory:

    <path id="weblogic.classpath">
    <fileset dir="$BEA_HOME/wlserver_10.3/serverlib">
    <include name="*.jar" />
    </fileset>
    </path>

    HTH,
    Kevin
  • 2. Re: Error using wsdlc ANT task: NoClassDefFoundError
    739896 Guru
    Currently Being Moderated
    Hi Chris,

    It seems every thing is fine in your code snippet ...Except one Most important thing:

    OK
    <path id="weblogic.classpath">
    <fileset dir="lib">
    <include name="*.jar" />
    </fileset>
    </path>

    Above one is OK but in the "*generate-from-wsdl*"

    -----------------
    *"generate-from-wsdl" target the "classpath" attribute is missing*

    Below one is OK
    <target name="generate-from-wsdl">
    <wsdlc
    srcWsdl="BS_LowTax_v01.wsdl"
    destJwsDir="src"
    destImplDir="src"
    packageName="com.everett.nl.taxservices"
    type="JAXWS"
    *classpath="${weblogic.classpath}"*
    />
    </target>
  • 3. Re: Error using wsdlc ANT task: Class not found error
    379093 Newbie
    Currently Being Moderated
    I am getting class not found error while generating java codes from wsdl file.

    *******************
    cu dmwls(338)$ ant generate-from-wsdl
    Buildfile: build.xml

    BUILD FAILED
    file:/ffdt01/resmgt/kul/build.xml:14: taskdef class weblogic.wsee.tools.anttasks.WsdlcTask cannot be found

    Total time: 1 second
    cu dmwls(339)$ cat -n build.xml
    1 <project default="all">
    2 <property name="bea.home" value="/opt/bea/wls/8.1sp4" />
    3 <property name="jdk.home" value="${bea.home}/jdk142_05" />
    4 <property name="weblogic.home" value="${bea.home}/weblogic81" />
    5
    6 <path id="weblogic.classpath">
    7 <fileset dir="${weblogic.home}/server/lib">
    8 <include name="*.jar" />
    9 </fileset>
    10 </path>
    11
    12 <taskdef name="wsdlc"
    13 classname="weblogic.wsee.tools.anttasks.WsdlcTask"
    14 classpathref="weblogic.classpath" />
    15
    16 <target name="generate-from-wsdl">
    17 <wsdlc
    18 srcWsdl="/ffdt01/resmgt/kul/ksr.wsdl"
    19 destJwsDir="/ffdt01/resmgt/kul"
    20 destImplDir="/ffdt01/resmgt/kul"
    21 classpathref="${weblogic.classpath}"
    22 classpath="${weblogic.classpath}"
    23 packageName="examples.webservices.wsdlc" />
    24 </target>
    25 </project>
    *******************

    I checked this class in weblogic.jar file using unzip command but there is no "WsdlcTask" class.

    Is my weblogic.jar file is missing some required classes or there is something wrong with my build.xml file?

    Please help.

    Kuldeep
  • 4. Re: Error using wsdlc ANT task: Class not found error
    739896 Guru
    Currently Being Moderated
    Hi Kuldeep,

    please refer to taskdef class not found while generating code from wsdl using ant

    Thanks
    Jay SenSharma
  • 5. javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.XML
    964234 Newbie
    Currently Being Moderated
    Hi All,

    I'm trying to generate Java code from an existing WSDL using the wsdlc ant task.
    I've added all weblogic libraries (as they were installed during weblogic installation) to the path in the ant build file.

    <property name="wclibs" value="${src.dir}/lib/weblogicLibs" />
    <path id="project.class.path">
              <fileset dir="${wclibs}">
                   <include name=".jar" />
              </fileset>
              <
         </path>

    I've created the following taskdef for the wsdlc task:

    <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask">
              <classpath>
                   <path refid="project.class.path" />
              </classpath>
         </taskdef>

         <taskdef name="wsdlc" classname="weblogic.wsee.tools.anttasks.WsdlcTask">
              <classpath>
                   <path refid="project.class.path" />
              </classpath>
         </taskdef>

         <taskdef name="wldeploy" classname="weblogic.ant.taskdefs.management.WLDeploy">
              <classpath>
                   <path refid="project.class.path" />
              </classpath>
         </taskdef>

    When I run the generate-from-wsdl ant target, I run in to the following Error:
    javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.XMLOutputFactoryBase not found

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points