Daniel,
Looks like there's one more, at undeploy time. Again the file deletion
issue. Somehow Windows is still using those files. Do you keep other
references to them (I couldn't find any)?
One more suggested modification:
IN J2eeDeployer.java
(uninstallApplication method)
-----------------------------------------------------------------
void uninstallApplication (String _name) throws IOException
{
log.log ("destroying application " + _name);
URL url = null;
try
{
url = new URL (DEPLOYMENT_DIR.toURL (), _name);
try {
URLWizzard.deleteTree (url);
log.log ("file tree "+url.toString ()+" deleted.");
} catch (Exception _e) {
log.log ("Could not delete file tree " + url + "...");
}
} catch (MalformedURLException _mfe) { // should never happen
} catch (IOException _ioe) {
throw _ioe;
}
}
...or something like that (if you don't like nested try's, just join them).
Cheers,
Hugo
----- Original Message -----
From: "Hugo Jos� Pinto" <[EMAIL PROTECTED]>
To: "jBoss Developer" <[EMAIL PROTECTED]>
Sent: Friday, November 03, 2000 1:29 AM
Subject: Re: [jBoss-Dev] J2eeDeployer ...ready to go?
> 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!
> >
>
>