cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vanyatka <>
Subject ClassCastException prevents thorough endpoint testing
Date Sat, 29 May 2010 22:59:36 GMT


Just ran into the problem of testing endpoint when the endpoint method
should throw business exception. In the Integration Test I have to catch &
verify this exception. To my frustration, the call on the endpoint does not
throw desired exception, but rather 

java.lang.ClassCastException: java.lang.Class cannot be cast to

The endpoint configuration (client test side) is done via Spring, as

    <jaxrs:client id="helloWorldEndpoint" 

In the business scenario when endpoint finishes normally, the test works
fine, endpoint returns Response object.

Tried to register ResponseExceptionMapper, but no avail, ClassCastException
issue persists.

Any suggestions on what could be the matter and how to make IT tests handle
exceptions in endpoints are very welcome :thinking:

View this message in context:
Sent from the cxf-user mailing list archive at

View raw message