You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jeff Davies <JD...@Ceon.com> on 2000/12/20 01:09:52 UTC
ejbjar does not include non-bean files
Hi all!
I'm having a small problem building EJBs for Weblogic 5.1. For most of my
beans, Ant build the JAR files just fine. However, the problem I have has to
do with the inclusion of "utility" classes for the EJB. I have 2 directories
of files that need to go into my JAR file. They are in the following package
structure
com.acme.*
com.acme.utility.*
When I invoke the ejbjar task, it does a great job finding all of the EBJ
classes in the com.acme package, but it does not add the utility files (i.e.
non-ejb type files) in the com.acme.utility path to the JAR file.
I suspect that the problem isn't the nested directory, but the fact that
EJBJAR is reading the ejb-jar.xml file to figure out which .class files to
include in the JAR. Does anyone know a way around this, or am I doing
something wrong?
- Jeff Davies
Raving Ant lover!
Re: ejbjar does not include non-bean files
Posted by Conor MacNeill <co...@cognet.com.au>.
Jeff,
ejbjar does not include the support files by design. Whether that is right
or wrong, I'm not sure. I have always had a problem with support files. If
you go jar per bean but your support files are used by more than one bean,
what do you do? If you put it in each jar, well the potential classloader
conflicts scare me a little.
Dropping down to a weblogic specific level, I am pretty sure that weblogic
says something about support files, such as they are not supported by
hotdeploy. When I tried to package support classes under 4.51 I got a lot
of ClassNotFoundErrors. We have settled on building our ejb code into a jar
file which is deployed as a separate jar. We then package all the beans up,
one bean per jar. It may not be exactly what the EJB spec says, but it
works for now. We may revisit that but not in a hurry.
OK, so that is my particular situation and your's is no doubt different. If
you wanted to include additional class files into the jar, it would be
possible to add a <support-classes> nested element to select the support
classes with appropriate include / exclude classes. What do you think ?
Conor
----- Original Message -----
From: "Jeff Davies" <JD...@Ceon.com>
To: <an...@jakarta.apache.org>
Sent: Wednesday, December 20, 2000 11:09 AM
Subject: ejbjar does not include non-bean files
> Hi all!
> I'm having a small problem building EJBs for Weblogic 5.1. For most of
my
> beans, Ant build the JAR files just fine. However, the problem I have has
to
> do with the inclusion of "utility" classes for the EJB. I have 2
directories
> of files that need to go into my JAR file. They are in the following
package
> structure
>
> com.acme.*
> com.acme.utility.*
>
> When I invoke the ejbjar task, it does a great job finding all of the EBJ
> classes in the com.acme package, but it does not add the utility files
(i.e.
> non-ejb type files) in the com.acme.utility path to the JAR file.
>
> I suspect that the problem isn't the nested directory, but the fact that
> EJBJAR is reading the ejb-jar.xml file to figure out which .class files
to
> include in the JAR. Does anyone know a way around this, or am I doing
> something wrong?
>
> - Jeff Davies
> Raving Ant lover!
RE: ejbjar does not include non-bean files
Posted by Sylvain Rey <ra...@bluedot.com>.
> Hi all!
> I'm having a small problem building EJBs for Weblogic 5.1. For
> most of my
> beans, Ant build the JAR files just fine. However, the problem I
> have has to
> do with the inclusion of "utility" classes for the EJB. I have 2
> directories
> of files that need to go into my JAR file. They are in the
> following package
> structure
>
> com.acme.*
> com.acme.utility.*
>
> When I invoke the ejbjar task, it does a great job finding all of the EBJ
> classes in the com.acme package, but it does not add the utility
> files (i.e.
> non-ejb type files) in the com.acme.utility path to the JAR file.
>
> I suspect that the problem isn't the nested directory, but the fact that
> EJBJAR is reading the ejb-jar.xml file to figure out which .class files to
> include in the JAR. Does anyone know a way around this, or am I doing
> something wrong?
I've ran into the same problem a few days ago and I've finally decided to
include the lacking files by updating the classes using the jar command.
Note that you can't use the jar task of ant as it doesn't know how to update
a jar (btw, thanks to Diane for explaining me this point). You will have to
use exec on the jar command.
If there is another way to achieve that, I would be very happy to know it !
Sylvain