Magazine
 

EJB 3.0

1. JDK 1.5 or Higher
2. apache-ant-1.7.0
3. JBoss 4.2.1

Do the following steps to deploy the calculator application:

(i) Make a directory structure. You can Click here to extract the readymade directory structure according to this tutorial.

(ii)Create the essential deployment descriptor .xml files.

build.xml

<?xml version=”1.0"?>
<project name=”Jboss Tutorials” default=”all”
basedir=”.”>
<target name=”init”>
<!— Define —>
<property name=”dirs.base”
value=”${basedir}”/>
<property name=”classdir”
value=”${dirs.base}/build/classes”/>
<property name=”src” value=”${dirs.base}/
src”/>
<property name=”web”
value=”${dirs.base}/web”/>
<property
name=”deploymentdescription”
value=”${dirs.base}/deploymentdescriptors”/
>
<property name=”warFile”
value=”example.war”/>
<property name=”earFile”
value=”example.ear”/>
<property name=”jarFile”
value=”example.jar”/>
<property name=”earDir”
value=”${dirs.base}/build/ear”/>
<property name=”warDir”
value=”${dirs.base}/build/war”/>
<property name=”jarDir”
value=”${dirs.base}/build/jar”/>
<!— classpath for Project —>
<path id=”library.classpath”>
<pathelement path =”libext/servletapi.

 
servletapi.
jar”/>
<pathelement path =”libext/ejb3-
persistence.jar”/>
<pathelement path =”libext/javaee.jar”/
>
<pathelement path =”${classpath}”/>
</path>
<!— Create Web-inf and classes
directories —>
<mkdir dir=”${warDir}/WEB-INF”/>
<mkdir dir=”${warDir}/WEB-INF/
classes”/>
<!— Create Meta-inf and classes
directories —>
<mkdir dir=”${earDir}/META-INF”/>
<mkdir dir=”${jarDir}/META-INF”/>
<mkdir dir=”${classdir}”/>
</target>
<!— Main target —>
<target name=”all”
depends=”init,build,buildWar,buildJar,buildEar”/
>
<!— Compile Java Files and store in /build/
src directory —>
<target name=”build” >
<javac srcdir=”${src}”
destdir=”${classdir}” debug=”true”
includes=”**/*.java” >
<classpath refid=”library.classpath”/>
</javac>
</target>
<!— Create the web archive File —>
<target name=”buildWar” depends=”init”>
<copy todir=”${warDir}/WEB-INF/
classes”>
<fileset dir=”${classdir}”
includes=”**/*.class” />
</copy>
<copy todir=”${warDir}/WEB-INF”>
<fileset
dir=”${deploymentdescription}/web/”
includes=”web.xml” />
</copy>
<copy todir=”${warDir}”>
<fileset dir=”${web}” includes=”**/
*.*” />
</copy>
<!— Create war file and place in ear
directory —> <jar jarfile=”${earDir}/
${warFile}” basedir=”${warDir}” />
</target>

 

Jan 2008 | Java Jazz Up | 20
 
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 , 77 , 78 , 79 , 80 , 81 , 82 ,

83, 84 , 85 , 86, 87 , 88, 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 , 99 , 100 , 101 , 102 , 103, 104 , 105 ,

106, 107,

Download PDF