Exception
I got this exception while using Apache CXF service. I was trying to use cxf endpoint to add some interceptors as shown on page.
1 2 3 4 5 | org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getClient(port); org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint(); |
But I was getting this exception continously
1 2 3 4 | Caused by: java.lang.ClassCastException: com.sun.xml.internal.ws.client.sei.SEIStub cannot be cast to org.apache.cxf.frontend.ClientProxy |
I had added the following dependencies in my POM
1 2 3 4 5 6 7 8 9 10 11 | <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-simple</artifactId> <version>${cxf.version}</version> </dependency> |
The error got resolved when I changed it to
1 2 3 4 5 6 7 8 9 10 11 | <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>${cxf.version}</version> </dependency> |