Hi David, I do not see CXF in your stack trace. Are you sure that you have CXF jars in classpath? Actually it looks that you use default JDK jaxws implementation.
Regards, Andrei. > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Donnerstag, 10. April 2014 19:59 > To: [email protected] > Subject: Getting java.lang.ClassCast Exception: javax.xml.ws.Holder cannot be > cast to java.lang.String > > 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(RddsReqProc > essor.java:691) > at > com.telus.health.pdd.access.DbRequestHandler.processRequest(DbRequestHan > dler.java:391) > at > com.telus.health.pdd.access.DbRequestHandler.main(DbRequestHandler.java:1 > 39) > 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.j > ava: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(FieldA > ccessor_Ref.java:45) > at > com.sun.xml.internal.bind.v2.runtime.reflect.Accessor.setUnadapted(Accessor.j > ava: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:2 > 07) > at > com.sun.xml.internal.ws.client.sei.BodyBuilder$JAXB.createMessage(BodyBuild > er.java:88) > at > com.sun.xml.internal.ws.client.sei.SEIMethodHandler.createRequestMessage(S > EIMethodHandler.java:204) > at > com.sun.xml.internal.ws.client.sei.AsyncMethodHandler$SEIAsyncInvoker.do_ru > n(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 > > > > -- > View this message in context: http://cxf.547215.n5.nabble.com/Getting-java- > lang-ClassCast-Exception-javax-xml-ws-Holder-cannot-be-cast-to-java-lang- > String-tp5742667.html > Sent from the cxf-user mailing list archive at Nabble.com.
