Building ejb jar weblogic 103 and ANT - ant

I am using wlappc command in ant script to build jar and I have weblogic.jar in classpath.
ejb3Compile:
[echo] "Compiling EJB"
[wlappc] Created working directory: /var/tmp/appcgen_1423590774747_VMS.jar
[wlappc] java.lang.RuntimeException: error in finding weblogic.Home
[wlappc] at weblogic.Home.getInstance(Home.java:91)
[wlappc] at weblogic.Home.getPath(Home.java:97)
[wlappc] at weblogic.ejb.container.persistence.InstalledPersistence.setInstallationLocation(InstalledPersistence.java:299)
[wlappc] at weblogic.ejb.container.persistence.InstalledPersistence.initialize(InstalledPersistence.java:134)

You have a couple of options:
Use ant supplied within the weblogic install, this should know the home by default:
<install dir>/modules/org.apache.ant_1.7.1/bin/ant
Add the weblogic home as a parameter to ant:
ANT_OPTS=-Dweblogic.home="<install_dir>/wlserver_10.3"
Replace <install_dir> with the path to your Oracle install directory.

Related

How to Use xmltask.jar inside build.xml placed inside any_path/ant/lib folder inspite of having pre-installed ant in the enviromnent

I have ant installed in my RedHat 7 machine. I have a project which has ant libraries inside lib folder. That lib folder is present inside installer. There is a jar file known as xmltask.jar inside lib folder. I had defined
<property name="dependencyfinder.home" value="."/>
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath location="${dependencyfinder.home}/lib/xmltask.jar"/>
</taskdef>
In that line i am getting
BUILD FAILED
installer\build.xml:37: taskdef class com.oopsconsultancy.xmltask.ant.XmlTask cannot be found
using the classloader AntClassLoader[]
Total time: 296 milliseconds
I am using an install script for executing build.xml which is responsible to set the class path.
The code for the script is as follows:
OLD_DIR=$(pwd)
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
cd ${SCRIPT_DIR}
ANT_HOME=$SCRIPT_DIR/ant
ANT_LIB=${ANT_HOME}/lib
${ANT_HOME}/bin/ant -q -e
cd ${OLD_DIR}
exit 0

Ant: failed to create task or type runtarget

I am running into the following error when trying to run ant:
Problem: failed to create task or type runtarget
I am building on a mac 10.8.3.
Prior research has suggested that I add ant-contrib-0.3.jar to my ANT_HOME installation directory, which I have done (that had actually gotten rid of another 'failed to create task or type' error)
I used ant-contrib-0.3.jar because research suggested that this jar is mapped to the line:
< taskdef resource="net/sf/antcontrib/antcontrib.properties" />
which is in the build.xml file I am using.
The project builds on windows machines ( I even got it to build using https://code.google.com/p/winant/ ) but am trying to get it built on a mac. I am thus not looking to change the build.xml file.
An example of the run target line is:
<target name="setPASProps" depends="" description="setup the properties">
<property name="systemname" value="PAS"/>
<runtarget target="setSystemProps"/>
</target>
Here is some info from running ant -diagnostics
-------------------------------------------
ANT PROPERTIES
-------------------------------------------
ant.version: Apache Ant(TM) version 1.8.2 compiled on June 20 2012
ant.java.version: 1.7
Is this the Apache Harmony VM? no
Is this the Kaffe VM? no
Is this gij/gcj? no
ant.core.lib: /usr/share/ant/lib/ant.jar
ant.home: /usr/share/ant
-------------------------------------------
ANT_HOME/lib jar listing
-------------------------------------------
ant.home: /usr/share/ant
ant-antlr.jar (5756 bytes)
ant-contrib-0.3.jar (17708 bytes)
ant-jmf.jar (6745 bytes)
ant-junit.jar (102350 bytes)
ant-junit4.jar (7126 bytes)
ant-launcher.jar (12321 bytes)
ant-swing.jar (7563 bytes)
ant-testutil.jar (15198 bytes)
ant.jar (1937098 bytes)
Thanks !
It would be helpful if you posted your build.xml too.
You usually get this error if Ant sees a task, but there's a problem with the definition.
Here's my recommendation:
In your project create a directory antlib/ant-contrib.
Download this zip file. Ant-contrib is a wee bit strange is that there is a separate jar for C compiling and for all of the other Ant tasks. The latest version is 1.0b3. When you unzip this zip file, you will see ant-contrib-1.0b3.jar inside this folder.
Put that ant-contrib-1.0b3.jar inside the antlib/ant-contrib folder.
Now, in your build.xml, use the following <taskdef/>:
<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<fileset dir="${basedir}/antlib/ant-contrib"/>
</classpath>
</taskdef>
Make sure this is not inside a target. You want this to be executed before any targets are executed.
I like doing the definition this way because the Ant Contrib jar file becomes part of my project, and anyone who needs to run my project will not have to manually install the Ant Contrib jar before they can use my project.
Take a look at your build.xml and see where that <Runtarget> task is being used. I've never used it, and the documentation for this task is so clear and helpful. Actually, I'm not even sure if it works. If you are still having problems, you try to see if you can remove the defined <target/> that contains this task, and see if that gets rid of the issue.
Removed ant-contrib-0.3.jar and added ant-contrib-1.0b3.jar and ant-contrib.jar to my ANT_HOME directory since these are the jars installed with https://code.google.com/p/winant/ (and it was working on windows machines).
This did the trick.

how to start jboss ; how to exclude appxml ; how to make .har file using ant build.xml

How to start and stop Jboss from Command prompt in windows 7 32bit
when i try to run run.bat file from command prompt i get following error
D:\jboss-6.1.0.Final\bin>run.bat
Calling D:\jboss-6.1.0.Final\bin\run.conf.bat
Could not locate "D:\jboss-6.1.0.Final\bin\bin\run.jar".
Please check that you are in the bin directory when running this script.
Press any key to continue . . .
How to start and stop jboss from apache ant build.xml file
How to make .har file for Hibernate project in java using apache ant build.xml
I don't want to include appxml in generated file using ant
appxml="..\PartyEJB\ejbModule\META-INF\ejb-jar.xml"
<ear destfile="${EAR}/PartyEAR.ear" appxml="..\PartyEJB\ejbModule\META-INF\ejb-jar.xml">
<fileset dir="${class}" includes="PartyEJB.jar"/>
<zipfileset dir="${lib.dir}" prefix="lib">
<include name="PartyEJBClient.jar"/>
</zipfileset>
</ear>
set JBOSS_HOME environment variable to D:\jboss-6.1.0.Final and then run run.bat
Verify that in your build.xml you are referring to the bin location directly, where as Ant trying to add bin to the path you have mentioned. Please remove /bin in build.xml from where you are invoking.
If it's a Web-Project or Java EE project, Dynamic Web project which doesn't have EJB's wouldn't require appxml.

Blackberry JDE 6.0 VERIFIER ERROR And KXML 2

I am trying to import kxml2, what I did is I downloaded the lib, went to Project Explorer -> Properties -> Build Path -> Libraries, I include the kxml2-2.3.0.jar. I run compile and get this error
JAR file creation failed with error -1
The preverified classes if any are in tmp25754. See jar log of errors in C:\Users\sgil\AppData\Local\Temp\rapc_1296da5f.dir\jarlog.txt
Error!: Error: preverifier failed: C:\Program Files (x86)\Eclipse-Blackberry\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components ...
Packaging project ** failed (took 0.795 seconds)
Error!: Error: preverifier failed: C:\Program Files (x86)\Eclipse-Blackberry\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components ...
Packaging project ** failed (took 0.795 seconds)
I tried running the preverifier and I got this:
preverify -classpath "C:\Program Files (x86)\Eclipse-B
lackberry\plugins\net.rim.ejde.componentpack6.0.0_6.0.0.30\components\lib\net_ri
m_api.jar" "C:\Users\sgil\Desktop\Projects\Blackberry****\lib\kxml2-2.3.0.
jar"
I get this error:
JAR file creation failed with error -1
The preverified classes if any are in tmp25503. See jar log of errors in output\
jarlog.txt
Any advice?
The solution to this is to put the correct PATH variable in the "Enviromental Variables" of the System(right click in My PC->Enviromental Variables).
If "PATH" already exists you need to add the path of the BIN of the JDK installed on the Computer.
The carpet you should add this is the bin:
for example: C:\PATH_TO_THE_INSTALLED_JDK\bin

Cannot run program "p4": CreateProcess error=2, The system cannot find the file specified

I'm developing automate deployment script for Coldfusion project.
Tool: cruisecontrol.net, ant script
Source control: perforce
Executing the following ant script from cruisecontrol.net i'm getting this error:
"Cannot run program "p4": CreateProcess error=2, The system cannot find the file specified"
But its working fine from command line:
ant -f deployment.xml
deployment.xml file content:
<!-- Get Latest revision from perforce -->
<echo message="Perforce code base Get Latest revision Started"/>
<p4sync port="${p4.server}"
client="${p4.workspace}"
globalopts="${p4.password}"
user="${p4.username}"
view="${p4.branch}"/>
<echo message="Perforce code base Get Latest revision completed"/>
ccnet.config:
<project name="TestMGDeployment">
<triggers>
<intervalTrigger seconds="300" />
</triggers>
<tasks>
<exec executable="C:\Apache\apache-ant-1.8.1\bin\ant.bat">
<baseDirectory>C:\cruisecontrol\Projects</baseDirectory>
<buildArgs>-f deployment.xml</buildArgs>
</exec>
</tasks>
</project>
Thanks,
Nagarajan
Your CruiseControl.net is probably running under different user account, make sure you have p4 in system PATH or specify the full path to the executable in your p4sync task.
Try running in command line instead of as a service to negate user environment definitions issue.
Check if you have setup the P4PORT environment variable. That should be set to: [your perforce server]:[perforce port].
For e.g., P4PORT=perforce.xyz.com:1666

Resources