Antcall causes FileNotFoundException if using executeTarget within java

Hi all,
this is my first post here, so i dont know if it's the right place (sorry if so).
I try to run an ant target within a java program.
My build file (test.xml) is:
<project name="test" default="usage" basedir=".">
  <target name="test1" >
    <echo message="Target test1" />
    <antcall target="test2"/>
  </target>
  <target name="test2" >
    <echo message="Target test2" />
  </target>
</project>My java programm is:
public static void main (String [] a) {
  String buildFileName = "test.xml";
  File buildFile = new File (".",buildFileName);
  Project project = new Project();
  project.init();
  ProjectHelper helper = new ProjectHelperImpl();
  helper.parse(project, buildFile);
  project.executeTarget("test1");     
}This causes following exception:
Exception in thread "main" test.xml:4: The following error occurred while executing this line:
java.io.FileNotFoundException: build.xml
     at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:539)
     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:336)
     at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
     at org.apache.tools.ant.Task.perform(Task.java:364)
     at org.apache.tools.ant.Target.execute(Target.java:341)
     at org.apache.tools.ant.Target.performTasks(Target.java:369)
     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
     at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
     at test.Test.main(Test.java:19)
Caused by: java.io.FileNotFoundException: build.xml
     at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:243)
     at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:140)
     at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
     at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:334)
     ... 7 more
Caused by: java.io.FileNotFoundException: build.xml
     at java.io.FileInputStream.open(Native Method)
     at java.io.FileInputStream.<init>(FileInputStream.java:106)
     at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:198)
     ... 10 moreIf I use <ant antfile="test.xml" target="test2"/> instead it works perfecly. But I don't want to. The target "antcall" was created to call targets within the same build-file, but why build.xml is referenced anywhere?
Might this be an ant bug?
Any ideas?
Tx

Disregard, sorry, got confused about build.xml and text.xml.
May I advise to ask at an Ant forum, though?

Similar Messages

  • Use plsql within java (or javascript) programs

    hi,
    to interface with oracle db, I've always used PLSQL blocks within programs written in C language but now I've to insert PLSQL blocks in java or javascript language
    I don't know if it's possibile and I don't know how to do it
    may someone explicate it to me?
    thanks a lot!

    mfran2002 wrote:
    hi,
    to interface with oracle db, I've always used PLSQL blocks within programs written in C language but now I've to insert PLSQL blocks in java or javascript language
    I don't know if it's possibile and I don't know how to do it
    may someone explicate it to me?
    thanks a lot!There is no pre-processor in the Java standard packages (don't know if there is one out there somewhere, but I imagine that there probably is) as there is for Pro*C. Oracle have one in store??? ... hope so.
    So in Java the SQL (including function calls) is built as Strings, which are then fed as arguments to the execute methods of Statement, or to the PreparedStatement itself - that tutorial will spell this all out well.
    So the SQLs can be static or build dynamically.
    ~Bill
    Also ... you can store Java stored procedures in the Oracle DB, wrapped as PL/SQL functions and then call them as such.

  • Using Scanner within Java Program

    How do i call a scanner (scan documents) from a java application and collect the output from scanner in java application.

    Hi,
    You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
    JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
    The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
    In the simplest case, one line of Java code can solve your problem.
    Good luck!

  • Trying to use grep from within java,using exec command!

    Hi all!
    I would like to run a grep function on some status file, and get a particular line from it, and then pipe this line to another file.
    Then perfom a grep on the new file to check how many of the lines above are present in that file, and then write this value to a new file.
    The final file with a numerical value in it, i will read from within java,as one reads normal files!
    I can run simple commands using exec, but am kinda stuck with regards to the above!
    Maybe i should just do all the above from a script file and then run the script file from exec. However, i dont want to do that, because it kinda makes the system dependent,..what if i move to a new machine, and forget to install the script, then my program wont work!
    Any advise?
    Thanks
    Regards

    With a little creativity, you can actually do all that from the command line with a single command. It'll look a little crazy, but it can be done.
    Whether the script exists on the local machine or not has zero to do with platform indpendence. You assumedly have to get the application onto the local machine, so including the script is not really an issue at all. However, you're talking about system independence, yet still wishing to run command line arguments? The two are mutually exclusive.

  • Re-use message mapping from within java mapping?

    Hi there,                                                                               
    I have a question regarding java mapping. What I would like to do is to re-use an existing message mapping from within java mapping.
    Technicaly, message mapping is perfomed by com.sap.aii.mappingtool.tf3.AMappingProgram.execute, right? I would like to call that mapping program for a specifc message mapping from within my java mapping.
    Pseudo java code would look like this:
    public void execute(InputStream in, OutputStream out)
      throws StreamTransformationException {
    com.sap.aii.mappingtool.tf3.AMappingProgram.execute(in,out,'SomeMessageMapping');
    SomeMessageMapping is a message mapping that is defined in the integration repository.
    Is it possible? If so, could you provide me with some details?
    Thank you and best regards,
    Wolfgang

    Hi Wolfgang,
    very interesting idea?
    I would activa a dummy message mapping. than I would have a look in the file directory of the java-stack and try to find out the name of the *.class or *.jar file.
    On the other hand you could generate a tpz-transport-file an unpack this file, to explore the name of the *.class or *.jar
    Unfortunately I do not have access to the file system. So I can't explore the name.
    Regards Mario

  • Using unix in java

    Im trying to use this within a java app however I get the following error
    String cmdCreate[] = {"cd", "test"};
    Runtime.getRuntime().exec(cmdCreate);
    java.io.IOException: cd not found
         at java.lang.UNIXProcess.create(UNIXProcess.java)
         at java.lang.Runtime.execInternal(Native Method)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at a5.Test3.main(Test3.java:19)
    How can I fix this

    The Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it. The class Process provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process.
    The Runtime.exec methods may not work well for special processes on certain native platforms, such as native windowing processes, daemon processes, Win16/DOS processes on Win32, or shell scripts. The created subprocess does not have its own terminal or console. All its standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock. ..... etc....
    .....

  • Is there a way to run IDS within Websphere to recieve messages through JMS, then invoke Documaker?  Configuring the IDS client to use JMS within websphere seems pretty straight forward, but I cannot find information on running IDS as a server to invoke Do

    Looking to move the maintenance of our IDS instances which drive Documaker MRLs from the Unix command line to within a container ( Websphere ).  Using the IDS Java client with JMS is pretty easy.  I cannot see how I would be able to get an IDS server running within Websphere.

    IDS is not designed to run in WebSphere or any other J2EE container. It is a standalone Java application that uses native code, allows to run custom code, reads and writes files on disk, starts other processes, etc. and as such is not exactly suitable to run in J2EE. Most of such actions are not enabled (at least by default) in J2EE due to security concerns. You could run it as a service on Windows or setup to start automatically on Unix.
    What exactly do you want to achieve by it being in J2EE container? Perhaps there are other ways to do the same thing?

  • Should I use a separate JAVA instance for ADS

    My customer has Enterprise portal and R/3 installed already.  Now they want ADS installed.  Would it be best to install a new JAVA instance for ADS or should I use the existing JAVA instance that is installed for the portal?  I think the customer is preferring to use a separate instance so nothing already installed breaks.  Also, if I do use a separate JAVA instance, should I connect to the portal through SLD?
    Thanks,
    Peggy

    Hello,
    Installation of new java instance for ADS (or) using the one available inthe portal java instance depends on the following factors:-
    1) How much extra load can the existing java instance handle
    2) What is the user case and expected load for ADS in the customer landscape?
    3) Whether ADS will be used exclusively for portal ?
    Following link may give you a better idea of whether to use ADS within applicaiton portal (or) use standalone ADS
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0ce3d21-cb09-2e10-36b0-e4c8167389f6?quicklink=index&overridelayout=true
    Rgds,
    Mat.

  • How can I write and read the LPT within JAVA?

    Hello!
    I'm new to JAVA.
    I made a simple JAVA application with few buttons and labels with NetBeans.
    I add ActionListener to button but don't know to write the handling code that should to write a byt to the DATA register in the LPT port of the PC box.
    From where can I get the code for this, maybe within JDK documentation?
    Any advices will be appreciated!
    Regards, csPaul

    I have ever programmed an LPT data sender using VB.net and inpout32.dll(will be very easy to search using google). for Java, try this:
    http://www.geocities.com/Juanga69/parport/
    I've just download the sample also, wanna try to...
    And some people say that JNI allow us to embedd C++ code within our Java program.. I don't know about this yet...

  • Using a Compiled Java Class --- Error

    Hi All,
    I am new to jsp tech. I am using 'Sun Java system application web server'.
    I am getting following error when running ch06_02.jsp :
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    Generated servlet error:
    [javac] /nfs/bxslnx/home/bxs/install/SUNWappserver/domains/domain1/generated/jsp/j2ee-modules/__default-web-module-server/org/apache/jsp/jsp/Examples/ch06/ch06_005f02_jsp.java:6: '.' expected
    [javac] import ch06_01;
    [javac] ^
    [javac] 1 error
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:88)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:337)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:429)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:489)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:468)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:516)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:307)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         sun.reflect.GeneratedMethodAccessor74.invoke(Unknown Source)
         sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         java.lang.reflect.Method.invoke(Method.java:585)
         org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         java.security.AccessController.doPrivileged(Native Method)
         javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
    note The full stack trace of the root cause is available in the Sun-Java-System/Application-Server logs.
    My two files are :
    ch06_01.java
    public class ch06_01
    public ch06_01()
    public String msg()
    return "Hello from JSP!";
    ch06_02.jsp
    <%@page import="ch06_01" %>
    <HTML>
    <HEAD>
    <TITLE>Using a JavaBean</TITLE>
    </HEAD>
    <BODY>
    <H1>Using a JavaBean</H1>
    <% ch06_01 messager = new ch06_01(); %>
    The message is: <%= messager.msg() %>
    </BODY>
    </HTML>
    Please help me ....... I don't know whats going wrong . I m using Suse OS.
    Thanks
    Basant

    Hi
    You have to place the xml parsing library inside the lib directory under the WTK.
    Mihai

  • Want to Generate custom logs with Log4J within Java Embedding activity

    Hi Gurus,
    i want to Generate custom logs with Log4J within Java Embedding activity. For that i have performed some steps, but the log file has not been created.
    ServerSide Configuration:
    *===============*
    1. I have copied the log4j-1.2.15.jar file to the "oracle.soa.ext_11.1.1" location and recreate the oracle.soa.ext.jar file using an-script, which appends the log4j.jar file to the classpath.( That was created successfully)
    2. Specify a File location in log4j.xml for creating the log file. (e.g. (<middleware_home>/config/customLog.log)
    3. Then create a folder and add log4j.xml and log4j.dtd file under the folder.
    4. Modify the startManagedWeblogicServer by adding JAVA_OPTIONS="-Dlog4j.configuration=<middleware_home>/config/log4j.debug.xml”
    5. Then restart the SOA server.
    log4j.xml :
    I have used fileAppender.
    DevelopmentSide Configuration:
    *===================*
    1. Create synchronous BPEL process and Add "JAVA Embedding Activity" inbetween receiveInput and replyOutput activity.
    2.Import the log4j-1.2.15.jar to the project libs
    3.In the BPEL source code, import the Logger class.
    4.Insert the code in the JAVA Embedding Activity
    Logger logger = Logger.getLogger("CustomLog");
    logger.info("CustomeLog " + getTitle());
    Compile and deploy the project into the SOA_server and test it. Test status is completed but log is not created in the mentioned location.
    Ref: http://blog.andrade.inf.br/search/label/Log4j
    Is there any other way to achieve this requirement. Please suggest.
    Thanks in Advance,
    Sharmistha

    You can try this.
    http://veejai24.blogspot.co.uk/2008/04/simple-way-to-implement-log4j-in-your.html
    Thanks,
    Vijay

  • Some web pages causing 100% CPU use of iexplore.exe since Flash update

    I'm having a problem with certain Amazon.com pages hanging my
    Internet Explorer 6 using Flash Player 10,0,12,36, causing 100% CPU
    use for iexplore.exe and requiring me to End Task to quit. All the
    pages effected have an interactive mouseover Size and Color chart
    that intially says "Loading" but then says "Select Size and Color"
    once loaded. One mouseovers the various color patches and size
    options, each time giving item availability in that option. When
    the pages hang the IE browser with 100% CPU use that chart never
    gets to the "Select Size and Color" point, instead stuck at the
    "Loading" status. This happens most times, but not every time.
    Sometimes the pages load correctly, after a brief lag as it loads
    the chart.
    Amazon pages without this chart load fine.
    The start of this problem coincides with updating Flash.
    I can prevent the problem from happening almost every time if
    I can quickly get my cursor into that chart area while the page
    begins loading. If I allow the pages to load fully with no
    interaction they will hang almost every time.
    I have not noticed any problems on those same web pages using
    Firefox using Flash Player 9,0,124,0
    I also have not noticed any issues with other sites using
    Internet Explorer either. (YouTube, QVC, CNN...etc, all OK.)
    I had posted for assistance on the Experts Exchange site and
    there was some debate on whether the chart was a Java or
    Flash-based chart, so initially it was being approached as a
    possible Java issue, so I removed all Java versions on the system
    and installed various versions, but the same problem persists.
    I've downloaded but not run the Flash Uninstaller, as I'm
    reluctant to uninstall the Firefox Flash version without knowing
    for sure I could install 9,0,124,0 again.
    I've downloaded an archived fp9_archive.zip, which seems to
    indicate the contained files flashplayer9r124_winax.exe (Internet
    Explorer) and flashplayer9r124_win.exe (Netscape) would be versions
    9,0,124,0 to install after running the uninstaller.
    Can anyone check a few of the links below and see if the
    "Select Size and Color" chart is Flash based? If so, would
    executing the files listed above install 9,0,124,0 into my
    respective browsers again?
    http://www.amazon.com/FCS-Regular-7mm-Surf-Leash/dp/B00149XJ68
    http://www.amazon.com/Womens-Classic-Short-UGG-Boots/dp/B00064NH8W/ref=pd_ecc_rvi_cart_3
    http://www.amazon.com/Columbia-Sportswear-Womens-Benton-Springs/dp/B0006M6IQ2/ref=pd_ecc_r vi_cart_2
    http://www.amazon.com/Ladies-Chenille-Zip-Cardigan-Sweater/dp/B001E0YJ0C/ref=pd_ecc_rvi_ca rt_4
    XP IE 6 (error module : MSHTML.DLL)
    Flash Player version 10,0,12,36
    Firefox
    Flash Player version 9,0,124,0
    Thank you-
    Vickie

    I'm attempting to troubleshoot an issue with Amazon web pages
    since I've updated my Flash player. I would appreciate if someone
    could take a look at my initial post and advise if the issue seems
    to be Flash related.
    Thank you.
    I'm having a problem with certain Amazon.com pages hanging my
    Internet Explorer 6 using Flash Player 10,0,12,36, causing 100% CPU
    use for iexplore.exe and requiring me to End Task to quit. All the
    pages effected have an interactive mouseover Size and Color chart
    that intially says "Loading" but then says "Select Size and Color"
    once loaded. One mouseovers the various color patches and size
    options, each time giving item availability in that option. When
    the pages hang the IE browser with 100% CPU use that chart never
    gets to the "Select Size and Color" point, instead stuck at the
    "Loading" status. This happens most times, but not every time.
    Sometimes the pages load correctly, after a brief lag as it loads
    the chart.
    Amazon pages without this chart load fine.
    The start of this problem coincides with updating Flash.
    I can prevent the problem from happening almost every time if
    I can quickly get my cursor into that chart area while the page
    begins loading. If I allow the pages to load fully with no
    interaction they will hang almost every time.
    I have not noticed any problems on those same web pages using
    Firefox using Flash Player 9,0,124,0
    I also have not noticed any issues with other sites using
    Internet Explorer either. (YouTube, QVC, CNN...etc, all OK.)
    I had posted for assistance on the Experts Exchange site and
    there was some debate on whether the chart was a Java or
    Flash-based chart, so initially it was being approached as a
    possible Java issue, so I removed all Java versions on the system
    and installed various versions, but the same problem persists.
    I've downloaded but not run the Flash Uninstaller, as I'm
    reluctant to uninstall the Firefox Flash version without knowing
    for sure I could install 9,0,124,0 again.
    I've downloaded an archived fp9_archive.zip, which seems to
    indicate the contained files flashplayer9r124_winax.exe (Internet
    Explorer) and flashplayer9r124_win.exe (Netscape) would be versions
    9,0,124,0 to install after running the uninstaller.
    Can anyone check a few of the links below and see if the
    "Select Size and Color" chart is Flash based? If so, would
    executing the files listed above install 9,0,124,0 into my
    respective browsers again?
    http://www.amazon.com/FCS-Regular-7mm-Surf-Leash/dp/B00149XJ68
    http://www.amazon.com/Womens-Classic-Short-UGG-Boots/dp/B00064NH8W/ref=pd_ecc_rvi_cart_3
    http://www.amazon.com/Columbia-Sportswear-Womens-Benton-Springs/dp/B0006M6IQ2/ref=pd_ecc_r vi_cart_2
    http://www.amazon.com/Ladies-Chenille-Zip-Cardigan-Sweater/dp/B001E0YJ0C/ref=pd_ecc_rvi_ca rt_4
    XP IE 6 (error module : MSHTML.DLL)
    Flash Player version 10,0,12,36
    Firefox
    Flash Player version 9,0,124,0

  • How to run python within Java?

    I want to run python command within java. Not sure how to do this.
    Seems like runtime.getRuntime.exec() is something that i can use.
    but all the examples were for unix platform and not any other.
    Can i run python command using getRuntime().. please let me know
    Thanx

    I want to run python command within java.I've created a project, "Java Embedded Python" that might work for you.
    Check out http://jepp.sourceforge.net . Maybe it'll work for you...

  • How to get a handle of tcUtilityFactory within Java Task

    Hi
    I am trying to user op interface within a java task and want to avoid the GUI based coding in adapter factory
    I am having doubt about how to get a handle of tcUtilityFactory
    the standalone example of getting the handle works fine within a Java task
    // ConfigurationClient.ComplexSetting config = ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
    // final Hashtable env = config.getAllSettings();
    // ioUtilityFactory = new tcUtilityFactory(env, "xelsysadm", "welcome1");
    but I want the handle to be provided by adapter runtime env
    there is a function call within generated adapter code
    APITaskLocal.getUtilityFactory(getDataBase());
    but I get null pointer if I try to use it within custom code
    has anyone played around with APITaskLocal.getUtilityFactory

    Hi,
    Use this code.
    public void init(tcDataProvider dataProvider) {
    try {
         usrOps = (tcUserOperationsIntf)tcUtilityFactory.getUtility(dataProvider, "Thor.API.Operations.tcUserOperationsIntf");
    } catch(Exception e) {
    log.error("Unable to initialize: "+e);
    You can pass dataProvider in adapter mapping . Map it to Adapter reference->Database reference.
    Hope this will help.
    Regards
    Nitesh

  • How would i do to run scanner within java??

    i have to make a button within java
    clicking the button can start scanner
    run scanner UI!
    i find many books!
    but i don't know what to do
    do everybody have some program about that??
    thx...

    Hi,
    You can try a package named: JTwain, which is available at http://asprise.com/product/jtwain.
    JTwain supports all kinds of digital cameras and scanners. You can use Java to access, contorl digital cameras and scanners, and of course, to acquire images with flexible settings.
    The developers' guide is available @ http://asprise.com/product/jtwain/devGuide.php
    In the simplest case, one line of Java code can solve your problem.
    Good luck!

Maybe you are looking for

  • Open button in App World

    Why is there no open button in app worls, if I already installed an app and visit it's description page. It would be really nice to not only see the "delete"-button but also be able to quickly start the app instead of having to search for the app in

  • When I plug in my new iPad, iPhoto launches instead of iTunes.  How can I get iTunes to launch rather that iPhoto?

    I have recently purchased an iPad.  When I plug it in, iPhoto launches rather than iTunes.  I would like iTunes to open when I plug in.  Thoughts?

  • SAP:E:000:Table 'T100 ' does not contain an entry for ' 000'?

    Gurus, when user is updating size grid in matl master, the third party legacy system is reciving the bwlow error: SAP:E:000:Table 'T100 ' does not contain an entry for ' 000' could u all pls advise as why this error occured? Thanks in advance..

  • HELP with object carousel

    Hi, I need some help with the use of the DSM-CC object carousel. In my Xlet, I need to read a file (previsioni.TXT), that is in the package testo; this is the structure of my folder: \\mio; the first package \\ MyXlet.java \\ testo; package with the

  • Where is the Chroma Key Effect?

    Hey guys I search for the Chroma Key Effect in Premiere pro cc but i can´t find it under the point keying. The question is why and where ist it?