Magazine
 
EJB 3.0

<!— Create the jar File —>
<target name=”buildJar” depends=”init”>
<copy todir=”${jarDir}”>
<fileset dir=”${classdir}”
includes=”**/*.class” />
</copy>
<copy todir=”${jarDir}/META-INF”>
<fileset
dir=”${deploymentdescription}/jar/”
includes=”ejb-jar.xml,weblogic-cmp-rdbmsjar.
xml,weblogic-ejb-jar.xml” />
</copy>
<!— Create jar file and place in ear
directory —>
<jar jarfile=”${earDir}/${jarFile}”
basedir=”${jarDir}” />
</target>
<!— Create the ear File —>
<target name=”buildEar” depends=”init”>
<copy todir=”${earDir}/META-INF”>
<fileset
dir=”${deploymentdescription}/ear”
includes=”application.xml” />
</copy>
<!— Create ear file and place in ear
directory —>
<jar jarfile=”../${earFile}”
basedir=”${earDir}” />
<copy todir=”C:/jboss-4.2.0.GA/server/
default/deploy/”>
<fileset dir=”../”
includes=”${earFile}” />
</copy>
</target>
</project>

Put this file in the base (stateless\code) directory.

application.xml

<?xml version=”1.0" encoding=”UTF-8"?>
<application xmlns=”http://java.sun.com/xml/
ns/javaee” xmlns:xsi=”http://www.w3.org/
2001/XMLSchema-instance” version=”5"
xsi:schemaLocation=”http://java.sun.com/
xml/ns/javaee http://java.sun.com/xml/ns/
javaee/application_5.xsd”>
<display-name>Stateless Session Bean
Example</display-name>
<module>
<web>
 
<web-uri>example.war</web-uri>
<context-root>/example</context-root>
</web>
</module>
<module>
<ejb>example.jar</ejb>
</module>
</application>

Put this file in the
Stateless\code\deploymentdescriptors\ear directory.

web.xml

<?xml version=”1.0" encoding=”UTF-8"?>
<!DOCTYPE web-app PUBLIC “-//Sun
Microsystems, Inc.//DTD Web Application 2.3/
/EN” “http://java.sun.com/dtd/webapp_
2_3.dtd”>
<web-app >
</web-app>

Put this file in the
Stateless\code\deploymentdescriptors\web
directory.

Put all .jsp files in the Stateless\code\web
directory.

Put all .java files in the Stateless\code\src directory.

(iii)Start command prompt, and go to the Stateless\code directory. Then type the command as:

C:\Stateless\code>ant build.xml
The Ant tool will deploy the example.ear file
to the jboss-
4.2.0.GA\server\default\deploy directory.
4. Running the example application Web
Client

Open the web browser and type the following URL to run the application:

     
Jan 2008 | Java Jazz Up | 21
 
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