geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <>
Subject Re: Problem with DeploymentContext
Date Fri, 02 Apr 2004 17:21:16 GMT
Just to clarify, this is the code that is using addStreamInclude (in 
the last if block)...

     protected XmlObject generateClassPath(URI configID, JarInputStream 
jarInputStream, DeploymentContext context) throws DeploymentException {
         URI moduleBase = URI.create(configID.toString() + "/");
         XmlObject j2eeDoc = null;
         try {
             for (JarEntry entry; (entry = 
jarInputStream.getNextJarEntry()) != null; jarInputStream.closeEntry()) 
                 String name = entry.getName();
                 if (name.endsWith("/")) {
                 if (name.equals("META-INF/ra.xml")) {
                     j2eeDoc = getConnectorDocument(jarInputStream);
                 if (name.endsWith(".jar")) {
                     URI uri = moduleBase.resolve(name);
                     context.addStreamInclude(uri, jarInputStream);

It looks like the .rar file contains several .jar files, which need to 
be added to the class path.  This is a bit different from an ejb-jar 
where we want just the outer jar added to the class path, but I 
actually think this is what we want for ejb-jars.  What I plan on doing 
is to construct a car file that contains just two entries 
META-INF/config.ser and ejb.jar (at the root level).

Any objections?


  * Dain Sundstrom
  * Partner
  * Core Developers Network

On Apr 1, 2004, at 6:00 PM, David Jencks wrote:

> yes, I had this problem also. I wrote 
> DeploymentContext.addStreamInclude to deal with it.  I'd be happy if 
> you found a better way, but I didn't.
> david jencks
> On Thursday, April 1, 2004, at 03:07 PM, Dain Sundstrom wrote:
>> Jeremy and David J,
>> I think I might have run into a structural problem with 
>> DeploymentContext while writing the EJB deployer.  If you take a look 
>> at EJBConfigBuilder in the openejb cvs, you will see it follows the 
>> structure of the war deployer.  I ran into a problem while attempting 
>> to write a test for buildConfiguration(File, JarInputStream, 
>> XmlObject) method.  This method starts by coping the file contents 
>> from the JarInputStream to the output file, and then builds the EJB 
>> configuration.  To build the EJB configuration I need to load and 
>> inspect the EJB classes, and this is a problem because the output jar 
>> file doesn't seem to be on the classpath of the DeploymentContext (we 
>> get the classpath from the context on line 222).
>> Any idea on how to get around this?
>> -dain
>> /*************************
>>  * Dain Sundstrom
>>  * Partner
>>  * Core Developers Network
>>  *************************/

View raw message