ANT build.xml file

My build.xml must have problems, because the jar size is way smaller than the JBuilder equivalent. I think it is not including the 3rd party Jars that I want it to include.
Additionally, it builds, but when I execute it I get strange errors indicating it can't find certain system classfiles.
Here is the build file:
<project name="JAutoTest" default="dist" basedir=".">
<!-- set global properties for this build -->
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="test" value="jAutoTool"/>
<property name="dist" value="dist"/>
<property name="doc" value="doc"/>
<property name="Name" value="JAutoTest"/>
<property name="packages" value="jAutoTool.*"/>
<path id="project.class.path">
<pathelement location="lib/"/>
<pathelement location="jAutoTool/"/>
<pathelement path="${java.class.path}/"/>
</path>
<target name="check_for_optional_packages">
<available property="java.reflection" classname="java.lang.reflect"/>
</target>
<target name="prepare">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<mkdir dir="${test}"/>
<mkdir dir="${doc}"/>
</target>
<target name="compile" depends="prepare,check_for_optional_packages">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" debug="on" deprecation="off" optimize="on">
<classpath refid="project.class.path"/>
</javac>
</target>
<target name="genDoc" depends="compile">
<javadoc packagenames="${packages}" sourcepath="${basedir}/${src}" destdir="${doc}" author="true" version="true" windowtitle="${Name} API" doctitle="${Name}" bottom="Copyright � 2001 Motorola, Inc. All Rights Reserved."/>
</target>
<target name="dist" depends="compile">
<!-- Create the ${dist}/lib directory -->
<mkdir dir="${dist}/lib"/>
<!-- Put everything in ${build} into the JAutoTest-${DSTAMP}.jar file -->
<jar jarfile="${dist}/lib/JAutoTest-${DSTAMP}.jar" basedir="${build}"
          manifest="${dist}/META-INF/MANIFEST.MF">
          <zipgroupfileset dir="lib" includes="*.jar"/>
     </jar>
</target>
<target name="clean">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>
I have the other jars at /lib.
The error I am getting is:
D:\testjTool\dist\lib>java -jar *.jar
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:102)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:111)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.j
ava:251)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:217)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:185)
Thanks.

The error I am getting is:
D:\testjTool\dist\lib>java -jar *.jar
Uncaught error fetching image:
java.lang.NullPointerException
at sun.awt.image.URLImageSource.getConnection(URLImageSource.java:102)
at sun.awt.image.URLImageSource.getDecoder(URLImageSource.java:111)
at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.j
ava:251)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:217)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:185)
Classpath is:
D:\testjTool>set CLASSPATH=\testjTool\build;c:\JBuilder4\lib\HTTPClient.jar;c:\J
Builder4\lib\htmlparser.jar;c:\JBuilder4\lib\classes12;c:\JBuilder4\lib\classes12\javax.jar;c:\JBuilder4\lib\dbswing.jar;c:\JBuilder4\lib\jbcl.jar;.;
The ant build works, but the executable is 1/2 the size of the
JBuilder one.

Similar Messages

  • Converting build.cmd to Ant build.xml file

    Can anyone help me convert the attached build command file (windows) to a
              build.xml file for Ant?
              Thanks,
              Matt
              [build.txt]
              

    Hi Kevin,
    You can get lots of help from the following links
    http://help.sap.com/saphelp_nw04/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
    SAP XI - Where to Find Information
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/sap xi - where to find information.pdf
    Following is the link for 'how to guides', A step by step guide to create scenarios:
    https://websmp201.sap-ag.de/nw-howtoguides
    All the information you need in XI :
    http://help.sap.com/saphelp_nw04/helpdata/en/0f/80243b4a66ae0ce10000000a11402f/frameset.htm
    you can also go through the url for Elearning :
    https://www.sdn.sap.com/sdn/elearning.sdn
    To understand the architecture of XI, Please go through this link,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    XI is all about configuration of Adapters, to learn more please go through this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/0d/5ab43b274a960de10000000a114084/frameset.htm
    One of the most powerful feature of XI, Business Process Management:
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm
    Once you go through these links and are a bit aware what all XI objects do, you can try a simple "File to File Scenario" which would help you to understand XI objects in a much better manner.
    For help on this scenario go through this blog it is in two parts thus i am providing both links below:
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    Re: new to netweaver
    Re: how  use XSLT maping in XI
    Re: IDOC - XI - FILE scenario
    Regards
    Vishnu

  • Building a jar in an ant build.xml file

    Hi,
    i previously used netbeans to create a jar that you could doubleclick to have it automatically started (win 2000).
    The jar also included other jars like log4j, jdom and so.
    In Netbeans, i first made my project and those jars available via the filesystem. Then i just made a new jar, added my project and the startpoints of the other jars. For instance for the jdom.jar, i selected the org and everything beneath.
    Then i generated a standard manifest file and added this line:
    Main-Class: <package>/<mainclass>
    This worked ok fine.
    Now, for my question: i'm trying out ant and want to achieve the same as above. Building my project is not a problem. I specified the dependies on other jars like this:
      <target name="compile" depends="init" description="compile">
        <!-- Compile the java code from ${src} into ${build} -->
        <javac srcdir="${src}" destdir="${build}">
          <classpath>
            <pathelement location="lib/jdom.jar"/>
            <pathelement location="lib/log4j-1.2.7.jar"/>
          </classpath>
        </javac>
      </target>Compiling doesn't produce an error.
    However i can't seem to figure out how to build a jar where the root of each jar is included in the content of my own jar so i don't have to distribute the jars seperately.
    This is what i had so far for my jar:
      <target name="dist" depends="compile" description="generate" >
        <!-- Create the distribution directory -->
        <mkdir dir="${dist}/lib"/>
        <!-- Put everything in ${build} into customer-${DSTAMP}.jar file -->
        <jar jarfile="${dist}/lib/customer-${DSTAMP}.jar"
             basedir="${build}" manifest="${conf}/manifest.mf"/>
      </target>My manifest file:
    Manifest-Version: 1.0
    Main-Class: customer/clientAny idea of how to add the content of another jar to my own jar?
    Thanks

    Hhhm. stupid me, i found a sollution to this and it was on this very forum!
    This is the relevant thread:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=281090

  • Ant for the build.xml file

    when we give the ant command then what the background task perform?..
    how ant start parsing the build.xml file ?

    Go to ant.jakarta.org. They have numerous tutorials. Do some research first. If you run into an actual problem, then post what it is.
    - Saish

  • Help -- Who has experience with ant and build.xml files ?

    Hi,
    I think my build.xml file is missing setting a classpath I need, but I have never played around with a build.xml file. Could someone help ?
    Thank you.
    Grazia

    A lot of people here use ant. But not all of us can read your mind, and those of us that can are sadistic bastards that like to force people to provide details of their problems just for the hell of it.
    So please do the following:
    * Go through an ant tutorial or other introductory docs, doing an example or two if present.
    * Set up your build.xml according to what you've learned.
    * If it still doesn't work, post the relevant portions of it (hopefully you'll have a small, representative sample that reproduces the problem), along with your relevant directory and file structure, the command you're running, and what error messages you're getting.

  • "Build.xml file not exist"

    Hey Guys,
    i am currently involving in a servelet project (RendreX). i want to install apachi ant as a prerequirement. i am using windows 2003 server. I already downloded latest ant version and apache tomcat4.0. Also i have set all the class path,ANT-HOME(C:\ANT) and other relevent paths. But when i run ant command in the command prompt(C:\ANT>ant)will generate error state that "build.xml" file can't be found. Have i done any wrong thing here? Can anybody give a way that i can easily install apache ant on winows.
    It would be greatly appriciated if u can send me some advice to over come this problem.
    Best Regards
    Mohan

    build.xml is the default build file assumed by ant. You have to provide a build file to control what you expect from ant to do.

  • Build.xml classpath ref to be used in another build XML file

    Hi,
    I have ant build.xml with a target as
    <target name="build_project">
              <ant antfile="C:/projects/antbuild/build.xml" inheritAll="true">
                   <target name="clean" />
              </ant>
         </target>
         in report1.xml.
         This build.xml inturn have the classpath defined in it with the JARS added to the classpath.
         In the report2.xml,
         Can I use the classpathref in build.xml which is defined in report2.xml? Where report2.xml is imported in report1.xml as
         <import file="report2.xml" />
         If I can do so I don't have to create duplicate class path ref again adding all the JARS in report2.xml?
         Please clarify.
    Thanks.

    I've used quite a bit of ANT in the past, but I don't really know what to answer to your question that is in any way helpful to you. I remember that ANT has some form of build file inheritance built in, I've played around with it in years ago to try and crank out somewhat standardized build files with reusable elements. What I can recall is that I had to read a book on advanced ANT usage to be able to work it out, the online manual wasn't nearly enough.

  • How to create a build.xml file ??

    Hi there,
    I am learning j2ee at the moment. I have been throught the tutorial and got everything working (finally). however, now that I have started writing my own code, I am stuck with writing the build.xml file (as this is not covered in the tutorial, it is just provided). Does anyone know a good link that will give me step by step instructions on how to create my own build.xml file for my application.
    thanks

    You need to learn ant. Go here:
    http://jakarta.apache.org/ant/
    I also recommend "Java Development with Ant" by Hatcher and Loughran, just published.

  • Help with flex4unit ant build.xml: Socket timeout waiting for flexunit report

    I'm having trouble setting up ant to build and test my project locally and I'm not sure what the next step is.
    Info:
    Running on XP/Cygwin.
    All of the files that FlexUnit4 references when used in Flash Builder are in my '${basename}/libs' folder (eg FlexUnit4_1.0.swc).
    I've placed the flexunit4 task in my ant/libs folder.
    I'm getting two errors...
    I don't think I've set up the 'socket' stuff right for the tests. It just sits and waits then dies...
    [flexunit] Waiting for client connection ...
    (about a minute later)
    [flexunit] Stopping server ...
    [flexunit] End of test data reached, sending acknowledgement to player ...
    [flexunit] Closing client connection ...
    [flexunit] Closing server on port [1024] ...
    BUILD FAILED
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    Plus this is the error I get from the flash player:
    ReferenceError: Error #1065: Variable mx.skins.spark::BorderSkin is not defined.
    I don't know why it's complaining about Borderskin as I think I have included all the flex4 libs I could find. I suspect this second error is causing the first error?
    Any help appreciated. I think I'm just setting it up all wrong.
    Screencap of errors:
    http://twitpic.com/l7ay8
    build.xml:
    http://gist.github.com/20804

    Finally got everything working using the files from the CI Example which what i probably should have done in the first place.
    So a rough guide for anyone just starting out with this:
    Download the Flex 4 'workspace' from the digital primates hudson server . This appears to contain flexunit library and examples in various stages of development.
    I used Flex Builder 4 Beta 2 to set up my Test Suite and Test Cases.
    I then loaded the libs folder from:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject
    into my flex project's libs folder:
    this includes:
    FlexUnit4.swc
    FlexUnit4CIListener.swc
    flexUnit4UIRunner.swc
    flexTasks.jar
    flexUnitTasks.jar
    I didn't need to remove the FlexUnit4 stuff that is 'referenced' automatically by flash builder when you start adding flexunit4 tests/suites.
    Then I used a modified version of the TestRunner.mxml found in:
    workspace.zip\workspace\project\FlexUnit4SampleCIProject\src\test\flex
    The lines to pay attention to are the ones that look like:
    static public function currentRunTestSuite():Array {
        var testsToRun:Array = new Array();
        testsToRun.push(packagename.TestSuiteName);
        testsToRun.push(packagename.TestClassName);
        return testsToRun;
    Just make sure you update this list to include all of the test suites &/or individual tests you want to run.
    I made this a static function and modified the code in the "FlexUnitApplication.mxml" file to use this function so i'd only need to update one list of suites/tests.
    FlexUnitApplication.mxml is generated automatically when you run FlexUnit4 tests in the Flash Builder 4 Beta 2 IDE.
    This is the build.xml file I'm using in the project:
    http://gist.github.com/208211
    Change the name of the project from "Flare" to whatever and adjust the other path settings where required (though you might want to write this from scratch at least once so you understand roughly what is going on).
    The Debug Flash Player must be installed on the server otherwise you'll get a:
    java.util.concurrent.ExecutionException: Socket timeout waiting for flexunit report
    ...while it waits for the non-existant debugger to attach. (This is obvious but I did forget and was a bit bewildered for a moment)
    Need to also ensure the environment variable:FLEX_HOME is set to the location you installed the flex sdk...by editing your .bashrc setting the environment variable the in the Hudson Configuration.
    You'll need to point Hudson at your ant installation and your jdk installation. If you downloaded he sdk, be aware you might need to point it to the jdk folder inside the place you installed the sdk.
    And I think that's all the problems I had. Hope it's useful to someone... if anyone who actually knows what they are doing can point out any potential issues/better ways of doing things, feel free to comment.
    Thanks to Brian (legrosb) and Mike (mlabriola) for their assistance!

  • Help with Flex Ant build.xml error

    So I've started on a new project and I'm new to Flex. A lot of learning curve here. Anyway, I'm trying to deploy a project that uses flex and is built with Ant. We've moving up from a version of Flex 2 to Flex 3. The build file works fine in the Flex 2 app but for some reason does not seem to be working with Flex 3. I'm hoping someone can give me some insight on what might be wrong or where to start.
    The error is Command not found: compc
    The part of the build file it has a problem with is:
    <compc include-classes="${classes}"
         ouput="${flex.dist.dir}/${flex.app.name}.swc"
         keep-generated-actionscript="false"
         headless-server="${headless.server}"
         incremental="true">
    <load_config filename="${FLEX_HOME}/frameworks/flex-config.xml" />
    <source-path path-element="${FLEX_HOME}/frameworks" />
    <source-path path-element="${flex.app.root}" />
    <compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
         <include name="libs" />
         <include name="../bundles/{local}" />
    </compiler.library-path>
    <compiler.library-path dir="${flex.app.root}" appent="true">
         <include name="libs" />
    </compiler.library-path>
    </compc>
    Any help at all would be greatly appreciated, thank you.

    Sorry, I meant to address that. Yes, since we've moved up to the Flex 3 sdk, we are pointing at a new directory. The old directory was flex_sdk and the new directory is flex_sdk_340.
    FLEX_HOME is being set in the build.properties file for local building and then overidden in the build.xml file with this code:
    <target name="build">
         <available property="FLEX_HOME" value="/apps/flex_sdk_340" file="/apps/flex_sdk_340" />
         <echo>FLEX_HOME = ${FLEX_HOME}</echo>
         <antcall target="compile" />
    </target>
    I did notice a warning about not using the available property, so I removed it and just changed what FLEX_HOME was set to in the build.properties file to the server directory. Would mess up local building but regardless it didn't matter because it had no effect on the error being generated. I alos looked a little into the file property of the available tag trying to figure out if that was somehow an issue but I wasn't able to come to any conclusion.
    Before the program errors out, it does displayt he echo statement and the value of FLEX_HOME appears to be correct in that it does show /apps/flex_sdk_340.
    Thank you so much for your continued help. This is truly frustrating because nothing but a directory name has really changed and yet it stopped working. I can't find any information anywhere on what could be wrong and this is really my last resort.

  • How to run JDev's generated build.xml file(BPEL project) from command win.?

    hi all
    When I execute build.xml file of simple BPEL project from JDev it runs properly. But when I try to execute it from normal command window It gives me an following error.
    ...........droping jar file xyz.jar from path as i doesn't exists.
    While all jar files are exist there.But Ant drops it from Classpath variable.
    So JDev sets some environment before executing such build.xml file.Like {oracle.home} variable u need to set while runnig build.xml from command window.
    Any suggestions...???
    /mishit

    you cant run a .war file from command prompt
    .war files should be executed in a server
    how to execute a single servlet class
    do you mean to run the servlet or compile the servlet?
    any way you need a server and if you are a beginner Apache tocat will be the best server to start with you can down load it from
    http://tomcat.apache.org/

  • [svn] 3680: Modifying ant build.xml to allow for a local. properties for individual developer build config.

    Revision: 3680
    Author: [email protected]
    Date: 2008-10-16 07:58:21 -0700 (Thu, 16 Oct 2008)
    Log Message:
    Modifying ant build.xml to allow for a local.properties for individual developer build config. Also moving ja_JP locale to the other.locales target (this is called during build machine packaging and isn't needed by dev by default).
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Discussed with Jim
    Modified Paths:
    flex/sdk/trunk/build.xml
    flex/sdk/trunk/frameworks/projects/airframework/build.xml
    flex/sdk/trunk/frameworks/projects/framework/build.xml
    flex/sdk/trunk/frameworks/projects/rpc/build.xml

    I tried
    ant deployTestSuites
    this works. If i do that with the wrong domain (dep_cotrol vs dep_me) name it fails with
    ORABPEL-02052Cannot lookup BPEL domain.The BPEL domain "dep_cotrol" cannot be found; the domain may not have initialized properly.Please verify that the BPEL domain loader has a valid set of initialization properties in the application properties file.
    So i think my config is ok. There is a bug in this ant bpelTest which ignores the domain?

  • Starting tomcat 5.5 in Ant build.xml

    Hi everyone,
    I have been trying to get my build.xml file to start and stop Ant but am finding it difficult..
    this is a snippet of the code i am using
    <target name="tomcatOFF">
         <echo>Turning Off Tomcat [http://www.jspbook.com]</echo>
              <exec executable="bash" os="microsoft">
    <arg value="c:\program files\apache software foundation\bin\stop.bat"/>
         </exec>
    </target>
    <target name="tomcatOn">
    <echo>Turning ON Tomcat [http://www.jspbook.com]</echo>
         <exec executable="bash" os="microsoft">     
    <arg value="c:\program files\apache software foundation\bin\start.bat"/>
         </exec>
    </target>
    My computer is running on microsoft server 2003. I have two batch files that work in ms dos when run but wont work in ant as i am not used to the syntax.
    But when i run the code nothing happens. Has anyone got any ideas of how to implement the task of starting and stopping the service
    many thanks
    Dale

    Hello,
    I would recommend you to post your question to the OA Framework forum at:
    OA Framework
    You'll probably get more help about OAF from that forum.
    Good luck.
    Steff

  • Unable to create build.xml file

    I wrote build.xml file to create build using ANT in eclipse but it failed. The reason is value for "location" attribute (see below) is wrong and I don't know how to fix it. My eclipse workspace is in D:/eclipse/workspace...............but the eclipse software is in C:/eclipse....by inspection I can see that in the plugins directory in c:/eclipse there is paskage/folder named org.eclipse.jdt.core_3.0.0 which has a jar file named JDTCompilerAdapter.jar. Does the "location" attribute need to refer to this location ? If yes then how should I specify the path as I think hardcoding isn't a solution. I mean I obviously can't say
    location="C:\eclipse\plugins\org.eclipse.jdt.core_3.0.0\org.eclipse.jdt.core_3.0.0.JDTCompilerAdapter"/>
    Please advise !!
    <?xml ...>
    <project name="game" default="Main Build" basedir=".">
         <property name="bin" location="bin"/>
         <property name="src" location="src"/>
         <property name="jardir" location="${bin}/lib"/>
         <property name="jarfile" location="${jardir}/game.jar"/>
         <property name="build.compiler"
              location="org.eclipse.jdt.core_3.0.0.JDTCompilerAdapter"/>

    I'm not exactly sure what you're doing here, but I don't think any of that stuff belongs in the Ant build.xml. That should be generic, something you can run either inside or outside Eclipse.
    The compiler that's used can be specified in Eclipse when you set up paths for Ant. That doesn't belong inside the build.xml itself.

  • How to automatically generate build.xml file in eclipse?

    Hello every body,
    I am learning about ANT. e.g I have writen a very simple programme which displays output "no worries". But how can I compile it with ANT and how can I generate build.xml file using eclipse.

    This is not really a Java issue but rather is an Eclipse issue. You may wish to look for their support sites or forums.

Maybe you are looking for