• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

New to EJB

 
smitha verghese
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I am new to ejb, i am using ant to deploy my bean into weblogic container, but i get some error when i try to execute
ant all
since some tags in build.xml has to b changed.
But i am unaware of how to change.
Kindly help me.
the folder i have kept my files is
C:\first
which has 2 folders
1 build
2 dist
3 src
4 build.xml
3.In src folder
3.a
C:\first\src\com\smitha\Hello\ejb folder
where i have kept my beans
Hello.java - Remote Interface
HelloBean.java - Bean
HelloHome.java - Home Interface
3.b
C:\first\src\com\smitha\Hello\ejb\META-INF folder
ejb-jar.xml
weblogic-ejb-jar.xml

4.build.xml
has the following

<project name="first" default="all" basedir=".">
<property name="hw.ejb.dir" value="${basedir}/src/com/smitha/Hello"/>
<property name="hw.dir" value="${basedir}/src/com/smitha/Hello"/>

<!-- Hello start -->
<property name="Hello.ejbjar.name" value="SSP_DS_Hello"/>
<property name="Hello.descriptor.dir" value="${hw.ejb.dir}/ejb/META-INF"/>
<property name="Hello.client.dir" value="${hw.dir}/Hello/client"/>
<!-- Hello end -->

<property name="ear.name" value="${ant.project.name}"/>
<property name="source.dir" value="${basedir}/src"/>
<property name="build.classes.dir" value="${basedir}/build/classes"/>
<property name="lib.dir" value="${basedir}/../../Common/lib"/>
<property name="common.lib.dir" value="${basedir}/../Common/lib"/>
<property name="common.dist.dir" value="${basedir}/../Common/dist"/>
<property name="dist.dir" value="${basedir}/dist"/>

<target name="clean">
<echo message="========================================="/>
<echo message=" Cleansing ${ant.project.name} "/>
<echo message="========================================="/>
<delete file="${dist.dir}/${Hello.ejbjar.name}.jar"/>
<delete file="${dist.dir}/${Hello.ejbjar.name}_Client.jar"/>
<delete file="${dist.dir}/${admin.ejbjar.name}.jar"/>
<delete file="${dist.dir}/${admin.ejbjar.name}_Client.jar"/>
<delete file="${dist.dir}/${ear.name}.ear"/>
<delete dir="${build.classes.dir}"/>
</target>

<path id="classpath_id">
<pathelement location="${build.classes.dir}"/>
<fileset dir="${common.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="all" depends="clean, hw-ejb-jar"/>

<target name="banner">
<echo message="========================================================== "/>
<echo message=" Lookup Build Script "/>
<echo message="========================================================== "/>
<echo message="Use 'ant' or 'ant all' rebuild the SSPLookup kit "/>
<echo message="Use 'ant clean' to clean intermediate files "/>
<echo message="Use 'ant lookup-client-jar' to rebuild Lookup EJB client files "/>
<echo message="Use 'ant client' to rebuild lookup/client files "/>
<echo message="========================================================== "/>
</target>
<target name="init" depends="banner">
<echo message="========================================="/>
<echo message=" Preparing ${ant.project.name} "/>
<echo message="========================================="/>
<tstamp/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<property name="classpath" refId="classpath_id"/>
<echo message="Using Classpath: ${classpath}" />
</target>

<!-- Hello start -->
<target name="hw-compile" depends="init">
<echo message="========================================="/>
<echo message=" Compiling ${ant.project.name} files "/>
<echo message="========================================="/>
<javac srcdir="${source.dir}"
destdir="${build.classes.dir}"
classpath="${classpath}"
includes="**/Hello/ejb/*.java,**/Hello/client/*.java"/>
</target>

<target name="hw-client-jar" depends="hw-compile">
<echo message="========================================="/>
<echo message="Packaging SSP_DS_Hello_Client.jar"/>
<echo message="========================================="/>
<jar jarfile="${dist.dir}/${Hello.ejbjar.name}_Client.jar">
<fileset dir="${build.classes.dir}">
<include name="**/*Hello.class"/>
<include name="**/*HelloHome.class"/>
</fileset>
</jar>
<echo message="hw-hello-client-jar done"/>
</target>

<target name="hw-ejb-jar" depends="hw-client-jar" >
<echo message="========================================="/>
<echo message=" Building ${ant.project.name} EJB jar "/>
<echo message="========================================="/>
<ejbjar srcdir="${build.classes.dir}"
basejarname="${Hello.ejbjar.name}"
descriptordir="${Hello.descriptor.dir}"
manifest="${Hello.descriptor.dir}/MANIFEST.MF">
<weblogic destdir="${dist.dir}"
wlclasspath="${common.lib.dir}/weblogic.jar:${common.dist.dir}/SSP_DS_Common.jar"
classpath="${classpath}"
ejbcclass="weblogic.ejbc"/>
<support dir="${build.classes.dir}">
<include name="**/Hello/*.class"/>
<include name="**/Hello/ejb/*.class"/>
</support>
<include name="**/ejb-jar.xml"/>
<exclude name="**/weblogic-ejb-jar.xml"/>
</ejbjar>
</target>
<!-- Hello end -->
</project>
 
Adam Hardy
Ranch Hand
Posts: 567
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smitha, it's alot easier to help when you say what the error is. Presumably ant says something is wrong. What does it say?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic