You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Tarun Ramakrishna <le...@gmail.com> on 2006/11/11 12:28:17 UTC

Tuscany Java M2 - unnecessary maven-plugin jars and file-lock slow down webapp deployment time.

Hi all,

A lot of un-necessary maven jars appear to get bundled with tomcat
wars. This causes the deployment to slow down quite a bit.

And for every succeeding deployment, one needs to restart the Tomcat
server - since Tuscany doesn't appear to release a lock in the
expanded war directory. The tomcat manager's undeploy function thus no
longer works correctly.

This makes the develop-debug cycle rather painful. Does anybody have
any ideas/tips on how to speed things up?

Thanks!
Tarun

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Tuscany Java M2 - unnecessary maven-plugin jars and file-lock slow down webapp deployment time.

Posted by Raymond Feng <en...@gmail.com>.
Hi,

I think it's the same problem. I used the following workaround before:

public class JarInputStream extends InputStream {

private JarFile jarFile;
private InputStream is;

public JarURLInputStream(URL url) throws IOException {
String protocol = url.getProtocol();
if (protocol != null && (protocol.equals("jar") ) {
String urlStr = url.toString();
JarURLConnection connection = (JarURLConnection) url.openConnection();
// We cannot use cache, otherwise the JAR file will be cached
connection.setUseCaches(false);
is = connection.getInputStream();
jarFile = connection.getJarFile();
} else {
is = url.openStream();
}
}
...

public void close() throws IOException {
if(is != null) is.close();
// We need to close the JAR file
if (jarFile != null) jarFile.close();
}

...
}

Thanks,
Raymond

----- Original Message ----- 
From: "Tarun Ramakrishna" <le...@gmail.com>
To: <tu...@ws.apache.org>
Sent: Monday, November 13, 2006 10:49 AM
Subject: Re: Tuscany Java M2 - unnecessary maven-plugin jars and file-lock 
slow down webapp deployment time.


> Hi Jeremy,
>
> My response comes  late - but thanks  a lot for your answers!
>
>> Are you running on Windows? This may not be an issue with the Maven
>> support but a side effect of the classloader - IIRC URLClassLoader
>> can take locks on the underlying file and not release them. I've not
>> seen any issue on OSX with deploy/undeploy cycles.
>
> I didn't know about the URLClassLoader bug.
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014. This is
> rather awful. If they atleast had a close() method, one could write
> some code for the tomcat context undeploy event.
>
> Need to think of some hack...don't have choice in our development
> platform at work at the moment.
>
> Regards,
> Tarun
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Tuscany Java M2 - unnecessary maven-plugin jars and file-lock slow down webapp deployment time.

Posted by Tarun Ramakrishna <le...@gmail.com>.
Hi Jeremy,

My response comes  late - but thanks  a lot for your answers!

> Are you running on Windows? This may not be an issue with the Maven
> support but a side effect of the classloader - IIRC URLClassLoader
> can take locks on the underlying file and not release them. I've not
> seen any issue on OSX with deploy/undeploy cycles.

I didn't know about the URLClassLoader bug.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5041014. This is
rather awful. If they atleast had a close() method, one could write
some code for the tomcat context undeploy event.

Need to think of some hack...don't have choice in our development
platform at work at the moment.

Regards,
Tarun

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org


Re: Tuscany Java M2 - unnecessary maven-plugin jars and file-lock slow down webapp deployment time.

Posted by Jeremy Boynes <jb...@apache.org>.
On Nov 11, 2006, at 3:28 AM, Tarun Ramakrishna wrote:

> Hi all,
>
> A lot of un-necessary maven jars appear to get bundled with tomcat
> wars. This causes the deployment to slow down quite a bit.

They are there to support the Maven-based ArtifactRepository that is  
included in the server configuration that allows the application to  
download extensions and other dependencies at runtime.

Deployment should not be slow if you set the offline flag  
(tuscany.online webapp parameter IIRC) so that it does not check for  
snapshots. This is an issue with a build from trunk as most of the  
dependencies will still be snapshots rather than real releases; this  
should not affect a released version.

>
> And for every succeeding deployment, one needs to restart the Tomcat
> server - since Tuscany doesn't appear to release a lock in the
> expanded war directory. The tomcat manager's undeploy function thus no
> longer works correctly.

Are you running on Windows? This may not be an issue with the Maven  
support but a side effect of the classloader - IIRC URLClassLoader  
can take locks on the underlying file and not release them. I've not  
seen any issue on OSX with deploy/undeploy cycles.

>
> This makes the develop-debug cycle rather painful. Does anybody have
> any ideas/tips on how to speed things up?

The online flag should fix the initial start time if you are running  
snapshots.

Short of rewriting the classloader I'm not sure how to fix Windows  
(and even then extensions that also create classloaders (such as the  
Spring and Axis ones) may mean that this is not fully resolved).

--
Jeremy

---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org