Author: thomas.diesler(a)jboss.com
Date: 2006-12-18 14:35:55 -0500 (Mon, 18 Dec 2006)
New Revision: 1667
Modified:
trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
Log:
Exclude DeploymentUnit components from deployment.
Remove assumtion that DeploymentUnit.name is a URL.
Prevent CNFE when servlet class cannot be loaded
Modified: trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/core/jaxrpc/ServiceReferenceable.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -89,8 +89,8 @@
// The deployment URL of the web service client deployment
// Add a reference to the client deployment URL
- URL deploymentURL = udi.url;
- myRef.add(new StringRefAddr(DEPLOYMENT_URL, deploymentURL.toExternalForm()));
+ String deploymentID = udi.name;
+ myRef.add(new StringRefAddr(DEPLOYMENT_URL, deploymentID));
// Add a reference to the ServiceRefMetaData and WSDLDefinitions
myRef.add(new BinaryRefAddr(SERVICE_REF_META_DATA, marshallServiceRef()));
Modified:
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointPublisher.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -145,10 +145,22 @@
if (classElement == null)
continue;
- // Get the servlet class
String servletClassName = DOMUtils.getTextContent(classElement).trim();
- Class servletClass = (loader != null ? loader.loadClass(servletClassName) :
null);
+ // Get the servlet class
+ Class servletClass = null;
+ if (loader != null)
+ {
+ try
+ {
+ servletClass = loader.loadClass(servletClassName);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ log.warn("Cannot load servlet class: " + servletClassName);
+ }
+ }
+
String targetBeanName = null;
// Nothing to do if we have an <init-param>
Modified: trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/core/server/ServiceEndpointDeployer.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -73,7 +73,7 @@
public void create(UnifiedDeploymentInfo udi)
{
- log.debug("create: " + udi.url);
+ log.debug("create: " + udi.name);
try
{
UnifiedMetaData wsMetaData;
@@ -102,7 +102,7 @@
throw new IllegalStateException("Invalid type: " + udi.type);
}
- metaDataMap.put(udi.url.toExternalForm(), wsMetaData);
+ metaDataMap.put(udi.name, wsMetaData);
for (ServiceMetaData serviceMetaData : wsMetaData.getServices())
{
@@ -125,7 +125,7 @@
public void start(UnifiedDeploymentInfo udi)
{
- log.debug("start: " + udi.url);
+ log.debug("start: " + udi.name);
try
{
UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
@@ -160,7 +160,7 @@
public void stop(UnifiedDeploymentInfo udi)
{
- log.debug("stop: " + udi.url);
+ log.debug("stop: " + udi.name);
try
{
UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
@@ -193,7 +193,7 @@
public void destroy(UnifiedDeploymentInfo udi)
{
- log.debug("destroy: " + udi.url);
+ log.debug("destroy: " + udi.name);
try
{
UnifiedMetaData wsMetaData = getUnifiedMetaData(udi);
@@ -222,7 +222,7 @@
public UnifiedMetaData getUnifiedMetaData(UnifiedDeploymentInfo udi)
{
- UnifiedMetaData wsMetaData = metaDataMap.get(udi.url.toExternalForm());
+ UnifiedMetaData wsMetaData = metaDataMap.get(udi.name);
return wsMetaData;
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/core/server/UnifiedDeploymentInfo.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -52,9 +52,11 @@
/** Sub deployments have a parent */
public UnifiedDeploymentInfo parent;
/** The suffix of the deployment url */
- public String shortName;
- /** The URL identifing this deployment **/
+ public String simpleName;
+ /** The URL for this deployment */
public URL url;
+ /** The string identifing this deployment **/
+ public String name;
/** The URL to the expanded webapp **/
public URL expandedWebApp;
/** We can hold "typed" metadata */
@@ -67,7 +69,7 @@
/** The sortName concatenated with the canonical names of all parents. */
public String getCanonicalName()
{
- String name = shortName;
+ String name = simpleName;
if (parent != null)
name = parent.getCanonicalName() + "/" + name;
return name;
@@ -107,8 +109,8 @@
StringBuilder builder = new StringBuilder();
builder.append("[");
builder.append("type=" + type);
- builder.append(",shortName=" + shortName);
- builder.append(",url=" + url);
+ builder.append(",shortName=" + simpleName);
+ builder.append(",url=" + name);
builder.append("]");
return builder.toString();
}
Modified: trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/core/server/WSDLFilePublisher.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -71,7 +71,7 @@
{
this.udi = udi;
- String archiveName = udi.shortName;
+ String archiveName = udi.simpleName;
if (archiveName.endsWith(".jar") ||
archiveName.endsWith(".ejb3"))
expLocation = "META-INF/wsdl/";
else if (archiveName.endsWith(".war"))
@@ -245,7 +245,7 @@
*/
public void unpublishWsdlFiles() throws IOException
{
- String deploymentDir = (udi.parent != null ? udi.parent.shortName :
udi.shortName);
+ String deploymentDir = (udi.parent != null ? udi.parent.simpleName :
udi.simpleName);
ServerConfig config = ServerConfigFactory.getInstance().getServerConfig();
File serviceDir = new File(config.getServerDataDir().getCanonicalPath() +
"/wsdl/" + deploymentDir);
deleteWsdlPublishDirectory(serviceDir);
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractDeployer.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -52,65 +52,87 @@
@Override
public void deploy(DeploymentUnit unit) throws DeploymentException
{
- if (isWebServiceDeployment(unit))
- deployWebServiceDeployment(unit);
+ boolean isComponent = unit.getDeploymentContext().isComponent();
+ if (isComponent == false && isWebServiceDeployment(unit))
+ deployInternal(unit);
}
+ private void deployInternal(DeploymentUnit unit) throws DeploymentException
+ {
+ try
+ {
+ deployServiceEndpoint(unit);
+ }
+ catch (Exception ex)
+ {
+ UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(unit);
+ if (udi != null)
+ undeployInternal(unit, udi);
+
+ DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
+ }
+ }
+
/** Undeploy the web service endpoints if there are any
*/
@Override
public void undeploy(DeploymentUnit unit)
{
+ boolean isComponent = unit.getDeploymentContext().isComponent();
UnifiedDeploymentInfo udi = getUnifiedDeploymentInfo(unit);
- if (udi != null)
- undeployWebServiceDeployment(unit, udi);
+ if (isComponent == false && udi != null)
+ undeployInternal(unit, udi);
}
+ private void undeployInternal(DeploymentUnit unit, UnifiedDeploymentInfo udi)
+ {
+ undeployServiceEndpoint(unit, udi);
+ }
+
/** Create the unified deployment info from the deployment unit
*/
- protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit
unit);
+ protected abstract UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit
unit) throws DeploymentException;
/** Create the unified deployment info and create the service endpoints
* through the ServiceEndpointDeployer
*/
- protected void deployWebServiceDeployment(DeploymentUnit unit) throws
DeploymentException
+ protected void deployServiceEndpoint(DeploymentUnit unit) throws DeploymentException
{
UnifiedDeploymentInfo udi = createUnifiedDeploymentInfo(unit);
unit.addAttachment(UnifiedDeploymentInfo.class, udi);
-
createServiceEndpoint(udi, unit);
}
/** Stop and destroy the service endpoints through the ServiceEndpointDeployer
*/
- protected void undeployWebServiceDeployment(DeploymentUnit unit, UnifiedDeploymentInfo
udi)
+ protected void undeployServiceEndpoint(DeploymentUnit unit, UnifiedDeploymentInfo
udi)
{
destroyServiceEndpoint(udi, unit);
}
protected void createServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws DeploymentException
{
- log.debug("createServiceEndpoint: " + udi.getCanonicalName());
+ log.debug("Create ServiceEndpoint: " + udi.getCanonicalName());
getServiceEndpointDeployer().create(udi);
}
protected void destroyServiceEndpoint(UnifiedDeploymentInfo udi, DeploymentUnit unit)
{
- log.debug("destroyServiceEndpoint: " + udi.getCanonicalName());
+ log.debug("Destroy ServiceEndpoint: " + udi.getCanonicalName());
getServiceEndpointDeployer().destroy(udi);
}
/** Override to provide the deployment type
*/
protected abstract DeploymentType getDeploymentType();
-
+
protected UnifiedDeploymentInfo getUnifiedDeploymentInfo(DeploymentUnit unit)
{
UnifiedDeploymentInfo udi = unit.getAttachment(UnifiedDeploymentInfo.class);
return (udi != null && udi.type == getDeploymentType() ? udi : null);
-
+
}
-
+
protected ServiceEndpointDeployer getServiceEndpointDeployer()
{
KernelRegistry registry = KernelLocator.getKernel().getRegistry();
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/AbstractJSEDeployer.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -23,30 +23,17 @@
//$Id$
-import java.io.File;
-import java.io.FileOutputStream;
import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.Enumeration;
import java.util.Iterator;
import java.util.Set;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import javax.jws.WebService;
-
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.NameValuePair;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.web.Servlet;
-import org.jboss.virtual.VirtualFile;
import org.jboss.ws.WSException;
-import org.jboss.ws.core.server.ServerConfig;
-import org.jboss.ws.core.server.ServerConfigFactory;
import org.jboss.ws.core.server.UnifiedDeploymentInfo;
-import org.jboss.ws.core.utils.IOUtils;
/**
* An abstract deployer for JSE Endpoints
@@ -69,10 +56,10 @@
* through the ServiceEndpointDeployer
*/
@Override
- protected void deployWebServiceDeployment(DeploymentUnit unit) throws
DeploymentException
+ protected void deployServiceEndpoint(DeploymentUnit unit) throws DeploymentException
{
// Call the super implementation
- super.deployWebServiceDeployment(unit);
+ super.deployServiceEndpoint(unit);
// FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
String altDD = generateAltDD(unit);
@@ -101,10 +88,10 @@
}
@Override
- protected void undeployWebServiceDeployment(DeploymentUnit unit, UnifiedDeploymentInfo
udi)
+ protected void undeployServiceEndpoint(DeploymentUnit unit, UnifiedDeploymentInfo
udi)
{
// Call the super implementation
- super.undeployWebServiceDeployment(unit, udi);
+ super.undeployServiceEndpoint(unit, udi);
}
private void modifyWebMetaData(DeploymentUnit unit, String altDD) throws
DeploymentException
@@ -115,30 +102,26 @@
if (allMetaData.size() > 0)
{
WebMetaData webMetaData = allMetaData.iterator().next();
- ClassLoader anLoader = unit.getClassLoader();
String serviceEndpointServlet =
getServiceEndpointPublisher().getServiceEndpointServlet();
Iterator it = webMetaData.getServlets().iterator();
while (it.hasNext())
{
Servlet servlet = (Servlet)it.next();
- String className = servlet.getServletClass();
+ String servletClassName = servlet.getServletClass();
// JSP
- if (className == null || className.length() == 0)
+ if (servletClassName == null)
continue;
- Class<?> servletClass = anLoader.loadClass(className);
- if (servletClass.isAnnotationPresent(WebService.class))
+ // Nothing to do if we have an <init-param>
+ if (isAlreadyModified(servlet) == false)
{
- // Nothing to do if we have an <init-param>
- if (isAlreadyModified(servlet) == false)
- {
- servlet.setServletClass(serviceEndpointServlet);
- NameValuePair initParam = new
NameValuePair(INIT_PARAM_SERVICE_ENDPOINT_IMPL, className);
- servlet.addInitParam(initParam);
- }
+ servlet.setServletClass(serviceEndpointServlet);
+ NameValuePair initParam = new
NameValuePair(INIT_PARAM_SERVICE_ENDPOINT_IMPL, servletClassName);
+ servlet.addInitParam(initParam);
}
+
// FIXME: JBAS-3812 - TomcatDeployment should use modified WebMetaData
webMetaData.setAltDDPath(altDD);
}
@@ -161,63 +144,4 @@
}
return false;
}
-
- private URL expandWebDeployment(DeploymentUnit unit) throws DeploymentException
- {
- URL expWebAppURL = null;
- try
- {
- VirtualFile virtualWarFile = unit.getDeploymentContext().getRoot();
- // FIXME: JBAS-3811 - VirtualFile.getPathName() returns empty string for jar
files
- // String warPathName = virtualWarFile.getPathName();
-
- String warPathName = virtualWarFile.toURL().toExternalForm();
- if (warPathName.startsWith("jar:") &&
warPathName.endsWith("!/"))
- warPathName = warPathName.substring(4,
warPathName.lastIndexOf("!/"));
- if (warPathName.startsWith("file:"))
- warPathName = new URL(warPathName).getFile();
-
- String warShortName = virtualWarFile.getName();
- File warFile = new File(warPathName);
- if (warFile.exists() == false)
- throw new IllegalStateException("WAR file does not exist: " +
warPathName);
-
- if (warFile.isDirectory() == false)
- {
- ServerConfigFactory factory = ServerConfigFactory.getInstance();
- ServerConfig config = factory.getServerConfig();
- File tmpdir = new File(config.getServerTempDir().getCanonicalPath() +
"/deploy");
-
- File tmpWar = File.createTempFile(warShortName, ".war", tmpdir);
- tmpWar.delete();
-
- log.debug("Expand war to: " + tmpWar);
-
- ZipFile zipFile = new ZipFile(warFile);
- Enumeration en = zipFile.entries();
- while (en.hasMoreElements())
- {
- ZipEntry entry = (ZipEntry)en.nextElement();
- String entryName = entry.getName();
- if (entry.isDirectory() == false)
- {
- File entryFile = new File(tmpWar.getAbsolutePath() + "/" +
entryName);
- entryFile.getParentFile().mkdirs();
- OutputStream fos = new FileOutputStream(entryFile);
- InputStream fis = zipFile.getInputStream(entry);
- IOUtils.copyStream(fos, fis);
- fos.close();
- fis.close();
- }
- }
-
- expWebAppURL = tmpWar.toURL();
- }
- }
- catch (Exception ex)
- {
- DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
- }
- return expWebAppURL;
- }
}
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/DeploymentInfoAdaptor.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -23,8 +23,8 @@
import java.net.URL;
import java.net.URLClassLoader;
-import java.util.Set;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.ejb3.Ejb3Deployment;
import org.jboss.logging.Logger;
@@ -45,44 +45,31 @@
// logging support
private static Logger log = Logger.getLogger(DeploymentInfoAdaptor.class);
- public static UnifiedDeploymentInfo buildDeploymentInfo(UnifiedDeploymentInfo udi,
DeploymentUnit unit)
+ public static void buildDeploymentInfo(UnifiedDeploymentInfo udi, DeploymentUnit unit)
throws DeploymentException
{
- if (unit.getDeploymentContext().getParent() != null)
+ try
{
- udi.parent = new UnifiedDeploymentInfo(null);
- buildDeploymentInfo(udi.parent,
unit.getDeploymentContext().getParent().getDeploymentUnit());
- }
+ if (unit.getDeploymentContext().getParent() != null)
+ {
+ udi.parent = new UnifiedDeploymentInfo(null);
+ buildDeploymentInfo(udi.parent,
unit.getDeploymentContext().getParent().getDeploymentUnit());
+ }
- udi.shortName = getShortName(unit);
- udi.url = getDeploymentURL(unit);
- udi.metaData = buildMetaData(unit);
+ udi.name = unit.getName();
+ udi.simpleName = unit.getSimpleName();
+ udi.url = unit.getDeploymentContext().getRoot().toURL();
+ udi.metaData = buildMetaData(unit);
- // Since we create temporary classes, we need to create a delegate loader
- // This prevents CCE problems where the parent loader is available at deploy time,
- // and a child loader is available at start time.
- udi.classLoader = new URLClassLoader(new URL[]{}, unit.getClassLoader());
-
- log.debug("UnifiedDeploymentInfo:\n" + udi);
-
- return udi;
- }
-
- private static String getShortName(DeploymentUnit unit)
- {
- String shortName = unit.getDeploymentContext().getRoot().getName();
- return shortName;
- }
-
- private static URL getDeploymentURL(DeploymentUnit unit)
- {
- try
- {
- URL url = new URL(unit.getName());
- return url;
+ // Since we create temporary classes, we need to create a delegate loader
+ // This prevents CCE problems where the parent loader is available at deploy
time,
+ // and a child loader is available at start time.
+ udi.classLoader = new URLClassLoader(new URL[]{}, unit.getClassLoader());
+
+ log.debug("UnifiedDeploymentInfo:\n" + udi);
}
catch (Exception ex)
{
- throw new IllegalStateException("Cannot get deployment url", ex);
+ DeploymentException.rethrowAsDeploymentException(ex.getMessage(), ex);
}
}
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXRPCDeployerJSE.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -26,6 +26,7 @@
import java.net.URL;
import java.util.Set;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.virtual.VirtualFile;
@@ -50,12 +51,12 @@
@Override
public boolean isWebServiceDeployment(DeploymentUnit unit)
{
- Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
- return allMetaData.size() > 0 && getWebServicesURL(unit) != null;
+ boolean hasWebMetaData = unit.getAllMetaData(WebMetaData.class).size() > 0;
+ return hasWebMetaData && getWebServicesURL(unit) != null;
}
@Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
{
URL webservicesUrl = getWebServicesURL(unit);
UnifiedDeploymentInfo udi = new JAXRPCDeployment(getDeploymentType(),
webservicesUrl);
@@ -65,22 +66,19 @@
private URL getWebServicesURL(DeploymentUnit unit)
{
+ URL webservicesURL = null;
VirtualFile vfile = unit.getMetaDataFile("webservices.xml");
if (vfile != null)
{
try
{
- String urlStr = vfile.toURL().toExternalForm();
- if (urlStr.startsWith("jar:") &&
urlStr.endsWith("!/"))
- urlStr = urlStr.substring(4, urlStr.length() - 2);
-
- return new URL(urlStr);
+ webservicesURL = vfile.toURL();
}
catch (Exception ex)
{
// ignore
}
}
- return null;
+ return webservicesURL;
}
}
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerEJB3.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -28,6 +28,7 @@
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.ejb3.EJBContainer;
import org.jboss.ejb3.Ejb3Deployment;
@@ -51,7 +52,7 @@
}
@Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
{
UnifiedDeploymentInfo udi = new JAXWSDeployment(getDeploymentType());
DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
Modified: trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/integration/jboss50/JAXWSDeployerJSE.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -29,6 +29,7 @@
import javax.jws.WebService;
import javax.xml.ws.WebServiceProvider;
+import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.metadata.WebMetaData;
import org.jboss.metadata.web.Servlet;
@@ -90,7 +91,7 @@
}
@Override
- protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
+ protected UnifiedDeploymentInfo createUnifiedDeploymentInfo(DeploymentUnit unit)
throws DeploymentException
{
UnifiedDeploymentInfo udi = new JAXWSDeployment(getDeploymentType());
DeploymentInfoAdaptor.buildDeploymentInfo(udi, unit);
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointInvokerEJB3.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -64,10 +64,10 @@
String ejbName = seInfo.getServerEndpointMetaData().getLinkName();
UnifiedDeploymentInfo udi = seInfo.getUnifiedDeploymentInfo();
- String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.shortName;
+ String nameStr = "jboss.j2ee:name=" + ejbName +
",service=EJB3,jar=" + udi.simpleName;
if (udi.parent != null)
{
- nameStr += ",ear=" + udi.parent.shortName;
+ nameStr += ",ear=" + udi.parent.simpleName;
}
objectName = ObjectNameFactory.create(nameStr.toString());
Modified:
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/integration/jboss50/ServiceEndpointLifecycleDeployer.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -49,7 +49,7 @@
public void deploy(DeploymentUnit unit) throws DeploymentException
{
UnifiedDeploymentInfo udi = unit.getAttachment(UnifiedDeploymentInfo.class);
- if (udi != null)
+ if (udi != null && udi.name.equals(unit.getName()))
{
// Get the webapp context classloader and use it as the deploymet class loader
Set<? extends WebMetaData> allMetaData =
unit.getAllMetaData(WebMetaData.class);
@@ -58,8 +58,8 @@
WebMetaData webMetaData = allMetaData.iterator().next();
udi.classLoader = webMetaData.getContextLoader();
}
-
- log.debug("startServiceEndpoint: " + udi.getCanonicalName());
+
+ log.debug("Start ServiceEndpoint: " + udi.getCanonicalName());
getServiceEndpointDeployer().start(udi);
}
}
@@ -70,9 +70,9 @@
public void undeploy(DeploymentUnit unit)
{
UnifiedDeploymentInfo udi = unit.getAttachment(UnifiedDeploymentInfo.class);
- if (udi != null)
+ if (udi != null && udi.name.equals(unit.getName()))
{
- log.debug("stopServiceEndpoint: " + udi.getCanonicalName());
+ log.debug("Stop ServiceEndpoint: " + udi.getCanonicalName());
getServiceEndpointDeployer().stop(udi);
}
}
Modified: trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/integration/tomcat/DeploymentInfoAdaptor.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -68,8 +68,8 @@
String shortName = getContextRoot(warURL);
shortName = shortName.substring(1) + ".war";
- udi.shortName = shortName;
- udi.url = warURL;
+ udi.simpleName = shortName;
+ //udi.url = warURL;
udi.metaData = buildWebMetaData(udi, ctx);
udi.classLoader = loader;
@@ -83,7 +83,7 @@
UnifiedWebMetaData wmd = new UnifiedWebMetaData();
wmd.setServletMappings(getServetMappings(webXML));
wmd.setServletClassNames(getServetClassMap(webXML));
- wmd.setContextRoot(getContextRoot(udi.url));
+ //wmd.setContextRoot(getContextRoot(udi.url));
wmd.setConfigName(ctx.getInitParameter("jbossws-config-name"));
wmd.setConfigFile(ctx.getInitParameter("jbossws-config-file"));
wmd.setSecurityMetaData(getSecurityMetaData(webXML));
Modified:
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/integration/tomcat/TomcatServiceEndpointServlet.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -161,10 +161,10 @@
UnifiedDeploymentInfo udi;
URLClassLoader ctxLoader =
(URLClassLoader)Thread.currentThread().getContextClassLoader();
- URL webservices109URL =
ctxLoader.findResource("WEB-INF/webservices.xml");
- if (webservices109URL != null)
+ URL webservicesURL = ctxLoader.findResource("WEB-INF/webservices.xml");
+ if (webservicesURL != null)
{
- udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
webservices109URL);
+ udi = new JAXRPCDeployment(UnifiedDeploymentInfo.DeploymentType.JAXRPC_JSE,
webservicesURL);
}
else
{
Modified: trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-18
15:58:28 UTC (rev 1666)
+++ trunk/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -152,11 +152,11 @@
contextRoot = "/";
if (udi.parent != null)
{
- String shortName = udi.parent.shortName;
+ String shortName = udi.parent.simpleName;
shortName = shortName.substring(0, shortName.indexOf('.'));
contextRoot += shortName + "-";
}
- String shortName = udi.shortName;
+ String shortName = udi.simpleName;
shortName = shortName.substring(0, shortName.indexOf('.'));
contextRoot += shortName;
}
Modified: trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java
===================================================================
---
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2006-12-18
15:58:28 UTC (rev 1666)
+++
trunk/src/main/java/org/jboss/ws/metadata/webservices/WebservicesFactory.java 2006-12-18
19:35:55 UTC (rev 1667)
@@ -26,6 +26,7 @@
import java.net.URL;
import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
import org.jboss.ws.metadata.j2ee.UnifiedHandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaData.HandlerInitParam;
import org.jboss.xb.binding.ObjectModelFactory;