Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 364026 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java (-6 / +18 lines)
Lines 21-26 Link Here
21
 * 20080326   224148 makandre@ca.ibm.com - Andrew Mak, Web service scenarios broke in latest builds with Equinox p2
21
 * 20080326   224148 makandre@ca.ibm.com - Andrew Mak, Web service scenarios broke in latest builds with Equinox p2
22
 * 20100304   304385 mahutch@ca.ibm.com - Mark Hutchinson, Allow users to disable copying axis jars
22
 * 20100304   304385 mahutch@ca.ibm.com - Mark Hutchinson, Allow users to disable copying axis jars
23
 * 20100414   309040 mahutch@ca.ibm.com - Mark Hutchinson, update jar sizes
23
 * 20100414   309040 mahutch@ca.ibm.com - Mark Hutchinson, update jar sizes
24
 * 20120418   364026 lippert@acm.org - Martin Lippert, saaj.jar deployment fails when multiple javax.xml.soap bundles are installed 
24
 *******************************************************************************/
25
 *******************************************************************************/
25
package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
26
package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
26
27
Lines 60-65 Link Here
60
import org.eclipse.wst.common.environment.IEnvironment;
61
import org.eclipse.wst.common.environment.IEnvironment;
61
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
62
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
62
import org.eclipse.wst.ws.internal.common.BundleUtils;
63
import org.eclipse.wst.ws.internal.common.BundleUtils;
64
import org.osgi.framework.Version;
63
65
64
66
65
public class CopyAxisJarCommand extends AbstractDataModelOperation {
67
public class CopyAxisJarCommand extends AbstractDataModelOperation {
Lines 71-76 Link Here
71
	public static String JAVAX_XML_RPC_PLUGIN_ID = "javax.xml.rpc"; //$NON-NLS-1$
73
	public static String JAVAX_XML_RPC_PLUGIN_ID = "javax.xml.rpc"; //$NON-NLS-1$
72
	public static String JAVAX_XML_RPC_JAR = "jaxrpc.jar"; //$NON-NLS-1$
74
	public static String JAVAX_XML_RPC_JAR = "jaxrpc.jar"; //$NON-NLS-1$
73
	public static String JAVAX_XML_SOAP_PLUGIN_ID = "javax.xml.soap"; //$NON-NLS-1$
75
	public static String JAVAX_XML_SOAP_PLUGIN_ID = "javax.xml.soap"; //$NON-NLS-1$
76
	public static Version JAVAX_XML_SOAP_PLUGIN_VERSION = Version.parseVersion("1.2.0");
77
	private static Version JAVAX_XML_SOAP_PLUGIN_UPPER_VERSION = Version.parseVersion("1.3.0");
74
	public static String JAVAX_XML_SOAP_JAR = "saaj.jar"; //$NON-NLS-1$
78
	public static String JAVAX_XML_SOAP_JAR = "saaj.jar"; //$NON-NLS-1$
75
	public static String JAVAX_WSDL_PLUGIN_ID = "javax.wsdl"; //$NON-NLS-1$
79
	public static String JAVAX_WSDL_PLUGIN_ID = "javax.wsdl"; //$NON-NLS-1$
76
	public static String JAVAX_WSDL_JAR = "wsdl4j.jar"; //$NON-NLS-1$
80
	public static String JAVAX_WSDL_JAR = "wsdl4j.jar"; //$NON-NLS-1$
Lines 150-168 Link Here
150
		deleteObsoleteJars(webModulePath);
154
		deleteObsoleteJars(webModulePath);
151
155
152
156
153
		copyIFile(AXIS_RUNTIME_PLUGIN_ID, "lib/" + AXIS_JAR, webModulePath, "WEB-INF/lib/" + AXIS_JAR, status, env, monitor);
157
		copyIFile(AXIS_RUNTIME_PLUGIN_ID, null, null, "lib/" + AXIS_JAR, webModulePath, "WEB-INF/lib/" + AXIS_JAR, status, env, monitor);
154
		if (status.getSeverity() == Status.ERROR) {
158
		if (status.getSeverity() == Status.ERROR) {
155
			return;
159
			return;
156
		}
160
		}
157
		copyIFile(COMMON_DISCOVERY_PLUGIN_ID, "lib/" + COMMON_DISCOVERY_JAR, webModulePath, "WEB-INF/lib/" + COMMON_DISCOVERY_JAR, status, env, monitor);
161
		copyIFile(COMMON_DISCOVERY_PLUGIN_ID, null, null, "lib/" + COMMON_DISCOVERY_JAR, webModulePath, "WEB-INF/lib/" + COMMON_DISCOVERY_JAR, status, env, monitor);
158
		if (status.getSeverity() == Status.ERROR) {
162
		if (status.getSeverity() == Status.ERROR) {
159
			return;
163
			return;
160
		}
164
		}
161
		copyIFile(JAVAX_XML_RPC_PLUGIN_ID, "lib/" + JAVAX_XML_RPC_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_RPC_JAR, status, env, monitor);
165
		copyIFile(JAVAX_XML_RPC_PLUGIN_ID, null, null, "lib/" + JAVAX_XML_RPC_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_RPC_JAR, status, env, monitor);
162
		if (status.getSeverity() == Status.ERROR) {
166
		if (status.getSeverity() == Status.ERROR) {
163
			return;
167
			return;
164
		}
168
		}
165
		copyIFile(JAVAX_XML_SOAP_PLUGIN_ID, "lib/" + JAVAX_XML_SOAP_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_SOAP_JAR, status, env, monitor);
169
		copyIFile(JAVAX_XML_SOAP_PLUGIN_ID, JAVAX_XML_SOAP_PLUGIN_VERSION, JAVAX_XML_SOAP_PLUGIN_UPPER_VERSION, "lib/" + JAVAX_XML_SOAP_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_SOAP_JAR, status, env, monitor);
166
		if (status.getSeverity() == Status.ERROR) {
170
		if (status.getSeverity() == Status.ERROR) {
167
			return;
171
			return;
168
		}
172
		}
Lines 181-187 Link Here
181
	/**
185
	/**
182
	 * 
186
	 * 
183
	 */
187
	 */
184
	private void copyIFile(String pluginId, String source, IPath targetPath, String targetFile, IStatus status, IEnvironment env, IProgressMonitor monitor) {
188
	private void copyIFile(String pluginId, Version pluginVersion, Version upperVersion, String source, IPath targetPath, String targetFile, IStatus status, IEnvironment env, IProgressMonitor monitor) {
185
		IPath target = targetPath.append(new Path(targetFile));
189
		IPath target = targetPath.append(new Path(targetFile));
186
		ProgressUtils.report(monitor, ConsumptionMessages.PROGRESS_INFO_COPYING_FILE);
190
		ProgressUtils.report(monitor, ConsumptionMessages.PROGRESS_INFO_COPYING_FILE);
187
191
Lines 190-196 Link Here
190
			context.setOverwriteFilesEnabled(true);
194
			context.setOverwriteFilesEnabled(true);
191
			context.setCreateFoldersEnabled(true);
195
			context.setCreateFoldersEnabled(true);
192
			context.setCheckoutFilesEnabled(true);
196
			context.setCheckoutFilesEnabled(true);
193
			URL sourceURL = BundleUtils.getURLFromBundle(pluginId, source);
197
198
			URL sourceURL = null;
199
			if (pluginVersion != null) {
200
				sourceURL = BundleUtils.getURLFromBundle(pluginId, pluginVersion, upperVersion, source);
201
			}
202
			else {
203
				sourceURL = BundleUtils.getURLFromBundle(pluginId, source);
204
			}
205
194
			IFile resource = ResourceUtils.getWorkspaceRoot().getFile(target);
206
			IFile resource = ResourceUtils.getWorkspaceRoot().getFile(target);
195
			if (!resource.exists()) {
207
			if (!resource.exists()) {
196
				IFile file = FileResourceUtils.createFile(context, target, sourceURL.openStream(), monitor, env.getStatusHandler());
208
				IFile file = FileResourceUtils.createFile(context, target, sourceURL.openStream(), monitor, env.getStatusHandler());
(-)src/org/eclipse/wst/ws/internal/common/BundleUtils.java (-2 / +25 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2003, 2008 IBM Corporation and others.
2
 * Copyright (c) 2003, 2012 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 11-16 Link Here
11
 * -------- -------- -----------------------------------------------------------
11
 * -------- -------- -----------------------------------------------------------
12
 * 20070501   184505 kathy@ca.ibm.com - Kathy Chan
12
 * 20070501   184505 kathy@ca.ibm.com - Kathy Chan
13
 * 20080326   224148 makandre@ca.ibm.com - Andrew Mak, Web service scenarios broke in latest builds with Equinox p2
13
 * 20080326   224148 makandre@ca.ibm.com - Andrew Mak, Web service scenarios broke in latest builds with Equinox p2
14
 * 20120418   364026 lippert@acm.org - Martin Lippert, saaj.jar deployment fails when multiple javax.xml.soap bundles are installed
14
 *******************************************************************************/
15
 *******************************************************************************/
15
package org.eclipse.wst.ws.internal.common;
16
package org.eclipse.wst.ws.internal.common;
16
17
Lines 30-42 Link Here
30
{
31
{
31
	static public URL getURLFromBundle( String bundleId, String path ) throws MalformedURLException
32
	static public URL getURLFromBundle( String bundleId, String path ) throws MalformedURLException
32
	{
33
	{
33
		Bundle      bundle     = Platform.getBundle( bundleId );
34
		Bundle      bundle     = Platform.getBundle(bundleId);
34
		URL         installURL = bundle.getEntry("/");
35
		URL         installURL = bundle.getEntry("/");
35
		URL         fileURL    = new URL(installURL, path );
36
		URL         fileURL    = new URL(installURL, path );
36
37
37
		return fileURL;
38
		return fileURL;
38
	}
39
	}
39
40
41
	static public URL getURLFromBundle( String bundleId, Version bundleVersion, Version upperVersion, String path ) throws MalformedURLException
42
	{
43
		Bundle      bundle     = getBundleWithinVersionRange(bundleId, bundleVersion, upperVersion);
44
		URL         installURL = bundle.getEntry("/");
45
		URL         fileURL    = new URL(installURL, path );
46
47
		return fileURL;
48
	}
49
50
	private static Bundle getBundleWithinVersionRange(String bundleId,
51
			Version bundleVersion, Version upperVersion) {
52
		Bundle[] bundles = Platform.getBundles(bundleId, bundleVersion.toString());
53
		for(Bundle bundle : bundles) {
54
			Version aVersion = bundle.getVersion();
55
			if (aVersion.compareTo(bundleVersion) >= 0 && aVersion.compareTo(upperVersion) < 0) {
56
				return bundle;
57
			}
58
		}
59
		
60
		return null;
61
	}
62
40
	/**
63
	/**
41
	 * @param bundleId
64
	 * @param bundleId
42
	 * @return Returns the path for the Jarred plugin.  Returns null if path not found.
65
	 * @return Returns the path for the Jarred plugin.  Returns null if path not found.

Return to bug 364026