2
votes

I am attempting to perform an Ant build to build a web service from a WSDL file for a Weblogic web application. However, I am receiving the following error upon attempting the build:

BUILD FAILED 
/<path>/build.xml:19: taskdef class weblogic.wsee.tools.anttasks.WsdlcTask cannot be found 
using the classloader AntClassLoader[]

The taskdefs in the build/xml look like this:

<taskdef name="wsdlc"
         classname="weblogic.wsee.tools.anttasks.WsdlcTask"/>
<taskdef name="jwsc"
  classname="weblogic.wsee.tools.anttasks.JwscTask" />
<taskdef name="clientgen"
  classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
<taskdef name="wldeploy"
  classname="weblogic.ant.taskdefs.management.WLDeploy"/>

I have also tried to explicitly define the classpath in these taskdefs as follows, with no success:

<taskdef name="wsdlc"
           classname="weblogic.wsee.tools.anttasks.WsdlcTask"
           classpath="/WebContent/WEB-INF/lib/weblogic.jar"/>

And this is the classpath of the build.xml file:

classpath of build.xml

I have no clue why I get a "class cannot be found" error... I'm following instructions from Oracle docs - Building a Web Application from an WSDL file for the format of the build.xml file.

Notes: I am NOT executing this build.xml file from the same location the Weblogic server is being run from, as the Weblogic server does not have Ant installed. I am attempting to build it locally, in order to get the web service created, to finally deploy it in an EAR bundle of the WAR file + web service through the Weblogic console.

2
Is the jar actually located in /WebContent/WEB-INF/lib/? Try typing ls /WebContent/WEB-INF/lib/ in your terminal. You need to find the actual path.CAustin
Yes, the jar is indeed in there.Joe Balin

2 Answers

4
votes

you need to set WLS domain environment (setDomainEnv.sh)., otherwise ant cannot find proprietary WLS classes.

(setDomainEnv.cmd for Windows and setDomainEnv.sh for Linux).

to achieve that you need to:

source ./setDomainEnv.sh
0
votes

In my case, I just added the "weblogic.jar" to the classpath configuration. Localized at: [your_directory]\wls\wlserver\sip\server\lib

ECLIPSE: Run as -> Ant Build... -> Classpath(tab) -> Add external Jar's