You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Stefan Arentz <st...@soze.com> on 2000/04/12 22:06:26 UTC

problem with JARing an EJB

I'm using Ant to build an EJB and I have a weird problem with
the layout of the JAR file which confuses the app server.

Ant builds this directory structure:

.../deploy.home:
  drwxr-xr-x   2 stefan   stefan       4096 Apr 12 21:58 META-INF/
    -rw-r--r--   1 stefan   stefan       1614 Apr 12 21:58 ejb-inprise.xml
    -rw-r--r--   1 stefan   stefan       1536 Apr 12 21:58 ejb-jar.xml
  drwxr-xr-x   2 stefan   stefan       4096 Apr 12 21:58 cmp/
    -rw-r--r--   1 stefan   stefan        503 Apr 12 21:58 Customer.class
    -rw-r--r--   1 stefan   stefan       1940 Apr 12 21:58 CustomerBean.class
    -rw-r--r--   1 stefan   stefan        626 Apr 12 21:58 CustomerHome.class
    -rw-r--r--   1 stefan   stefan        459 Apr 12 21:58 CustomerPK.class

However the jar file looks like this:

     0 Wed Apr 12 21:58:18 CEST 2000 META-INF/
    22 Wed Apr 12 21:58:18 CEST 2000 META-INF/MANIFEST.MF
     0 Wed Apr 12 21:58:18 CEST 2000 cmp/
  1536 Wed Apr 12 21:58:18 CEST 2000 META-INF/ejb-jar.xml
  1614 Wed Apr 12 21:58:18 CEST 2000 META-INF/ejb-inprise.xml
   503 Wed Apr 12 21:58:18 CEST 2000 cmp/Customer.class
  1940 Wed Apr 12 21:58:18 CEST 2000 cmp/CustomerBean.class
   626 Wed Apr 12 21:58:18 CEST 2000 cmp/CustomerHome.class
   459 Wed Apr 12 21:58:18 CEST 2000 cmp/CustomerPK.class

The META-INF/ en cmp/ entries seem to be a problem. Has anyone run into
this problem?

  Stefan



Re: problem with JARing an EJB

Posted by Stefan Arentz <st...@soze.com>.
On Thu, Apr 13, 2000 at 10:28:56AM -0700, Michael McCune wrote:
> So is the Customer EJB in the "cmp" package?  I use ant to build EJB jar
> files as well (for weblogic) and had to do some trickery to maintain the
> package structure.
> 
> If the Customer EJB is in the cmp package, (similar situation that I have as
> well), you need to make sure that your JAR file mimics this package
> structure, with the Customer*.class files being in the cmp directory.
> 
> I guess my question would be, what do you want your Jar file to look like?
> The first case you describe, or the second?

I want to get rid of the empty META-INF directories because it confuses
Sun's J2EE reference implementation.

But there are more poblems, I also work with Inprise, and that needs some
other tools (java2iip) to be run in the build proces. I'll dive into this
and see if I can write some code for Ant to support this.

Ant has a lot of potential. It does most of what my Perl based scripts
do ...  see http://www.sateh.com/stuff/RandomizerApp.txt for an example
of my 'configuration' for a simple bean. This is used to compile the
bean sources, create the correct deploymnt xml files and jar the whole
thing into a .war of .jar.

  Stefan


RE: problem with JARing an EJB

Posted by Michael McCune <mc...@pop.peoplescape.com>.
So is the Customer EJB in the "cmp" package?  I use ant to build EJB jar
files as well (for weblogic) and had to do some trickery to maintain the
package structure.

If the Customer EJB is in the cmp package, (similar situation that I have as
well), you need to make sure that your JAR file mimics this package
structure, with the Customer*.class files being in the cmp directory.

I guess my question would be, what do you want your Jar file to look like?
The first case you describe, or the second?

Mike

-----Original Message-----
From: Stefan Arentz [mailto:stefan.arentz@soze.com]
Sent: Wednesday, April 12, 2000 1:06 PM
To: ant-dev@jakarta.apache.org
Subject: problem with JARing an EJB


I'm using Ant to build an EJB and I have a weird problem with
the layout of the JAR file which confuses the app server.

Ant builds this directory structure:

.../deploy.home:
  drwxr-xr-x   2 stefan   stefan       4096 Apr 12 21:58 META-INF/
    -rw-r--r--   1 stefan   stefan       1614 Apr 12 21:58 ejb-inprise.xml
    -rw-r--r--   1 stefan   stefan       1536 Apr 12 21:58 ejb-jar.xml
  drwxr-xr-x   2 stefan   stefan       4096 Apr 12 21:58 cmp/
    -rw-r--r--   1 stefan   stefan        503 Apr 12 21:58 Customer.class
    -rw-r--r--   1 stefan   stefan       1940 Apr 12 21:58
CustomerBean.class
    -rw-r--r--   1 stefan   stefan        626 Apr 12 21:58
CustomerHome.class
    -rw-r--r--   1 stefan   stefan        459 Apr 12 21:58 CustomerPK.class

However the jar file looks like this:

     0 Wed Apr 12 21:58:18 CEST 2000 META-INF/
    22 Wed Apr 12 21:58:18 CEST 2000 META-INF/MANIFEST.MF
     0 Wed Apr 12 21:58:18 CEST 2000 cmp/
  1536 Wed Apr 12 21:58:18 CEST 2000 META-INF/ejb-jar.xml
  1614 Wed Apr 12 21:58:18 CEST 2000 META-INF/ejb-inprise.xml
   503 Wed Apr 12 21:58:18 CEST 2000 cmp/Customer.class
  1940 Wed Apr 12 21:58:18 CEST 2000 cmp/CustomerBean.class
   626 Wed Apr 12 21:58:18 CEST 2000 cmp/CustomerHome.class
   459 Wed Apr 12 21:58:18 CEST 2000 cmp/CustomerPK.class

The META-INF/ en cmp/ entries seem to be a problem. Has anyone run into
this problem?

  Stefan




RE: problem with JARing an EJB

Posted by Conor MacNeill <co...@ebinteractive.com.au>.
>
> The META-INF/ en cmp/ entries seem to be a problem. Has anyone run into
> this problem?
>

How are these entries causing a problem? I too build EJB jars with Ant. The
jars have these types of entries (directories) but they deploy without any
problems. What exactly happens?

Cheers
Conor