cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted <r6squee...@gmail.com>
Subject org.w3._2001.xmlschema.Adapter1 is not applicable to the field type java.util.Calendar.
Date Thu, 24 Mar 2011 10:22:16 GMT
Hi I'm having a problem and I couldn't find anything in web searches..

I'm running CXF 2.3.2 on both the client and server.

I have a web service which sends an object which happens to contain a date
in the form of a Calendar and it appears one of my clients can't sort it out
but I'm not 100% sure about what the error message really means.

When I build my client stubs I use the following binding customisation.

<jxb:bindings version="1.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <jxb:bindings>
    <jxb:globalBindings xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <jxb:javaType name="java.util.Calendar" xmlType="xs:dateTime"
          parseMethod="javax.xml.bind.DatatypeConverter.parseDateTime"
        printMethod="javax.xml.bind.DatatypeConverter.printDateTime"/>
    </jxb:globalBindings>
  </jxb:bindings>
</jxb:bindings>

I've built the server, and it works fine, I've built the client stubs and
I've built 1 client application and it also works fine. No problems at all.

I'm integrating the client stubs into a second client application. I'm using
the exact same server and exact same wsdl's and method calls but now I have
problems. It appears it doesn't know how to deal with the Calendar object
that's being sent in the response from the server. The stack trace is as
follows :

javax.xml.ws.WebServiceException:
org.apache.cxf.service.factory.ServiceConstructionException
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:338)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:323)
    at javax.xml.ws.Service.getPort(Service.java:92)
    at org.oscarehr.myoscar_server.ws.LoginWsService.getLoginWsPort(Unknown
Source)
    at
org.oscarehr.phr.util.MyOscarServerWebServicesManager.getLoginWs(MyOscarServerWebServicesManager.java:59)
    at
org.oscarehr.phr.service.PHRService.authenticateIndivoId(PHRService.java:164)
    at org.oscarehr.phr.service.PHRService.authenticate(PHRService.java:147)
    at org.oscarehr.phr.web.PHRLoginAction.execute(PHRLoginAction.java:94)
    at
org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)
    at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
    at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
    at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at oscar.oscarSecurity.LoginFilter.doFilter(LoginFilter.java:101)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
net.sf.cookierevolver.servlet.CRFilterImpl.doFilter(CRFilterImpl.java:60)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.oscarehr.util.LoggedInUserFilter.doFilter(LoggedInUserFilter.java:63)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.oscarehr.util.DbConnectionFilter.doFilter(DbConnectionFilter.java:64)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.oscarehr.util.ResponseDefaultsFilter.doFilter(ResponseDefaultsFilter.java:44)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
    at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException
    at
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:341)
    at
org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:87)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:407)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:506)
    at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:245)
    at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:202)
    at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
    at
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:90)
    at
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:117)
    at
org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:124)
    at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:471)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336)
    ... 45 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 6 counts
of IllegalAnnotationExceptions
Adapter org.w3._2001.xmlschema.Adapter1 is not applicable to the field type
java.util.Calendar.
    this problem is related to the following location:
        at @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(type=class
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT, value=class
org.w3._2001.xmlschema.Adapter1)
        at protected java.util.Calendar
org.oscarehr.myoscar_server.ws.PersonTransfer.birthDate
        at org.oscarehr.myoscar_server.ws.PersonTransfer
        at protected org.oscarehr.myoscar_server.ws.PersonTransfer
org.oscarehr.myoscar_server.ws.LoginResponse._return
        at org.oscarehr.myoscar_server.ws.LoginResponse
Adapter org.w3._2001.xmlschema.Adapter1 is not applicable to the field type
java.util.Calendar.
    this problem is related to the following location:
        at @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(type=class
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT, value=class
org.w3._2001.xmlschema.Adapter1)
        at protected java.util.Calendar
org.oscarehr.myoscar_server.ws.PersonTransfer.editDate
        at org.oscarehr.myoscar_server.ws.PersonTransfer
        at protected org.oscarehr.myoscar_server.ws.PersonTransfer
org.oscarehr.myoscar_server.ws.LoginResponse._return
        at org.oscarehr.myoscar_server.ws.LoginResponse
Adapter org.w3._2001.xmlschema.Adapter1 is not applicable to the field type
java.util.Calendar.
    this problem is related to the following location:
        at @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(type=class
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT, value=class
org.w3._2001.xmlschema.Adapter1)
        at protected java.util.Calendar
org.oscarehr.myoscar_server.ws.PersonTransfer.lastLogin
        at org.oscarehr.myoscar_server.ws.PersonTransfer
        at protected org.oscarehr.myoscar_server.ws.PersonTransfer
org.oscarehr.myoscar_server.ws.LoginResponse._return
        at org.oscarehr.myoscar_server.ws.LoginResponse
Adapter org.w3._2001.xmlschema.Adapter1 is not applicable to the field type
java.util.Calendar.
    this problem is related to the following location:
        at @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(type=class
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT, value=class
org.w3._2001.xmlschema.Adapter1)
        at protected java.util.Calendar
org.oscarehr.myoscar_server.ws.SurveyResultTransfer.dateOfData
        at org.oscarehr.myoscar_server.ws.SurveyResultTransfer
        at protected java.util.List
org.oscarehr.myoscar_server.ws.GetSurveyResultsResponse._return
        at org.oscarehr.myoscar_server.ws.GetSurveyResultsResponse
        at public org.oscarehr.myoscar_server.ws.GetSurveyResultsResponse
org.oscarehr.myoscar_server.ws.ObjectFactory.createGetSurveyResultsResponse()
        at org.oscarehr.myoscar_server.ws.ObjectFactory
Adapter org.w3._2001.xmlschema.Adapter1 is not applicable to the field type
java.util.Calendar.
    this problem is related to the following location:
        at @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(type=class
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT, value=class
org.w3._2001.xmlschema.Adapter1)
        at protected java.util.Calendar
org.oscarehr.myoscar_server.ws.UpdateSurveyResult.arg1
        at org.oscarehr.myoscar_server.ws.UpdateSurveyResult
        at public org.oscarehr.myoscar_server.ws.UpdateSurveyResult
org.oscarehr.myoscar_server.ws.ObjectFactory.createUpdateSurveyResult()
        at org.oscarehr.myoscar_server.ws.ObjectFactory
Adapter org.w3._2001.xmlschema.Adapter1 is not applicable to the field type
java.util.Calendar.
    this problem is related to the following location:
        at @javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter(type=class
javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter$DEFAULT, value=class
org.w3._2001.xmlschema.Adapter1)
        at protected java.util.Calendar
org.oscarehr.myoscar_server.ws.AddSurveyResult.arg2
        at org.oscarehr.myoscar_server.ws.AddSurveyResult
        at public org.oscarehr.myoscar_server.ws.AddSurveyResult
org.oscarehr.myoscar_server.ws.ObjectFactory.createAddSurveyResult()
        at org.oscarehr.myoscar_server.ws.ObjectFactory

    at
com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)
    at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472)
    at
com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
    at
com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
    at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
    at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:202)
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:363)
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
    at
org.apache.cxf.jaxb.JAXBDataBinding.createContext(JAXBDataBinding.java:557)
    at
org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:497)
    at
org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:324)
    ... 56 more


Any ideas?
-- 
Ted.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message