RockyMountainHigh RockyMountainHigh -4 years ago 156
Java Question

WLST ant task not finding classpathref

I am experimenting with wlst for a local weblogic deploy. I have created a build.xml, file and a simple wlst script. I have tested the script from the commandline and it works perfectly. However, I am having a hard time getting it to execute from my ant file.


<project default="ListLibraries" name="WLST project">
<property file="" />

<taskdef name="wlst" classname="" classpathref="${}" />

<target name="ListLibraries">
<wlst fileName="${wlst.script.source}/" classpathref="${}" />


# Weblogic specific dirs

#workspace dirs

This is what I see:

$ ant Buildfile: /Users/me/workspaces/java/myarrow/local/build.xml

BUILD FAILED /Users/me/workspaces/java/myarrow/local/build.xml:4: Reference /Users/me/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar not found.

Total time: 0 seconds


However, that weblogic.jar does exist:

$ ls -la /Users/me/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar
-rwxrwxrw- 1 a84055 my\Domain Users 36339849 Feb 13 15:45 /Users/me/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar

What am I missing here? It's probably right in front of my eyes.

Answer Source

classpathref expects a reference to a path, instead of the physical path. Try using classpath instead:

<taskdef name="wlst" classname="" 
                     classpath="${}" />

See for examples using both attributes.

With classpathref, you need to create a reference first:

<path id="weblogic.lib.path">
  <fileset file="${}"/>

<taskdef name="wlst" classname="" 
                     classpathref="weblogic.lib.path" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download