Bug 364026 - saaj.jar deployment fails when multiple javax.xml.soap bundles are installed
Summary: saaj.jar deployment fails when multiple javax.xml.soap bundles are installed
Status: RESOLVED FIXED
Alias: None
Product: WTP Webservices
Classification: WebTools
Component: jst.ws (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Keith Chong CLA
QA Contact: Keith Chong CLA
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2011-11-17 07:59 EST by Martin Lippert CLA
Modified: 2012-04-18 16:35 EDT (History)
4 users (show)

See Also:


Attachments
patch for version-specific bundle lookup (5.76 KB, text/plain)
2012-03-20 07:20 EDT, Martin Lippert CLA
keith.chong.ca: iplog+
Details
Revised (6.19 KB, patch)
2012-04-12 09:21 EDT, Keith Chong CLA
no flags Details | Diff
Patch with updated copyrights (7.71 KB, patch)
2012-04-18 13:26 EDT, Keith Chong CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Lippert CLA 2011-11-17 07:59:32 EST
Orbit contains two different versions of the javax.xml.soap bundle: 1.2.0 and 1.3.0.
Both bundles are different: 1.2.0 has the saaj.jar as lib, 1.3.0 has the jar file expanded.

When WTP now tries to deploy the saaj.jar file, it looks only for the bundle ID and the JAR file inside. This results in an error when both javax.xml.soap bundles are installed, because the lookup by bundle ID refers to the 1.3.0 version of javax.xml.soap, which hasn't the JAR file as JAR file inside.

Unfortunately I cannot avoid having both versions installed because of other features having strict dependencies on both versions.

The solution would be:
- re-package javax.xml.soap 1.3.0 to also include the saaj.jar file
- fix the vague lookup of the javax.xml.soap bundle in CopyAxisJarCommand, so that it finds the JAR in the 1.2.0 version of the bundle.
Comment 1 Martin Lippert CLA 2011-11-17 08:03:23 EST
addind David and Oliver to this as they are the maintainers for the mentioned orbit bundles.
Comment 2 David Williams CLA 2011-11-17 12:32:43 EST
(In reply to comment #0)

> - fix the vague lookup of the javax.xml.soap bundle in CopyAxisJarCommand, so
> that it finds the JAR in the 1.2.0 version of the bundle.

This would be my recommendation. This "vague lookup" has caused a lot of problems before, such as bug 309040 and bug bug 327009 and the "right" (well, best) way to put things into Orbit is with exploded jars, as .class files. 

Remember, a bundle can be used as a jar, so ... I suggest a solution be sought that uses the bundle itself.
Comment 3 Keith Chong CLA 2011-12-08 14:18:26 EST
Hi Martin,

Do you have time to look at this bug and provide a patch?
Comment 4 Martin Lippert CLA 2011-12-13 14:28:57 EST
Not at the moment, but I can try to come up with a patch as soon as I find the time to work on this. Ok?
Comment 5 Martin Lippert CLA 2012-02-06 11:09:54 EST
So I looked at this in a bit more depth and I have a few follow-up questions:

- it is indeed ok to just grab one of the available soap libs and copy that JAR file? I could change the implementation so that the CopyAxisJarCommand is able to copy the bundle JAR file instead of an embedded saar.jar, if that doesn't exist. But I wonder if it is actually important which version of the saar lib to use. Is it or not?

- there is a mechanism used to delete old files from previous WTP versions that is using a hard-coded file size. Any idea how to adapt this? If I keep it the way it is, it would delete the deployed JAR file (in the case of the bundle JAR) over and over again, because the hard-coded file size is set to the value of the embedded saar.jar file. Any idea?
Comment 6 Martin Lippert CLA 2012-02-06 11:10:33 EST
Oh, one more:

- are there any unit test cases that I can use to verify that  I don't break anything?
Comment 7 Keith Chong CLA 2012-02-09 13:58:03 EST
Hi Martin,

Thanks for looking into it. 

1. Looks like 1.3 added support for SOAP 1.2.  We should keep it at 1.2 since Apache Axis is Soap 1.1 so there will be no benefit from SAAJ 1.3
2. I think this current delete jars mechanism is also vague.  So, if we fix it for 3.4, you want to apply a similar patch to an earlier release?
3. Unfortunately, there is no specific automated test for this CopyAxisJarCommand.
Comment 8 Martin Lippert CLA 2012-02-10 04:11:55 EST
Ok, that sounds to me like the first step for fixing this is to make sure the copy action looks up the saar.jar file from the javax.xml.soap bundle in version 1.2.0 (and not just from some version that is installed).

The second part is to make the copy command more robust so that it can deal with exploded jars, jus in case the version 1.2.0 of javax.xml.soap is installed in exploded format. But I don't know whether this Orbit version of javax.xml.soap_1.2.0 will ever change its packaging, so maybe fixing this part is not that important at the moment.

What do you think?
Comment 9 Keith Chong CLA 2012-02-16 11:52:05 EST
(In reply to comment #8)
> Ok, that sounds to me like the first step for fixing this is to make sure the
> copy action looks up the saar.jar file from the javax.xml.soap bundle in
> version 1.2.0 (and not just from some version that is installed).
> 
> The second part is to make the copy command more robust so that it can deal
> with exploded jars, jus in case the version 1.2.0 of javax.xml.soap is
> installed in exploded format. But I don't know whether this Orbit version of
> javax.xml.soap_1.2.0 will ever change its packaging, so maybe fixing this part
> is not that important at the moment.
> 
> What do you think?

Hi Martin, yes, I agree, I don't think that is important right now, since the 1.2 version is not exploded...and we're not going to use 1.3 which is jarred.
Comment 10 Keith Chong CLA 2012-03-01 13:55:31 EST
Hi Martin, how is this coming along?  You have an estimate as to when it can be committed?
Comment 11 Keith Chong CLA 2012-03-15 13:52:04 EDT
Hi Martin, do you plan on getting this fixed for M7?
Comment 12 Martin Lippert CLA 2012-03-15 14:06:41 EDT
what is the timeframe for M7 for webtools?
Comment 13 Keith Chong CLA 2012-03-15 14:19:49 EDT
4/5 - I build declare(Start of M7) 
M7 05/04 (for delivery to Juno+2 on 05/09)(after this build, begin PMC +1) 

I suggest aiming for early part of M7, so that there's enough time to test and react to changes.
Comment 14 Martin Lippert CLA 2012-03-20 07:20:17 EDT
Created attachment 212906 [details]
patch for version-specific bundle lookup

The attached patch adds version-specific lookup for the bundle that provides the saar.jar file. I just changed the lookup for exactly this, but if you wanna adopt this for other file lookups in this Axis file copy command, it should be relatively straight forward now.

Hope this helps,
Martin
Comment 15 Martin Lippert CLA 2012-03-20 07:30:57 EDT
Please give this a good test run before committing to the project, since I wasn't able to setup a full environment for testing for this. I used a somewhat reduced setting and implemented and tested this in isolation, but having two different versions of javax.xml.soap installed. So please test this carefully in the webservice tooling environment.
Comment 16 Keith Chong CLA 2012-03-22 14:04:38 EDT
Thanks Martin.
Comment 17 Martin Lippert CLA 2012-03-23 02:44:54 EDT
No problem, my pleasure to help and contribute here... :-)
Hope testing goes well...
Comment 18 Keith Chong CLA 2012-04-04 15:33:43 EDT
Hi Martin, 

Although we are still picking up the same SOAP 1.2 jar since at least 3.2.5, (1.2.0.v201005080501), I think we should support [1.2, 1.3).

Do you know of a way to find a specific version of the plugin, and then get the install location of it?
Comment 19 Martin Lippert CLA 2012-04-05 12:14:41 EDT
Hey Keith,

if you take a look at the patch that I submitted, there is the code implemented to lookup a specific version of the bundle. You basically need to iterate over the returned list of bundles and compare the version information yourself. I did it the lazy way, using the already implemented compareTo method, but that is working only if you have the exact version (including v201005080501).

Aside of that I am not sure whether we should blindly support all versions between 1.2 and 1.3, because the implementation as it is still works only if the saar.jar lib is contained in the bundle as a JAR file. And since I don't know if other 1.2.0 versions of the bundle will follow this path, I put in the specific version information (because I know that that version looks that way).

But feel free to change my patch to work with all the 1.2.x.y versions of the bundle or let me know if I should do that.

Cheers,
-Martin
Comment 20 Keith Chong CLA 2012-04-12 09:21:57 EDT
Created attachment 213895 [details]
Revised

Hi Martin, maybe something like this patch?   Give this a spin.
Comment 21 Martin Lippert CLA 2012-04-12 09:49:13 EDT
Looks good to me
Comment 22 Keith Chong CLA 2012-04-18 13:26:53 EDT
Created attachment 214202 [details]
Patch with updated copyrights
Comment 23 Keith Chong CLA 2012-04-18 13:30:23 EDT
Released to 3.4

Tested with AllWSJUnitTests.
Comment 24 Martin Lippert CLA 2012-04-18 16:35:43 EDT
Thanks for improving my original patch a bit and for committing this patch. Great to have this solved for the upcoming WTP versions. I guess this is therefore part of the Juno release, right?