Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 155439

Summary: Copy correct versions of Axis JARs to WEB-INF/lib as required
Product: [WebTools] WTP Webservices Reporter: Kathy Chan <kathy>
Component: jst.wsAssignee: Mark Hutchinson <mahutch>
Status: CLOSED FIXED QA Contact: Chris Brealey <cbrealey>
Severity: major    
Priority: P3 CC: cbrealey, makandre, sengpl
Version: 1.5   
Target Milestone: 1.5.1 M151   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch for org.eclipse.jst.ws.axis.consumption.ui plugin none

Description Kathy Chan CLA 2006-08-28 14:13:34 EDT
Here's the scenario:

- The user goes through a top-down Web service scenario with a previous version of WTP that supports an older level of Axis (prior to Axis 1.3).  The WebContent/WEB-INF/lib folder would contain pre-1.3 Axis JARs.  They then export the WAR.
- Now using WTP 1.5, the user import that WAR and then go through a top-down Web service scenario again.  The wizard would call the Axis 1.3 emitter and generate new code.  The wizard would detect that that the Axis JARs of the same names are already there and would not copy it to the WebContent/WEB-INF/lib folder again.  

However, this could cause compile error in the generated code since the code expect the Axis 1.3 JARs to be there but they are not.

The reason we originally have the code to check if the JARs need to be copied or not before copying is for performance.  We don't want to blindly copy the JARs everytime.  We need a better mechanism to determine if the Axis JARs is the right version before deciding if they should be re-copied or not.
Comment 1 Kathy Chan CLA 2006-08-28 14:37:42 EDT
Mark, please take a look at this problem.  As discussed, we copied different versions of Axis JARs (some have different names in different versions of Axis) for WTP 0.7, 1.0 and 1.5.  We also need to remove the JARs with the old name (if they exist) on top of copying the new JARs of the right versions.
Comment 2 Mark Hutchinson CLA 2006-08-28 18:15:41 EDT
Created attachment 48929 [details]
Proposed patch for org.eclipse.jst.ws.axis.consumption.ui plugin

Kathy here is a proposed patch that fixes this problem.

Projects that are imported from older versions of WTP will likely have jars that are out of date in the WEB-INF/lib folder.  There are more jars than just axis that could be out of date.  This fix checks for out of date jars and deletes them.  Once the obsolete jars are removed the new axis jars can be copied into the lib folder.

It might be worth investigating any performance issues caused by this patch because we are doing stuff with the file system.  This check for obsolete jars probably only really needs to happen when projects are imported and not every time a web services is created but I'm not sure how to do that. Have a look at this patch and let me know what you think.  Thanks
Comment 3 Mark Hutchinson CLA 2006-08-29 11:08:22 EDT
Seng, would you be able to have a look at this patch and see what the performance impact is?
Comment 4 Mark Hutchinson CLA 2006-08-29 15:57:17 EDT
I did a bit of investigation into the performance of the deleteObsoleteJars() method using a simple difference of systemTimes.

On a web project where all of the jars are obsolete and need to be deleted this method takes about 250 ms.  This is unavoidable since these jars need to be deleted.

On a web project created in WTP 1.0 three jars need to be deleted this takes around 97 ms on my machine.

When none of the jars are obsolete and nothing needs deleting this method takes between 0 and 20 ms (almost always 0) on my machine.

So the time required to check for obsolete jars is insignificant.  A small amount of time is needed to delete jars.

Since performance does not seem to be a problem this patch is ready to be reviewed.
Comment 5 Kathy Chan CLA 2006-08-30 12:05:41 EDT
Patch reviewed and committed.  Will release later on today.
Comment 6 Kathy Chan CLA 2006-08-30 13:08:01 EDT
Released to HEAD and WTP 1.5.1 as v200608301709.  This will be in the 08/31 WTP 1.5.1 M-build.
Comment 7 Andrew Mak CLA 2006-09-12 11:04:58 EDT
I was able to verify the problem described is fixed.  However, I ran into a similar problem with the webserviceutils.jar.  Bug 157039 is opened for it.
Comment 8 Kathy Chan CLA 2006-09-14 12:52:44 EDT
Verified on 09/08 WTP 1.5.1 M-driver.