Author: jim.ma
Date: 2012-01-30 22:08:03 -0500 (Mon, 30 Jan 2012)
New Revision: 15545
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
Log:
[JBWS-3395]:Avoid CXFInstanceProvider thowing NPE when the endpoint ServiceBean is not
available
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java 2012-01-30
17:47:15 UTC (rev 15544)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/CXFInstanceProviderDeploymentAspect.java 2012-01-31
03:08:03 UTC (rev 15545)
@@ -22,12 +22,17 @@
package org.jboss.wsf.stack.cxf.deployment.aspect;
+import java.util.ResourceBundle;
+
import org.apache.cxf.frontend.ServerFactoryBean;
+import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.integration.AbstractDeploymentAspect;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.stack.cxf.CXFInstanceProvider;
+import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
+
/**
* Instance provider DA.
*
@@ -35,14 +40,19 @@
*/
public final class CXFInstanceProviderDeploymentAspect extends AbstractDeploymentAspect
{
-
+ private static final ResourceBundle bundle =
BundleUtils.getBundle(CXFInstanceProviderDeploymentAspect.class);
@Override
public void start(final Deployment dep)
{
for (final Endpoint ep : dep.getService().getEndpoints())
{
final ServerFactoryBean factory = ep.getAttachment(ServerFactoryBean.class);
- ep.setInstanceProvider(new CXFInstanceProvider(factory));
+ //TODO: remove this after JBWS-3396 resolved
+ if (factory == null && SpringUtils.isSpringAvailable())
+ {
+ throw new IllegalStateException(BundleUtils.getMessage(bundle,
"SPRING_ENDPOINT_NOT_DEFINED", ep.getTargetBeanName()));
+ }
+ ep.setInstanceProvider(new CXFInstanceProvider(factory));
}
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2012-01-30
17:47:15 UTC (rev 15544)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/Message.properties 2012-01-31
03:08:03 UTC (rev 15545)
@@ -1 +1,2 @@
UNSUPPORTED_DEPLOYMENT_TYPE=Unsupported deployment type: {0}
+SPRING_ENDPOINT_NOT_DEFINED=Endpoint {0} is not defined in jbossws-cxf.xml
\ No newline at end of file
Show replies by date