While deploying SOA composites using ant, the deployment fails due to the following error:
[echo]
[echo] ERROR IN TRYCATCH BLOCK:
[echo] /home/oracle/deploymentScripts/build.soa.xml:108: The following error occurred while executing this line:
[echo] /home/oracle/deploymentScripts/build.soa.xml:123: The following error occurred while executing this line:
[echo] /u01/oracle/middleware/Oracle_Home/soa/bin/ant-sca-package.xml:51: The following error occurred while executing this line:
[echo] /u01/oracle/middleware/Oracle_Home/soa/bin/ant-sca-compile.xml:342: Java returned: 1 Check log file : /tmp/out.err for errors
[echo]
[echo] **************************************************************
[echo] *
[echo] * ANT TARGET NAME: deployComposites
[echo] * FAILED PROCESS: UpdateGoNoGoApprovalCRMOD
[echo] ***
This is a part of the buildsoa.xml file.
I'm not actually getting what might be the error.
Kindly help me with this please.
Check your Java home path in your .bat file, and make sure the Java home path is set correctly (please check your Java installation path in your system).
Also check the Java home path in the environment variables of your system.
Related
I'm trying to deploy several systems with one script containing two targets. When one systems fails to deploy, I want to stop the whole script and fail.
<target name="deploy_all">
<for list="${systems}" param="system" delimiter="," parallel="false" threadCount="1" trim="true">
<sequential>
<antcall target="deploy_one_system">
<param name="system" value="#{system}" />
</antcall>
</sequential>
</for>
</target>
<target name="deploy_one_system">
<trycatch property="error_system">
<try>
<!-- deployment -->
<!-- Deep in other targets, there's <fail> -->
</try>
<catch>
<echo>Error during deployment of ${system}:</echo>
<echo>${error_system}</echo>
<!-- print logs, errors, cleanup -->
<if>
<contains string="${stop_execution_on_fail}" substring="${system}" />
<then>
<echo message="I should fail here!" />
<fail message="Error occured during deploying ${system}."/>
</then>
</if>
</catch>
</trycatch>
</target>
The problem is that the condition is evaluated correctly and message "I should fail here!" gets printed, but the build doesn't fail and continues deploying next system.
Variable ${stop_execution_on_fail} is supplied to the script and contains list of systems which should fail the whole build (instead of deploying the rest of systems).
Sometimes, the build fails after deploying several systems running out of memory.
17:07:03 deploy.xml:900:
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:802: Error occured during deploying system1.
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:802: Error occured during deploying system2.
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:802: Error occured during deploying system3.
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:4: java.lang.OutOfMemoryError: PermGen space
17:07:03 The following error occurred while executing this line:
17:07:03 deploy.xml:908: The following error occurred while executing this line:
17:07:03 deploy.xml:4: java.lang.OutOfMemoryError: PermGen space
I'm running Jenkins 1.642.1, JDK 1.8.0_74 and Ant 1.9.2.
Any ideas?
EDIT (based on pczeus' comment): The following is printed (don't mind timestamps, I took it from another build):
10:12:56 [echo] Error during deployment of system1:
10:12:56 [echo] The following error occurred while executing this line:
10:12:56 [echo] deploy.xml:739: The following error occurred while executing this line:
10:12:56 [echo] deploy.xml:647: The following error occurred while executing this line:
10:12:56 [echo] deploy.xml:473: The following error occurred while executing this line:
10:12:56 [echo] dbmaintain.xml:229: Unable to perform db maintain task.
--- omitted ---
10:12:56 [echo] I should fail here!
As you can see, the condition is evaluated successfully, as the message I should fail here! is printed.
stop_execution_on_fail variable contains comma-separated list of systems where to fail:
system1,system2,system3
I believe your issue is within your
<contains string="${stop_execution_on_fail}" substring="${system}" />
You are checking for a substring matching the system in the overall string stop_execution_on_fail. However, your try:
<trycatch property="error_system">
Is setting the error message within the error_system property, which you are not checking in your contains.
Try changing the <contains> to:
<contains string="${error_system}" substring="${system}" />
I traced the error down using Chad Nouis' suggestion and found out the following:
First, I was stupid when I didn't post the actual code but just excerpt and some variables substituted. Shame to me!
The parallel attribute in <for> call in deploy_all target was set to true. In that case, even with threadCount set to 1, Ant does fail the target, but doesn't prevent the for cycle from running next loop (although I'm convinced it should).
Thank you, Chad Nouis!
I'm trying to use Ant 1.7 but running into a problem. In my current directory, I have a build file called warupdate.xml. From within this directory, I execute:
/opt/apache-ant-1.7.0/bin/ant -f warupdate.xml
I then get the following error:
Buildfile: warupdate.xml
BUILD FAILED
./warupdate.xml is not an absolute path
Any ideas? Thanks!
Matt
Why name it anything other than build.xml? It's the standard, ant will expect it and then you can simply just run ant from that directory without specifying a build file.
Here's my warupdate.xml:
<project>
<echo>Tada!</echo>
</project>
Here's my Ant command:
$ /opt/ant/bin/ant -f warupdate.xml
Buildfile: /Users/david/warupdate.xml
[echo] Tada!
BUILD SUCCESSFUL
Total time: 0 seconds
Basically, it works.
Something else is going on, and you're not giving the full story. What does warupdate.xml look like? What if you use ant -d to get a verbose debugging output. Maybe that will show you what's going on. Why are you giving the full path to ant?
You have to give us more information.
I can get %ProgramFiles% in Ant with ${env.PROGRAMFILES}. But I can't figure out how to get %ProgramFiles(x86)%.
Use ${env.ProgramFiles(x86)}. The variable is case-sensitive in a way that is inconsistent with env.PROGRAMFILES.
[echo] env.ProgramFiles(x86) == C:\Program Files (x86)
[echo] env.PROGRAMFILES(x86) == ${env.PROGRAMFILES(x86)}
[echo] env.ProgramFiles == ${env.ProgramFiles}
[echo] env.PROGRAMFILES == C:\Program Files
Have you tried ${env.PROGRAMFILES(x86)} ? (See how to get program files x86 env variable?)
Apologies, I don't have a windows machine to test this one.
If this doesn't work I'd suggest adding the following property task in your build:
<property environment="env"/>
And run ANT in debug mode to see the values set:
ant -d
I have downloaded the Activity 5.10 zip file and then i have downloaded and configured the Apache ANT and i test it and it worked successfully.
But i am unable to run the demo file as specified in this link http://activiti.org/userguide/#demo.setup
if i type the following using the cmd command line:-
C:\activiti-5.10\activiti-5.10\setup>ant demo.start
I will get the following error:-
'ant' is not recognized as an internal or external command, operable program or batch file.
Can anyone help me in identifying what is the problem?
BR
:::UPDATE:::
thanks for the reply, i have copied the ANT bin files inside the setup directory for the activity,, then i run the CMD command again ,, but i got the following error that i build failed,,
AS MENTIONED BELOW:-
C:\Users\Desktop\activiti-5.10\activiti-5.10\setup>ant demo.start
Buildfile: C:\Users\Desktop\activiti-5.10\activiti-5.10\setup\build.xml
demo.install:
internal.cfg.create:
[copy] Copying 1 file to C:\Users\Desktop\activiti-5.10\activiti-5.
10\setup\build\activiti-cfg
[zip] Building zip: C:\Users\Desktop\activiti-5.10\activiti-5.10\s
etup\build\activiti-cfg.jar
[echo] copying configuration to ../workspace/activiti-engine-examples/src/m
ain/config
[unzip] Expanding: C:\Users\Desktop\activiti-5.10\activiti-5.10\setu
p\build\activiti-cfg.jar into C:\Users\Desktop\activiti-5.10\activiti-5.
10\workspace\activiti-engine-examples\src\main\config
internal.classpath.libs:
internal.taskdef.launch:
h2.start:
[echo] starting H2 database...
[launch] launching cmd 'C:\Users\Desktop\activiti-5.10\activiti-5.10\
apps\h2\h2.start.bat ' in dir 'C:\Users\Desktop\activiti-5.10\activiti-5
.10\apps\h2'
[launch] waiting for launch completion msg 'TCP server running'...
[launch] 'java' is not recognized as an internal or external command,
[launch] operable program or batch file.
[launch] launched process completed
[echo] H2 database started
tomcat.start:
BUILD FAILED
C:\Users\Desktop\activiti-5.10\activiti-5.10\setup\build.xml:330: couldn
't find executable for script C:\Users\Desktop\activiti-5.10\activiti-5.
10\apps\apache-tomcat-6.0.32\bin\startup
Total time: 0 seconds
Looks like you didn't set the ant directory in you path variable. Either specifiy the entire path to ant or add it to the path variable
I typed tomcat.install and it solved the problem since I need to download the tomcat inside the apps directory.
What I'm trying to achieve is to have log4j as the only output from my Ant build file.
Getting log4j works pretty much perfectly except that it extends Ants output. So I'm getting Ant's DefaultLogger interspersed with log4j output. Take a VERY simple Ant build file:
<project name="Maintenance_to_Delivery" default="main" basedir=".">
<target name="main">
<echo message="test">
</target>
</project>
And log4j.properties
log4j.rootLogger=ERROR, stdout
log4j.logger.org.apache.tools.ant.Project=INFO
log4j.logger.org.apache.tools.ant.Target=INFO
log4j.logger.org.apache.tools.ant.taskdefs=INFO
log4j.logger.org.apache.tools.ant.taskdefs.Echo=INFO
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %m%n
log4j.appender.stdout.Threshold=INFO
And running this plus the output:
# ant -lib /app/apache-sf/log4j/1.2.16/log4j-1.2.16.jar:. -listener org.apache.tools.ant.listener.Log4jListener
Buildfile: /home/sysswb/working/qa/sep/M2D-new/build.xml
16:36:59 INFO Build started.
main:
16:37:00 INFO Target "main" started.
[echo] TEST
16:37:00 WARN TEST
16:37:00 INFO Target "main" finished.
BUILD SUCCESSFUL
Total time: 1 second
16:37:00 INFO Build finished
so - is it possible to get log4j to completely replace the DefaultLogger output? ...without writing a custom logger? Since the -listener argument registers extra listeners, can whatever listener the DefaultLogger uses be removed/disabled?
I'm just Java 1.6.0_18 and Ant 1.8.0.
TIA.
You can pass log4j.properties in the class path while running the ant.
Check out this, it has much detailed explanation, follow comment by "Kevin", here is the excerpt:
Log4j loads its configuration by
looking for the system property
log4j.configuration. Failing that, it
looks for log4j.properties or
log4j.xml on the classpath.
try using the -e switch
ant -lib . -listener org.apache.tools.ant.listener.Log4jListener -e main
Buildfile: D:\install\apache-ant-1.8.0RC1-bin\apache-ant-1.8.0RC1\bin\build.xml
14:29:20 INFO Build started.
main:
14:29:20 INFO Target "main" started.
test
14:29:20 WARN test
14:29:20 INFO Target "main" finished.
BUILD SUCCESSFUL
Total time: 0 seconds
14:29:20 INFO Build finished.
[echo] test is gone