Author: alessio.soldano(a)jboss.com
Date: 2011-06-11 14:41:29 -0400 (Sat, 11 Jun 2011)
New Revision: 14528
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
Log:
[JBWS-3286][JBWS-3282] Do not force deployment failure on exception in creating handler
from domain config and try ASIL classloader too for getting instances of handlers
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2011-06-11
16:38:28 UTC (rev 14527)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2011-06-11
18:41:29 UTC (rev 14528)
@@ -37,6 +37,8 @@
import org.apache.cxf.jaxws.support.JaxWsImplementorInfo;
import org.apache.cxf.service.Service;
import org.jboss.logging.Logger;
+import org.jboss.ws.common.utils.DelegateClassLoader;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.metadata.config.CommonConfig;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
@@ -135,14 +137,17 @@
Logger.getLogger(this.getClass()).warn("Init params not
supported.");
}
Object h = newInstance(uhmd.getHandlerClass());
- if (h instanceof Handler)
+ if (h != null)
{
- handlers.add((Handler)h);
+ if (h instanceof Handler)
+ {
+ handlers.add((Handler)h);
+ }
+ else
+ {
+ throw new RuntimeException(h + " is not a JAX-WS Handler
instance!");
+ }
}
- else
- {
- throw new RuntimeException(h + " is not a JAX-WS Handler
instance!");
- }
}
}
}
@@ -153,12 +158,15 @@
{
try
{
- Class<?> clazz =
SecurityActions.getContextClassLoader().loadClass(className);
+ ClassLoader loader = new
DelegateClassLoader(ClassLoaderProvider.getDefaultProvider()
+ .getServerIntegrationClassLoader(),
SecurityActions.getContextClassLoader());
+ Class<?> clazz = loader.loadClass(className);
return clazz.newInstance();
}
catch (Exception e)
{
- throw new RuntimeException(e);
+ Logger.getLogger(EndpointImpl.class).warnf(e, "Could not add handler
'%s' as part of endpoint configuration", className);
+ return null;
}
}
Show replies by date