ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Blanc <Sebastien.Bl...@alcatel.com>
Subject Re: putting multiple ejb in a jar
Date Fri, 21 Feb 2003 18:08:54 GMT
HI Modha!

putting multiple ejbs in one jar would not differ than putting one as far as the
build.xml is concerned (use *smthg):
<target name="jar" depends="compile">
      <manifest file="${thispkg.dir}/META-INF/MANIFEST.MF" mode="update">
  <attribute name="Class-Path" value="global-jar-tl1-types.jar
global-jar-gem-types.jar ejb-jar-event-ps.jar"/>
      </manifest>
      <jar jarfile="${jar.path}" manifest="${thispkg.dir}/META-INF/MANIFEST.MF">

        <!-- all classes and all META-INF (including the MANIFEST.MF that
contains the corba types) -->
 <fileset dir="${thispkg.dir}" includes="**/**"/>
      </jar>

having multiple session beans would also just mean having multiple <session >
tags in ur ejb-jar.xml and multiple <entity> tags in ur jboss.xml. if u have
trouble getting started I however guess u have a deployment GUI that will help u
into this (define a jar and then add the beans into it). u may want to look at
xdoclet that does a very nice job for u:
http://xdoclet.sourceforge.net/
i.e. it allows u not worry about creating these ejb-jar and jboss descriptor
files.

u may also want to check the SUN mailing list for samples.

seb.


Modha Kumar wrote:

> Thanks for the info, I will now focus on which beans to put together.
> Actually I am looking for a sample ejb-jar.xml jboss.xml build.xml
> in case of using multiple session beans.
> This will greatly help me in understanding the deployment files. There are
> examples for these files all over the net which i used to learn in case of
> single
> session bean and making a jar out of it, however i
> could not find one's that use multiple ejbs.
> Thanks
> Modha/-
>
> -----Original Message-----
> From: Sebastien Blanc [mailto:Sebastien.Blanc@alcatel.com]
> Sent: Thursday, February 20, 2003 5:43 PM
> To: Ant Users List
> Subject: Re: putting multiple ejb in a jar
>
> I'd say u do as u like to:
> first ask urself if u wanna put these ejbs in the same jar or not. most of
> the
> time u try to group ur EJBs per functionalities, otherwise u'll have to make
> ejb-refs all over the place everytime u want to access a bean B from a bean
> A.
> also it depends how u wanna distribute ur application: if u want a certain
> functionality to be able to run in a separate server than the others (becoz
> of
> load & perfs for instance) then u may want to put them in a seperate jar.
> then there are few constraints on the EJB packaging itself that may lead u
> to
> ur choice. u may want to have a look at the 2 following pointers. pbs with
> dependencies may drive u to either lower dependencies or manage them (which
> is
> not always easy)
>
>  http://www.onjava.com/lpt/a/onjava/2001/06/26/ejb.html
>
> ftp://vadd1:yb29hmib@207.25.253.53/1/wsdd/pdf/gisell/UnderstandingWebSphereC
> lassLoaders.pdf
>
> as far as build.xml is concerned the way I work is that I have xdoclet
> generating all the descriptors in one directory (in ur case u use ANT but
> does
> not matter), all the bean classes in another one (could be the same as the
> previous one), and I re-use the task for all functional packages for which I
> need a jar with the XML import capacity.
>
> i.e. think it's really up to u, but at least I wdn't put one bean per jar.
>
> hope this will help.
>
> seb.
>
> Modha Kumar wrote:
>
> > Hi
> > I have a couple of session ejb's.
> >
> > when i had only one i used to use this to generate jar
> >
> > <target name="ejb-jar" depends="compile">
> >         <delete dir="${build.fnol.dir}/META-INF"/>
> >         <mkdir dir="${build.fnol.dir}/META-INF"/>
> >         <copy file="${src.dir}/com/a/b/server/ejb-jar.xml"
> > todir="${build.fnol.dir}/META-INF" />
> >         <copy file="${src.dir}/com/a/b/server/jboss.xml"
> > todir="${build.fnol.dir}/META-INF" />
> >         <jar jarfile="${build.fnol.dir}/commandserver.jar">
> >             <fileset dir="${build.classes.dir}">
> >                          <include
> name="com/a/b/server/CommandServer.class"
> > />
> >                        <include
> > name="com/a/b/server/CommandServerBean.class" />
> >                        <include
> > name="com/a/b/server/CommandServerHome.class" />
> >                          <include
> > name="com/a/b/exceptions/CommandException.class" />
> >                          <include
> name="com/a/b/commandbeans/Command.class"
> > />
> >                          <include
> > name="com/a/b/commandbeans/SearchPoliciesCommand.class" />
> >             </fileset>
> >             <fileset dir="${build.fnol.dir}">
> >                 <include name="META-INF/ejb-jar.xml" />
> >                 <include name="META-INF/jboss.xml" />
> >             </fileset>
> >         </jar>
> >     </target>
> >
> > now i need to put 2 ejb's and this number will grow
> > how do i manage build file
> > 1. Do i create a new target for each session bean and create a new jar
> > 2. Is there a better way.
> >
> > If you can please point me to any documentation that will be good too.
> > Thanks
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message