• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javax.xml.ws.AsyncHandler is an interface, and JAXB can't handle interfaces

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am trying to implement a JAX-WS web service as asynchronous.
I have implemented the client side code as follows:

/*-------------------------------------------------------------------------------
CallbackHandler callbackHandler = new CallbackHandler ();
Future<?> resp = serverProxy.validateAsAsync(request, callbackHandler);
response = callbackHandler.getResponse();
//*--------------------------------------------------------------------------------

class CallbackHandler implements AsyncHandler<MyResponse> {
private MyResponse output;
public void handleResponse(Response<MyResponse> response) {
try {
output = response.get();
}catch (ExecutionException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}

MyResponsegetResponse() {
return output;
}
}

The SEI looks like below
@WebMethod
public Future<?> validateAsAsync(
@WebParam(name = "MyRequest", targetNamespace = "", partName = "parameter")
MyRequest parameter,
@WebParam(name = "callbackhandler", targetNamespace = "", partName = "asyncHandler")
AsyncHandler<MyResponse> asyncHandler);

I am getting the following error:
Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions
javax.xml.ws.AsyncHandler is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.xml.ws.AsyncHandler
at private javax.xml.ws.AsyncHandler jaxws.ValidateAsAsync.callbackhandler

Looks like Jax-WS is not able to create the Jax-B object for ASyncHandler since it is an interface, how to get around this issue?
I really appreciate your help.

Thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic