diff options
author | kchong | 2010-03-11 02:54:39 +0000 |
---|---|---|
committer | kchong | 2010-03-11 02:54:39 +0000 |
commit | f013981fd1c88b35db0349be7fd1bff7b25d9b38 (patch) | |
tree | 0226a9146ead6ae3c41bdb072bde1ddd9e428655 /axis2 | |
parent | b515ffe108c5960d6ad4c48690975873c9a268b2 (diff) | |
download | webtools.webservices-f013981fd1c88b35db0349be7fd1bff7b25d9b38.tar.gz webtools.webservices-f013981fd1c88b35db0349be7fd1bff7b25d9b38.tar.xz webtools.webservices-f013981fd1c88b35db0349be7fd1bff7b25d9b38.zip |
[282466] Axis2: Support for Axis2 1.5
Diffstat (limited to 'axis2')
7 files changed, 91 insertions, 34 deletions
diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/constant/Axis2Constants.java b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/constant/Axis2Constants.java index 6b3e882e6..38396f42f 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/constant/Axis2Constants.java +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/constant/Axis2Constants.java @@ -15,6 +15,7 @@ * 20080521 231098 sandakith@wso2.com - Lahiru Sandakith, Fix for Axis2 1.4 dependency chenge * 20080604 193371 samindaw@wso2.com - Saminda Wijeratne, creating a function to validate services.xml * 20091207 192005 samindaw@wso2.com - merge the web.xml to have axis2 welcome file defined + * 20100308 282466 samindaw@wso2.com - Saminda Wijeratne, support for axis2 1.5 *******************************************************************************/ package org.eclipse.jst.ws.axis2.core.constant; @@ -93,7 +94,8 @@ public class Axis2Constants { "annogen", "backport-util", "mex-impl", - "mail" + "mail", + "httpcore" }; } diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/utils/FacetContainerUtils.java b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/utils/FacetContainerUtils.java index 9333b7c56..980c16c44 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/utils/FacetContainerUtils.java +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/core/utils/FacetContainerUtils.java @@ -18,6 +18,7 @@ * 20070612 192047 kathy@ca.ibm.com - Kathy Chan * 20070813 196173 sandakith@wso2.com - Lahiru Sandakith, Fix 196173, DWP custom location fix * 20070824 200515 sandakith@wso2.com - Lahiru Sandakith, NON-NLS move to seperate file + * 20100308 282466 samindaw@wso2.com - Saminda Wijeratne, support for axis2 1.5 *******************************************************************************/ package org.eclipse.jst.ws.axis2.core.utils; @@ -182,5 +183,34 @@ public class FacetContainerUtils { return FileUtils.addNodesToURL(deployedWSDLURLpath, deployedWSDLURLParts)+"?wsdl"; } + public static String getAxis2WebContainerLibPath(IProject project){ + return getAxis2WebContainerLibPath(FacetContainerUtils.pathToWebProjectContainer( + project.toString())); + } + + public static String getAxis2WebContainerLibPath(String webcontainerPath){ + return FileUtils.addAnotherNodeToPath(getAxis2WebContainerWEB_INFPath(webcontainerPath), + Axis2Constants.DIR_LIB); + } + + public static String getAxis2WebContainerwebinfClassPath(IProject project){ + return getAxis2WebContainerwebinfClassPath(FacetContainerUtils.pathToWebProjectContainer( + project.toString())); + } + + public static String getAxis2WebContainerwebinfClassPath(String webcontainerPath){ + return FileUtils.addAnotherNodeToPath(getAxis2WebContainerWEB_INFPath(webcontainerPath), + Axis2Constants.DIR_CLASSES); + } + + public static String getAxis2WebContainerRepositoryPath(String webcontainerPath){ + return FileUtils.addAnotherNodeToPath(getAxis2WebContainerWEB_INFPath(webcontainerPath), + Axis2Constants.DIR_SERVICES); + } + + public static String getAxis2WebContainerWEB_INFPath(String webcontainerPath){ + return FileUtils.addAnotherNodeToPath(webcontainerPath,Axis2Constants.DIR_WEB_INF); + } + } diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/Axis2WebservicesServerCommand.java b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/Axis2WebservicesServerCommand.java index 76c5673f8..f8d661879 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/Axis2WebservicesServerCommand.java +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/Axis2WebservicesServerCommand.java @@ -20,6 +20,7 @@ * 20071011 205972 sandakith@wso2.com - Lahiru Sandakith, Axis2 Libraries License files fix * 20080528 186429 sandakith@wso2.com - Lahiru Sandakith, Axis2 webapp jsp's validation fix * 20080616 237363 samindaw@wso2.com - Saminda Wijeratne, get ResourceContext from environment instead of preference + * 20100308 282466 samindaw@wso2.com - Saminda Wijeratne, support for axis2 1.5 *******************************************************************************/ package org.eclipse.jst.ws.axis2.facet.commands; @@ -120,12 +121,8 @@ AbstractDataModelOperation { List<String> includeList = new ArrayList<String>(); contentCopyUtils.updateCheckList(loadIncludeListWithAxis2Libs(libPath.toOSString(), includeList)); - String[] nodes = {Axis2Constants.DIR_WEB_INF,Axis2Constants.DIR_LIB}; status = contentCopyUtils.copyDirectoryRecursivelyIntoWorkspace( - libPath.toOSString(), - FileUtils.addNodesToPath( - FacetContainerUtils.pathToWebProjectContainer(project.toString()), - nodes), + libPath.toOSString(), FacetContainerUtils.getAxis2WebContainerLibPath(project), monitor, true ); diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/MergeWEBXMLCommand.java b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/MergeWEBXMLCommand.java index eb1f6a67a..08a3ad4eb 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/MergeWEBXMLCommand.java +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/commands/MergeWEBXMLCommand.java @@ -13,6 +13,7 @@ * 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu * 20070606 177421 sandakith@wso2.com - fix web.xml wiped out when Axis2 facet * 20091207 192005 samindaw@wso2.com - merge the web.xml to have axis2 welcome file defined + * 20100308 282466 samindaw@wso2.com - Saminda Wijeratne, support for axis2 1.5 *******************************************************************************/ package org.eclipse.jst.ws.axis2.facet.commands; @@ -40,6 +41,9 @@ import org.eclipse.jst.javaee.core.UrlPatternType; import org.eclipse.jst.javaee.web.WebFactory; import org.eclipse.jst.javaee.web.WelcomeFileList; import org.eclipse.jst.ws.axis2.core.constant.Axis2Constants; +import org.eclipse.jst.ws.axis2.core.utils.FacetContainerUtils; +import org.eclipse.jst.ws.axis2.core.utils.FileUtils; +import org.eclipse.jst.ws.axis2.facet.utils.Axis2RuntimeUtils; import org.eclipse.wst.command.internal.env.core.common.StatusUtils; import org.eclipse.wst.common.environment.IEnvironment; import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; @@ -112,12 +116,13 @@ public class MergeWEBXMLCommand extends AbstractDataModelOperation { ServletDescriptor sd = new ServletDescriptor(); sd._name = "AxisAdminServlet"; //$NON-NLS-1$ sd._displayName = "Apache-Axis Admin Servlet Web Admin"; //$NON-NLS-1$ - sd._className = "org.apache.axis2.transport.http.AxisAdminServlet"; //$NON-NLS-1$ + sd._className = Axis2RuntimeUtils.getAxis2ServletAdminClass(serverProject); sd._mappings = new String[] { "/axis2-admin/*" }; //$NON-NLS-1$ sd._loadOnStartup = new Integer(100); return sd; } + public IStatus addServlet(IProject webProject, ServletDescriptor servletDescriptor, WebApp webapp) { try { diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/utils/Axis2RuntimeUtils.java b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/utils/Axis2RuntimeUtils.java index c6ebdb9c2..fd8773b21 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/utils/Axis2RuntimeUtils.java +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.core/src/org/eclipse/jst/ws/axis2/facet/utils/Axis2RuntimeUtils.java @@ -16,6 +16,7 @@ * 20070516 183147 sandakith@wso2.com - Lahiru Sandakith Fix for the persisting DBCS paths * 20070523 174876 sandakith@wso2.com - Lahiru Sandakith, Persist Preferences inside Framework * 20070824 200515 sandakith@wso2.com - Lahiru Sandakith, NON-NLS move to seperate file + * 20100308 282466 samindaw@wso2.com - Saminda Wijeratne, support for axis2 1.5 *******************************************************************************/ package org.eclipse.jst.ws.axis2.facet.utils; @@ -32,6 +33,9 @@ import java.util.TreeSet; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.Project; +import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; @@ -39,6 +43,7 @@ import org.eclipse.jst.ws.axis2.core.constant.Axis2Constants; import org.eclipse.jst.ws.axis2.core.context.Axis2EmitterContext; import org.eclipse.jst.ws.axis2.core.plugin.WebServiceAxis2CorePlugin; import org.eclipse.jst.ws.axis2.core.utils.Axis2CoreUtils; +import org.eclipse.jst.ws.axis2.core.utils.FacetContainerUtils; import org.eclipse.jst.ws.axis2.core.utils.FileUtils; public class Axis2RuntimeUtils { @@ -196,6 +201,42 @@ public class Axis2RuntimeUtils { public static void setOutputPath(String outputPath) { Axis2RuntimeUtils.outputPath = outputPath; } - + + public static String getAxis2ServletAdminClass(IProject project){ + String[] classNames=new String[]{"org.apache.axis2.transport.http.AxisAdminServlet" , + "org.apache.axis2.webapp.AxisAdminServlet"};//$NON-NLS-1$ + String defaultClassName=classNames[0]; + String selectedClassName=null; + String axis2WCLibPath = FacetContainerUtils.getAxis2WebContainerLibPath(project); + File libFolder = new File(axis2WCLibPath); + File[] libs = libFolder.listFiles(); + AntClassLoader antClassLoader = new AntClassLoader(); + antClassLoader.setParentFirst(false); + org.apache.tools.ant.types.Path path = new org.apache.tools.ant.types.Path(new Project()); + path.setPath(FacetContainerUtils.getAxis2WebContainerwebinfClassPath(project)); + for (File lib : libs) { + if (lib.getName().toLowerCase().endsWith(".jar")){ + path.setPath(lib.getAbsolutePath()); + antClassLoader.setClassPath(path); + for(String className:classNames){ + try{ + Class.forName(className, false, antClassLoader); + selectedClassName=className; + }catch (NoClassDefFoundError e1){ + if (!e1.getMessage().contains(className) && !e1.getCause().getMessage().contains(className)) //dependent class is not found + selectedClassName=className; + //class not found + }catch(Exception e){ + //the class is not found + } + if (selectedClassName!=null) break; + } + } + if (selectedClassName!=null) break; + } + antClassLoader.cleanup(); + if (selectedClassName==null) selectedClassName=defaultClassName; + return selectedClassName; + } } diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/META-INF/MANIFEST.MF b/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/META-INF/MANIFEST.MF index 7851917e0..ef177a7a4 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/META-INF/MANIFEST.MF +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %PLUGIN_NAME Bundle-SymbolicName: org.eclipse.jst.ws.axis2.creation.core -Bundle-Version: 1.0.105.qualifier +Bundle-Version: 1.0.106.qualifier Bundle-Activator: org.eclipse.jst.ws.axis2.creation.core.plugin.WebServiceAxis2CreationCorePlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/src/org/eclipse/jst/ws/axis2/creation/core/command/Axis2WebservicesServerCommand.java b/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/src/org/eclipse/jst/ws/axis2/creation/core/command/Axis2WebservicesServerCommand.java index 97c6c7db4..c05c50887 100644 --- a/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/src/org/eclipse/jst/ws/axis2/creation/core/command/Axis2WebservicesServerCommand.java +++ b/axis2/bundles/org.eclipse.jst.ws.axis2.creation.core/src/org/eclipse/jst/ws/axis2/creation/core/command/Axis2WebservicesServerCommand.java @@ -15,18 +15,16 @@ * 20070813 196173 sandakith@wso2.com - Lahiru Sandakith, Fix 196173, DWP custom location fix * 20070824 200515 sandakith@wso2.com - Lahiru Sandakith, NON-NLS move to seperate file * 20080616 237363 samindaw@wso2.com - Saminda Wijeratne, get ResourceContext from environment instead of preference + * 20100308 282466 samindaw@wso2.com - Saminda Wijeratne, support for axis2 1.5 *******************************************************************************/ package org.eclipse.jst.ws.axis2.creation.core.command; -import java.io.File; - import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jst.ws.axis2.consumption.core.utils.ContentCopyUtils; -import org.eclipse.jst.ws.axis2.core.constant.Axis2Constants; import org.eclipse.jst.ws.axis2.core.utils.FacetContainerUtils; import org.eclipse.jst.ws.axis2.core.utils.FileUtils; import org.eclipse.jst.ws.axis2.creation.core.data.DataModel; @@ -52,34 +50,18 @@ public class Axis2WebservicesServerCommand extends AbstractDataModelOperation { IEnvironment environment = getEnvironment(); IStatusHandler statusHandler = environment.getStatusHandler(); - String webContainerDirString = FacetContainerUtils.pathToWebProjectContainer( - model.getWebProjectName()); + ContentCopyUtils contentCopyUtils = new ContentCopyUtils(getEnvironment()); //Check for the server status if (model.getServerStatus()){ - if (scenario == WebServiceScenario.BOTTOMUP){ - //Import the tempory webservices directory according to the Resources API of eclipse - String webserviceTempDirString = model.getPathToWebServicesTempDir(); - String repositoryString = webContainerDirString - + File.separator + Axis2Constants.DIR_WEB_INF - + File.separator + Axis2Constants.DIR_SERVICES; - //Copy the existing services to the repository - status = contentCopyUtils.copyDirectoryRecursivelyIntoWorkspace( - webserviceTempDirString, - repositoryString, - monitor, - statusHandler); - FileUtils.deleteDirectories(webserviceTempDirString); - - - }else if (scenario == WebServiceScenario.TOPDOWN){ - //Do topdown + if (scenario == WebServiceScenario.BOTTOMUP || scenario == WebServiceScenario.TOPDOWN){ + String webContainerDirString = FacetContainerUtils.pathToWebProjectContainer( + model.getWebProjectName()); + String repositoryString = FacetContainerUtils.getAxis2WebContainerRepositoryPath( + webContainerDirString); String webserviceTempDirString = model.getPathToWebServicesTempDir(); - String repositoryString = webContainerDirString - + File.separator + Axis2Constants.DIR_WEB_INF - + File.separator + Axis2Constants.DIR_SERVICES; //Copy the existing services to the repository status = contentCopyUtils.copyDirectoryRecursivelyIntoWorkspace( webserviceTempDirString, |