Author: klape
Date: 2012-07-20 14:54:15 -0400 (Fri, 20 Jul 2012)
New Revision: 16511
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
Log:
[JBPAPP-9545] Improve error message for bad class names in @WebService.endpointInterface
Modified:
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java
===================================================================
---
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2012-07-20
17:00:44 UTC (rev 16510)
+++
stack/native/branches/jbossws-native-3.1.2/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxws/JAXWSWebServiceMetaDataBuilder.java 2012-07-20
18:54:15 UTC (rev 16511)
@@ -293,7 +293,7 @@
}
}
- private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData,
Class<?> sepClass, String linkName) throws ClassNotFoundException, IOException
+ private EndpointResult processWebService(Deployment dep, UnifiedMetaData wsMetaData,
Class<?> sepClass, String linkName) throws IOException
{
WebService anWebService = sepClass.getAnnotation(WebService.class);
WebServiceProvider anWebServiceProvider =
sepClass.getAnnotation(WebServiceProvider.class);
@@ -332,7 +332,18 @@
if(null == runtimeClassLoader)
throw new IllegalArgumentException("Runtime loader cannot be
null");
- seiClass = runtimeClassLoader.loadClass(seiName);
+ try
+ {
+ seiClass = runtimeClassLoader.loadClass(seiName);
+ }
+ catch(ClassNotFoundException cnfe)
+ {
+ String msg = "Cannot find class \"" + cnfe.getMessage() +
"\" specified in @WebService.endpointInterface.";
+ if(cnfe.getMessage() != null &&
(!cnfe.getMessage().contains(".")))
+ msg += " Did you use the fully qualified class name?";
+ throw new WSException(msg);
+ }
+
WebService seiAnnotation = seiClass.getAnnotation(WebService.class);
if (seiAnnotation == null)