Daniel,

    I found two (not so big) bugs in the new J2eeDeployer,

    There are a couple of tricks when you try to delete the temporary
copyxxx.zip file that won't allow the file to be properly deleted in my NT
box. As a result, the deployment fails as a whole - and it shoudn't, I
guess: I'd rather have an undeleted file in my tmp dir than an undeployed
(and unbooted) application.

    Also, you do for loops with "++i" increments instead of "i++" in both
J2eeDeployer.java and URLWizzard.java, witch is bad coz you end up bypassing
some array items.

    Here are some suggested modifications:

IN J2eeDeployer.java:
(around line 359, installApplication (), for loop)
----------------------------------------------------------------------------
---

      for (int i = 0; i < files.length && root == null; i++)
      {
         try {
            java.io.InputStream inps = cl.getResourceAsStream (files[i]);
            root = XmlFileLoader.getDocument (inps).getDocumentElement ();
            inps.close();
            inps = null;
         } catch (Exception _e) {}
      }

      // dont need it anymore...
      cl = null;
      try {
        URLWizzard.deleteTree(localCopy);
      }  catch (Exception _e) {
          log.log ("Could not delete local copy file...");
      }

----------------------------------------------------------------------------
-------------

AND

IN URLWizzard.java:
(method delete() )
----------------------------------------------------------------------------
---
   /** deletes a file recursively */
   private static boolean delete (File _f) throws IOException
   {
      if (_f.exists ())
      {
         if (_f.isDirectory ())
         {
            File[] files = _f.listFiles ();
            for (int i = 0, l = files.length; i < l; i++)
               if (!delete (files[i]))
               return false;
         }
         return _f.delete ();
      }
      return true;
   }

------------------

That's pretty much it.

Kind regards,

Hugo Jos� Pinto


----- Original Message -----
From: "Daniel Schulze" <[EMAIL PROTECTED]>
To: "jBoss Developer" <[EMAIL PROTECTED]>
Sent: Friday, November 03, 2000 12:47 AM
Subject: [jBoss-Dev] J2eeDeployer ...ready to go


> Folks,
>
> I did it.
> The J2eeDeployer is in cvs. Check it out, test it.
>
> The J2EEDeployer is now used by the AutoDeployer so you can drop your
> stuff just in the /deply directory and ...ta tahh
>
> Right now I m working on a docu...
>
> \Daniel
>
>
> PS: Please comment and/or report bugs/trouble!
>


Reply via email to