Question
Carelon Global Solutions
IN
Last activity: 19 Dec 2016 11:50 EST
Getting ant.jar missing error while installing PEGA PRPC 7.1.7
Hi,
I am getting below error while running the install.sh script. Can some one please help me.
I can see the ant.jar link file under /usr/share/ant/lib path.
Buildfile: ./setupDatabase.xml
Hi,
I am getting below error while running the install.sh script. Can some one please help me.
I can see the ant.jar link file under /usr/share/ant/lib path.
Buildfile: ./setupDatabase.xml
Initialization:
[echo] Performing ${ant.project.invoked-targets}
[delete] Deleting directory /app/pega/install/114716_Pega717/scripts/taskRuntimes
[mkdir] Created dir: /app/pega/install/114716_Pega717/scripts/taskRuntimes
[pega:propertyparser] Reading Properties from : /app/pega/install/114716_Pega717/scripts/setupDatabase.properties
[pega:propertyparser] pega.jdbc.driver.jar=/app/pega/weblogic/oracle_common/modules/oracle.jdbc_11.2.0/ojdbc7.jar
[pega:propertyparser] pega.jdbc.driver.class=oracle.jdbc.OracleDriver
[pega:propertyparser] pega.database.type=oracledate
[pega:propertyparser] pega.jdbc.url=jdbc:oracle:thin:@xxx:1521/orcl
[pega:propertyparser] pega.jdbc.username=SYSTEM
[pega:propertyparser] pega.jdbc.password=******
[pega:propertyparser] rules.schema.name=PRPC_RULES_USR
[pega:propertyparser] data.schema.name=PRPC_DATA_USR
[pega:propertyparser] user.temp.dir=
[pega:propertyparser] pega.zos.properties=
[pega:propertyparser] run.assembler=
[pega:propertyparser] import.assembled.classes=true
[pega:propertyparser] system.name=pega
[pega:propertyparser] production.level=3
[pega:propertyparser] multitenant.system=false
[pega:propertyparser] upgrade.runUpdateWizard=false
[pega:propertyparser] import.codeset.name=Customer
[pega:propertyparser] import.codeset.version=06-01-01
[pega:propertyparser] build.conclusions=
BUILD FAILED
/app/pega/install/114716_Pega717/scripts/setupDatabase.xml:618: Problem: failed to create task or type propertyfile
Cause: the class org.apache.tools.ant.taskdefs.optional.PropertyFile was not found.
This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
-/usr/share/ant/lib
-/home/pega/.ant/lib
-a directory added on the command line with the -lib argument
Do not panic, this is a common problem.
The commonest cause is a missing JAR.
This is not a bug; it is a configuration problem
Total time: 0 seconds
Ant Process returned a non 0 value
***Moderator Edit: Vidyaranjan| Updated Categories***
***15/12/2016:Updated by moderator: Lochan to add SR details***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Carelon Global Solutions
IN
Hi Lochan,
Issue has been resolved after copying the <PRPC>/scripts/lib and <PRPC>/scripts/bin (ant jar files) to default path /usr/share/ant.
Because we are unable to point to <prpc>/scripts path.
Thanks
Gurudutta
Pegasystems Inc.
US
See this article
https://community.pega.com/support/support-articles/migrationsh-fails-could-not-create-task-or-type
Check to see if the user who is trying to run the install has a version of ANT on the classpath. There is a version of ant that comes with the media in the scripts/bin directory that needs to be used for the install. Reset this users classspath to not include ant and then retry the install script.
Carelon Global Solutions
IN
Hi Celeste,
No classpath variable set for the user, but could see the below values.
[pega@saryppxx scripts]$ echo $CLASSPATH
[pega@saryppxx scripts]$
PATH=/app/pega/oracle/product/12.1.0/client_1/bin:/app/pega/java/jdk1.7.0_45/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/sbin:/usr/sbin:/etc
DOMAIN_HOME=/app/pega/weblogic/user_projects/domains/pegaPRE
Pegasystems Inc.
GB
This is just a guess (I haven't had chance to try this yet) ; but can you try the following :
1. First set the ENV Variable ANT_HOME to point at the (fully-qualified-path) to the <prpc-media>\scripts\bin path.
Make sure you export the variable, then run 'install.sh'.
Does this give the same error or not ?
If so: try this :
Make a copy of 'install.sh' to 'install.sh.orig' (say).
Now change this bit of the script, from:
# Run Ant, given the configuration we collected
set -o pipefail
"`dirname "$0"`/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
To:
# Run Ant, given the configuration we collected
set -o pipefail
PUT_IN_THE_REAL_PATH_HERE/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
Where PUT_IN_THE_REAL_PATH_HERE is what you should replace with the actual real path (it's not a variable I mean).
I'm not sure what is going on in your case; but it looks like the 'ant' script in the <prpc-media>\scripts\bin directory does this:
This is just a guess (I haven't had chance to try this yet) ; but can you try the following :
1. First set the ENV Variable ANT_HOME to point at the (fully-qualified-path) to the <prpc-media>\scripts\bin path.
Make sure you export the variable, then run 'install.sh'.
Does this give the same error or not ?
If so: try this :
Make a copy of 'install.sh' to 'install.sh.orig' (say).
Now change this bit of the script, from:
# Run Ant, given the configuration we collected
set -o pipefail
"`dirname "$0"`/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
To:
# Run Ant, given the configuration we collected
set -o pipefail
PUT_IN_THE_REAL_PATH_HERE/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
Where PUT_IN_THE_REAL_PATH_HERE is what you should replace with the actual real path (it's not a variable I mean).
I'm not sure what is going on in your case; but it looks like the 'ant' script in the <prpc-media>\scripts\bin directory does this:
# load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then
if [ -f "/etc/ant.conf" ] ; then
. /etc/ant.conf
fi
fi
And I'm not sure whether this is causing it to pick up other settings from another copy of ant installed on this system ? (hence the first thing to try and do is force the ANT_HOME to pickup the one in the media - which should then [I think] stop it picking up the system-wide ant configuration).
The second change is just to make it more obvious to us which exact 'ant' file is being picked-up - the script actually looks correct to me ("$0" should find the location of the 'install.sh' script and then locate the subdirectory 'bin' - but maybe this isn't working properly somehow?)
Pegasystems Inc.
GB
Also consider switching DEBUG for the 'install.sh' script; change the first line from:
#!/bin/sh
to:
#!/bin/sh -xv
And re-run it. You might also want to 'echo $ANT_PROPS' etc out at strategic points in the script ?
Carelon Global Solutions
IN
Thanks Pritj, for your interest and assistance.
Please find the output below. still facing the issue after trying multiple ways.
Ant Process returned a non 0 value
#!/bin/bash -xv
====
# Run Ant, given the configuration we collected
set -o pipefail
+ set -o pipefail
"`dirname "$0"`/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
+ tee logs/CLI-Install-log-Dec-13-2016-10-47-48.log
dirname "$0"
++ dirname ./install.sh
+ ./bin/ant -f ./setupDatabase.xml install -noclasspath
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
if [ $? -ne 0 ] ; then
echo "Ant Process returned a non 0 value"
exit 1
else
exit 0
fi
+ '[' 1 -ne 0 ']'
+ echo 'Ant Process returned a non 0 value'
Ant Process returned a non 0 value
+ exit 1
=======
After editing the script:
Thanks Pritj, for your interest and assistance.
Please find the output below. still facing the issue after trying multiple ways.
Ant Process returned a non 0 value
#!/bin/bash -xv
====
# Run Ant, given the configuration we collected
set -o pipefail
+ set -o pipefail
"`dirname "$0"`/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
+ tee logs/CLI-Install-log-Dec-13-2016-10-47-48.log
dirname "$0"
++ dirname ./install.sh
+ ./bin/ant -f ./setupDatabase.xml install -noclasspath
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
if [ $? -ne 0 ] ; then
echo "Ant Process returned a non 0 value"
exit 1
else
exit 0
fi
+ '[' 1 -ne 0 ']'
+ echo 'Ant Process returned a non 0 value'
Ant Process returned a non 0 value
+ exit 1
=======
After editing the script:
# Run Ant, given the configuration we collected
set -o pipefail
+ set -o pipefail
"/app/pega/install/114716_Pega717/scripts/bin/ant" $ANT_PROPS -f ./setupDatabase.xml install -noclasspath 2>&1 | tee $logfile
+ /app/pega/install/114716_Pega717/scripts/bin/ant -f ./setupDatabase.xml install -noclasspath
+ tee logs/CLI-Install-log-Dec-13-2016-10-49-42.log
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
if [ $? -ne 0 ] ; then
echo "Ant Process returned a non 0 value"
exit 1
else
exit 0
fi
+ '[' 1 -ne 0 ']'
+ echo 'Ant Process returned a non 0 value'
Ant Process returned a non 0 value
+ exit 1
Pegasystems Inc.
GB
Thanks for this - I wonder if your Java Version is important here ? [see: http://stackoverflow.com/questions/19497182/ant-unable-to-launch-giving-a-main-class-error ]
Maybe try this:
Change into the [...]\scripts\bin directory itself.
And just trying running ant like this:
ant -version
Does this report back an error or not ?
Carelon Global Solutions
IN
[pega@saryppapp1 lib]$ ant -version
Apache Ant version 1.7.1 compiled on April 26 2010
[pega@saryppapp1 lib]$
===
[pega@saryppapp1 bin]$ ant -version
Apache Ant version 1.7.1 compiled on April 26 2010
[pega@saryppapp1 bin]$
Pegasystems Inc.
GB
Thanks again - can you also try this:
Create a new 'build.xml' (in a new clean directory):
<?xml version="1.0" encoding="UTF-8"?>
<project name="test">
<target name="main">
<echo message="hello, ant"/>
</target>
</project>
And try running it, like this:
ant main
And like this:
/app/pega/install/114716_Pega717/scripts/bin/ant main
I just did a quick-test on an Ubuntu 16.04 (64bit) server here using the copy of 'ant' that was installed in the standard Operating System paths:
Apache Ant(TM) version 1.9.6 compiled on July 8 2015
And I note a difference when I use JDK1.8 (openjdk) and JDK1.7 (Oracle) - it actually works in both cases; but the JDK1.8 gives an error:
With JDK1.8 (openjdk)
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar
Buildfile: /home/prpc/ant/build.xmlmain:
[echo] hello, antBUILD SUCCESSFUL
But with JAVA_HOME set to my (Oracle) JDK7 , I get this - no errors this time:
Thanks again - can you also try this:
Create a new 'build.xml' (in a new clean directory):
<?xml version="1.0" encoding="UTF-8"?>
<project name="test">
<target name="main">
<echo message="hello, ant"/>
</target>
</project>
And try running it, like this:
ant main
And like this:
/app/pega/install/114716_Pega717/scripts/bin/ant main
I just did a quick-test on an Ubuntu 16.04 (64bit) server here using the copy of 'ant' that was installed in the standard Operating System paths:
Apache Ant(TM) version 1.9.6 compiled on July 8 2015
And I note a difference when I use JDK1.8 (openjdk) and JDK1.7 (Oracle) - it actually works in both cases; but the JDK1.8 gives an error:
With JDK1.8 (openjdk)
Unable to locate tools.jar. Expected to find it in /usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar
Buildfile: /home/prpc/ant/build.xmlmain:
[echo] hello, antBUILD SUCCESSFUL
But with JAVA_HOME set to my (Oracle) JDK7 , I get this - no errors this time:
~/ant$ export JAVA_HOME=/usr/lib/jvm/java-7-oracle
~/ant$ ant main
Buildfile: /home/prpc/ant/build.xmlmain:
[echo] hello, antBUILD SUCCESSFUL
Total time: 0 seconds
Carelon Global Solutions
IN
Hi Pritj,
I have created "build.xml" file under /home/pega directory.
Please find the output.
[pega@saryppapp1 ~]$ echo $JAVA_HOME
/app/pega/java/jdk1.7.0_45
[pega@saryppapp1 ~]$ pwd
/home/pega
[pega@saryppapp1 ~]$ ant main
Buildfile: build.xml
main:
[echo] hello, ant
BUILD SUCCESSFUL
Total time: 0 seconds
[pega@saryppapp1 ~]$ /app/pega/install/114716_Pega717/scripts/bin/ant main
Buildfile: build.xml
main:
[echo] hello, ant
BUILD SUCCESSFUL
Total time: 0 seconds
Carelon Global Solutions
IN
Hi Pritj,
I have deleted the ant folder under /usr/share path. now I am getting below error.
[pega@saryppapp1 ~]$ ant main
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
[pega@saryppapp1 ~]$ /app/pega/install/114716_Pega717/scripts/bin/ant main
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
[pega@saryppapp1 ~]$
[pega@saryppapp1 scripts]$ pwd
/app/pega/install/114716_Pega717/scripts
[pega@saryppapp1 scripts]$ ./install.sh
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
Ant Process returned a non 0 value
[pega@saryppapp1 scripts]$
Pegasystems Inc.
GB
Can we take a look at the Java you are using:
/app/pega/java/jdk1.7.0_45/bin/java -version
I'm quite confused here: because the basic 'build.xml' (hello,ant) script worked using apparently the same JVM.
BTW: you should probably restore the /usr/share directory stuff if you can ; just in case this effects somebody else using ant on this system (or maybe it doesn't matter, if you are the only user?)
(quite a few reports about the Java version [and vendor] being import for this error on the Web : see http://stackoverflow.com/questions/2336299/what-is-wrong-with-my-ant-configuration )
Carelon Global Solutions
IN
Hi Pritj,
Is this will help us?
[pega@saryppapp1 ~]$ ant --execdebug main
exec "/app/pega/java/jdk1.7.0_45/bin/java" -classpath "/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/app/pega/java/jdk1.7.0_45/lib/tools.jar:/app/pega/install/114716_Pega717/scripts/" -Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib" org.apache.tools.ant.launch.Launcher -cp "" "main"
Buildfile: build.xml
main:
[echo] hello, ant
BUILD SUCCESSFUL
Total time: 0 seconds
[pega@saryppapp1 ~]$ /app/pega/install/114716_Pega717/scripts/bin/ant --execdebug main
exec "/app/pega/java/jdk1.7.0_45/bin/java" -classpath "/usr/share/java/ant.jar:/usr/share/java/ant-launcher.jar:/usr/share/java/jaxp_parser_impl.jar:/usr/share/java/xml-commons-apis.jar:/app/pega/java/jdk1.7.0_45/lib/tools.jar:/app/pega/install/114716_Pega717/scripts/" -Dant.home="/usr/share/ant" -Dant.library.dir="/usr/share/ant/lib" org.apache.tools.ant.launch.Launcher -cp "" "main"
Buildfile: build.xml
Carelon Global Solutions
IN
Dear Pritj,
Below is the output from SIT env, where I have successfully installed PEGA.
Clearly there is miss match in the paths of Dant.home. How to fix this issue?
[pega@saryptintapp ~]$ /app/pega/install/114716_Pega717/scripts/bin/ant main
Buildfile: /home/pega/build.xml
main:
[echo] hello, ant
BUILD SUCCESSFUL
Total time: 0 seconds
[pega@saryptintapp ~]$ /app/pega/install/114716_Pega717/scripts/bin/ant --execdebug main
exec "/app/pega/java/jdk1.7.0_45/jre/bin/java" -classpath "/app/pega/install/114716_Pega717/scripts/lib/ant-launcher.jar" -Dant.home="/app/pega/install/114716_Pega717/scripts" -Dant.library.dir="/app/pega/install/114716_Pega717/scripts/lib" org.apache.tools.ant.launch.Launcher -cp "" "main"
Buildfile: /home/pega/build.xml
main:
[echo] hello, ant
BUILD SUCCESSFUL
Total time: 0 seconds
Pegasystems Inc.
IN
Hello!
This issue is also being working through an SR with Pega Global Customer Support. Please do let us know for any updates!
Regards,
Lochan | Community Moderator | Pegasystems Inc.
Accepted Solution
Carelon Global Solutions
IN
Hi Lochan,
Issue has been resolved after copying the <PRPC>/scripts/lib and <PRPC>/scripts/bin (ant jar files) to default path /usr/share/ant.
Because we are unable to point to <prpc>/scripts path.
Thanks
Gurudutta
Pegasystems Inc.
IN
Hi Gurudutta,
Glad to hear that the issue has been resolved. Thank you for updating the resolution here!
Regards,
Lochan | Community Moderator | Pegasystems Inc.