nicer error message indicating JAX-WS 2.1 requirement at runtime (SPR-8998)

This commit is contained in:
Juergen Hoeller 2012-01-15 14:50:42 +01:00
parent b91e989ad4
commit 96b8c46480
1 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2010 the original author or authors. * Copyright 2002-2012 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -407,7 +407,13 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
*/ */
protected Object getPortStub(Service service, QName portQName) { protected Object getPortStub(Service service, QName portQName) {
if (this.webServiceFeatures != null) { if (this.webServiceFeatures != null) {
return new FeaturePortProvider().getPortStub(service, portQName, this.webServiceFeatures); try {
return new FeaturePortProvider().getPortStub(service, portQName, this.webServiceFeatures);
}
catch (LinkageError ex) {
throw new IllegalStateException(
"Specifying the 'webServiceFeatures' property requires JAX-WS 2.1 or higher at runtime", ex);
}
} }
else { else {
return (portQName != null ? service.getPort(portQName, getServiceInterface()) : return (portQName != null ? service.getPort(portQName, getServiceInterface()) :
@ -527,6 +533,7 @@ public class JaxWsPortClientInterceptor extends LocalJaxWsServiceFactory
} }
} }
/** /**
* Inner class in order to avoid a hard-coded JAX-WS 2.1 dependency. * Inner class in order to avoid a hard-coded JAX-WS 2.1 dependency.
* JAX-WS 2.0, as used in Java EE 5, didn't have WebServiceFeatures yet... * JAX-WS 2.0, as used in Java EE 5, didn't have WebServiceFeatures yet...