Author: jim.ma
Date: 2015-03-30 09:17:24 -0400 (Mon, 30 Mar 2015)
New Revision: 19608
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/JBossWSInvokerTest.java
Log:
[JBWS-3900]:Throw proper exception instead of NPE for wrong url access
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java
===================================================================
---
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2015-03-30
08:47:32 UTC (rev 19607)
+++
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Messages.java 2015-03-30
13:17:24 UTC (rev 19608)
@@ -217,4 +217,7 @@
@Message(id = 24104, value = "Service class %s is missing required JAX-WS 2.2
additional constructors")
WSFException missingJAXWS22ServiceConstructor(String className, @Cause Throwable
cause);
+
+ @Message(id = 24108, value = "BindingOperation and dispatched method is missing
for service implementation invocation")
+ IllegalArgumentException missingBindingOpeartionAndDispatchedMethod();
}
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java
===================================================================
---
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java 2015-03-30
08:47:32 UTC (rev 19607)
+++
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/JBossWSInvoker.java 2015-03-30
13:17:24 UTC (rev 19608)
@@ -143,6 +143,11 @@
{
CallbackHandlerPolicyContextHandler.setCallbackHandler(cbHandler);
}
+ Method method = bop == null ? null : md.getMethod(bop);
+ if (bop == null && method == null)
+ {
+ throw Messages.MESSAGES.missingBindingOpeartionAndDispatchedMethod();
+ }
obj = invoke(exchange, targetBean,
adjustMethodAndParams(md.getMethod(bop), exchange, params,
targetBean.getClass()), params);
}
Modified:
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/JBossWSInvokerTest.java
===================================================================
---
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/JBossWSInvokerTest.java 2015-03-30
08:47:32 UTC (rev 19607)
+++
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/JBossWSInvokerTest.java 2015-03-30
13:17:24 UTC (rev 19608)
@@ -84,6 +84,7 @@
Message message = new MessageImpl();
message.setExchange(exchange);
exchange.setInMessage(message);
+ exchange.put(BindingOperationInfo.class, new BindingOperationInfo());
Service service = new ServiceImpl();
MethodDispatcher md = new MethodDispatcher() {
@Override
Show replies by date