Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Getting java.lang.ClassCast Exception: javax.xml.ws.Holder cannot be cast to java.lang.String

$
0
0
Hi CXF Community,

I've been working with CXF for a several months now on a NonStop server.
I've built sychronous demo clients and servlets with no problems. I'm now
trying to build an asynchronous client but I can't seem to get past the
following ClassCastException which occurs as soon as I call...

AsyncDemoResponse0 reply = asyncDemoResp.get();

i.e., same point as GreetMeSometimeResponse reply =
greetMeSomeTimeResp.get(); from example page.

Just like in the Async Consumer example page, wsl2java generates 3 method in
the web service interface class, i.e., synchronous, polling and callback.
When I invoke the synchronous form everything works fine.

My thought is this is a newbie error but if this description is not obvious,
I can provide more information on advisement.

Also note when I call my /Response<GreetMeSometimeResponse>
greetMeSomeTimeResp =
port.greetMeSometimeAsync(System.getProperty("user.name"));
/*equivalent*, namely, (/Response<AsyncDemoResponse0> asyncDemoResp =
asyncDemoPort.asyncDemoAsync(_asyncDemo_clientNo, _asyncDemo_groupNo,
_asyncDemo_certNo/); no activity is detected on the servlet (service) side,
i.e., nothing appears in the web server's access.log.

Any thought would be appreciated.

=2014-04-10 13:50:18,485 ERROR [main] trace.event - Web Service
invocation error (javax.xml.ws.WebServiceException:
java.lang.ClassCastException: javax.xml.ws.Holder cannot be cast to
java.lang.String).
java.util.concurrent.ExecutionException: javax.xml.ws.WebServiceException:
java.lang.ClassCastException: javax.xml.ws.Holder cannot be cast to
java.lang.String
at
java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at
com.telus.health.pdd.business.RddsReqProcessor.processRequest(RddsReqProcessor.java:691)
at
com.telus.health.pdd.access.DbRequestHandler.processRequest(DbRequestHandler.java:391)
at
com.telus.health.pdd.access.DbRequestHandler.main(DbRequestHandler.java:139)
Caused by: javax.xml.ws.WebServiceException: java.lang.ClassCastException:
javax.xml.ws.Holder cannot be cast to java.lang.String
at
com.sun.xml.internal.ws.client.AsyncInvoker.run(AsyncInvoker.java:59)
at
com.sun.xml.internal.ws.client.AsyncResponseImpl.run(AsyncResponseImpl.java:73)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: javax.xml.ws.Holder cannot be cast
to java.lang.String
at
com.telus.health.pdd.asyncdemo.AsyncDemo$JaxbAccessorF_certNo.set(FieldAccessor_Ref.java:45)
at
com.sun.xml.internal.bind.v2.runtime.reflect.Accessor.setUnadapted(Accessor.java:155)
at
com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$7.set(JAXBContextImpl.java:926)
at
com.sun.xml.internal.ws.client.sei.BodyBuilder$DocLit.build(BodyBuilder.java:207)
at
com.sun.xml.internal.ws.client.sei.BodyBuilder$JAXB.createMessage(BodyBuilder.java:88)
at
com.sun.xml.internal.ws.client.sei.SEIMethodHandler.createRequestMessage(SEIMethodHandler.java:204)
at
com.sun.xml.internal.ws.client.sei.AsyncMethodHandler$SEIAsyncInvoker.do_run(AsyncMethodHandler.java:147)
at
com.sun.xml.internal.ws.client.AsyncInvoker.run(AsyncInvoker.java:54)
... 4 more

Final note: the the only alteration I made to support asynchronous web
service on the service (servlet) side was the inclusion of
<async-supported>true</async-supported> in the deplyment descriptor
(web.xml).

David

Viewing all articles
Browse latest Browse all 5648

Trending Articles