You need to start the build from the directory that contains the build.xml file. If the file is in some other directory, you need to specify where that file is, like "ant -f path/to/file/build.xml".
cd to the directory that as the src and build directories. There should be a build.xml and build.properties file. run asant build in that same directory. Example would be c:/javatutorial/jaxrpc/helloservice. The build xml file would be in the helloservice directory.
public class ConverterBean implements SessionBean { BigDecimal yenRate = new BigDecimal("121.6000"); BigDecimal euroRate = new BigDecimal("0.0077"); public BigDecimal dollarToYen(BigDecimal dollars) { BigDecimal result = dollars.multiply(yenRate); return result.setScale(2,BigDecimal.ROUND_UP); } public BigDecimal yenToEuro(BigDecimal yen) { BigDecimal result = yen.multiply(euroRate); return result.setScale(2,BigDecimal.ROUND_UP); } public ConverterBean(){} public void ejbCreate(){} public void ejbRemove(){} public void ejbActivate(){} public void ejbPassivate(){} public void setSessionContext(SessionContext sc){} }
// build.xml
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE project [ <!ENTITY include SYSTEM "../../../../common-ant.xml"> ]>
<!-- Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. -->
<!-- ======================================================= --> <!-- Sun Java System Application Server Sample Application build xml --> <!-- ======================================================= -->
This build.xml is written by me . I don't know how to write build.xml I tried to write this(build.xml) by reading ant documentation and by seeing other build.xml
now I tried to complile all source files following error occurs
D:\Sun\AppServer\samples\ejb\converter>asant build Buildfile: build.xml D:\Sun\common-ant.xml could not be found