wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes New to EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "New to EJB" Watch "New to EJB" New topic

New to EJB

smitha verghese
Ranch Hand

Joined: Jun 21, 2003
Posts: 42
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
which has 2 folders
1 build
2 dist
3 src
4 build.xml
3.In src folder
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
C:\first\src\com\smitha\Hello\ejb\META-INF folder

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}"/>

<path id="classpath_id">
<pathelement location="${build.classes.dir}"/>
<fileset dir="${common.lib.dir}">
<include name="*.jar"/>
<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 name="init" depends="banner">
<echo message="========================================="/>
<echo message=" Preparing ${ant.project.name} "/>
<echo message="========================================="/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}"/>
<property name="classpath" refId="classpath_id"/>
<echo message="Using Classpath: ${classpath}" />

<!-- Hello start -->
<target name="hw-compile" depends="init">
<echo message="========================================="/>
<echo message=" Compiling ${ant.project.name} files "/>
<echo message="========================================="/>
<javac srcdir="${source.dir}"

<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"/>
<echo message="hw-hello-client-jar done"/>

<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}"
<weblogic destdir="${dist.dir}"
<support dir="${build.classes.dir}">
<include name="**/Hello/*.class"/>
<include name="**/Hello/ejb/*.class"/>
<include name="**/ejb-jar.xml"/>
<exclude name="**/weblogic-ejb-jar.xml"/>
<!-- Hello end -->
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
Smitha, it's alot easier to help when you say what the error is. Presumably ant says something is wrong. What does it say?

I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
It is sorta covered in the JavaRanch Style Guide.
subject: New to EJB