1 2 3 Previous Next 36 Replies Latest reply on Feb 27, 2017 7:54 AM by gprade Go to original post
      • 30. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
        asoldano

        OK, the reproducer was not exactly something you download and try in a minute ;-)

        Anyway, here I could not reproduce the problem (the adapters were always run here...) so at least I cleaned up the stuff you provided and turned it into something that can be easily tested (mvn -DskipTests clean package; copy the jar into server deployment dir; mvn test).

        Here is what I did:

        * run wsconsume -k -b binding.xjb using your binding file and your wsdl/xsd, that gave me the jaxb annotated classes

        * copied the above generated classes, as well as the 2 adapters classes in the project tree where the endpoint impl and the test were already available

        * also copied the wsdl/xsd into webapp/WEB-INF dir to be able to drop the dependency to the cp.generated.from.services.jar

        * updated the wsdlLocation attribute in @WebService annotation in TestWebServiceImpl

        * fixed the dependencies in the pom

        * added some prints to the adapters, to make them very verbose on what they actually do

         

        I'm attaching the project as soon as I'm done with message here.

        I can see what follows:

         

        --- Client side ---

        alessio@localhost /dati/tmp-XmlJavaTypeAdapter/test/src/csc_Services/TestWebService $ mvn test
        [INFO] Scanning for projects...
        [INFO]                                                                        
        [INFO] ------------------------------------------------------------------------
        [INFO] Building NetCentric TestWebService 1.0.0-SNAPSHOT
        [INFO] ------------------------------------------------------------------------
        [INFO]
        [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestWebService ---
        [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
        [INFO] skip non existing resourceDirectory /dati/tmp-XmlJavaTypeAdapter/test/src/csc_Services/TestWebService/src/main/resources
        [INFO]
        [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ TestWebService ---
        [INFO] Nothing to compile - all classes are up to date
        [INFO]
        [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ TestWebService ---
        [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
        [INFO] skip non existing resourceDirectory /dati/tmp-XmlJavaTypeAdapter/test/src/csc_Services/TestWebService/src/test/resources
        [INFO]
        [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ TestWebService ---
        [INFO] Nothing to compile - all classes are up to date
        [INFO]
        [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ TestWebService ---
        [INFO] Surefire report directory: /dati/tmp-XmlJavaTypeAdapter/test/src/csc_Services/TestWebService/target/surefire-reports
        
        -------------------------------------------------------
        T E S T S
        -------------------------------------------------------
        Running com.lmco.spacefence.webservicetests.test.TestServiceTest
        log4j:WARN No appenders could be found for logger (org.apache.cxf.common.logging.LogUtils).
        log4j:WARN Please initialize the log4j system properly.
        log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
        ***** class com.lmco.spacefence.webservices.util.XmlDateAdapter marshalling Date 'Tue Jul 07 16:57:36 CEST 2015'
        ***** class com.lmco.spacefence.webservices.util.XmlDatetimeAdapter marshalling Calendar 'java.util.GregorianCalendar[time=1436281056000,areFieldsSet=true,areAllFieldsSet=false,lenient=true,zone=sun.util.calendar.ZoneInfo[id="UTC",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2015,MONTH=6,WEEK_OF_YEAR=28,WEEK_OF_MONTH=2,DAY_OF_MONTH=7,DAY_OF_YEAR=188,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=2,HOUR_OF_DAY=14,MINUTE=57,SECOND=36,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]'
        ***** class com.lmco.spacefence.webservices.util.XmlDateAdapter unmarshalling String '2015-07-07'
        ***** class com.lmco.spacefence.webservices.util.XmlDatetimeAdapter unmarshalling String '2015-07-07T14:57:36Z'
        Tue Jul 07 00:00:00 CEST 2015
        java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+00:00",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2015,MONTH=6,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=7,DAY_OF_YEAR=1,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=14,MINUTE=57,SECOND=36,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
        Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.433 sec
        
        Results :
        
        Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
        
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESS
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 3.539 s
        [INFO] Finished at: 2015-07-07T16:57:37+02:00
        [INFO] Final Memory: 13M/213M
        [INFO] ------------------------------------------------------------------------
        
        

         

        --- Server side ---

        16:57:19,242 INFO  [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0001: Content added at location /ssd/wildfly/dist/target/wildfly-9.0.0.CR3-SNAPSHOT/standalone/data/content/26/40741292716d7e2b7855f01f873b1d371032d6/content
        16:57:19,252 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 65) WFLYUT0022: Unregistered web context: /NetCentric/TestService
        16:57:19,258 INFO  [org.jboss.as.webservices] (MSC service thread 1-2) WFLYWS0004: Stopping service jboss.ws.endpoint."TestWebService-1.0.0-SNAPSHOT.war".TestService
        16:57:19,292 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment TestWebService-1.0.0-SNAPSHOT.war (runtime-name: TestWebService-1.0.0-SNAPSHOT.war) in 46ms
        16:57:19,294 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0027: Starting deployment of "TestWebService-1.0.0-SNAPSHOT.war" (runtime-name: "TestWebService-1.0.0-SNAPSHOT.war")
        16:57:19,351 INFO  [org.jboss.ws.cxf.metadata] (MSC service thread 1-1) JBWS024061: Adding service endpoint metadata: id=TestService
         address=http://localhost:8080/NetCentric/TestService
        implementor=com.lmco.spacefence.webservices.test.TestServiceImpl
         serviceName={http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test/Service}TestService
         portName={http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test/Service}TestServicePort
        annotationWsdlLocation=WEB-INF/wsdl/TestService.wsdl
        wsdlLocationOverride=null
        mtomEnabled=false
        16:57:19,361 INFO  [org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-1) Creating Service {http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test/Service}TestService from WSDL: WEB-INF/wsdl/TestService.wsdl
        16:57:19,399 INFO  [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-1) Setting the server's publish address to be http://localhost:8080/NetCentric/TestService
        16:57:19,404 INFO  [org.jboss.ws.cxf.deployment] (MSC service thread 1-1) JBWS024074: WSDL published to: file:/mnt/ssd/wildfly/dist/target/wildfly-9.0.0.CR3-SNAPSHOT/standalone/data/wsdl/TestWebService-1.0.0-SNAPSHOT.war/TestService.wsdl
        16:57:19,407 INFO  [org.jboss.as.webservices] (MSC service thread 1-1) WFLYWS0003: Starting service jboss.ws.endpoint."TestWebService-1.0.0-SNAPSHOT.war".TestService
        16:57:19,417 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 67) WFLYUT0021: Registered web context: /NetCentric/TestService
        16:57:19,453 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) WFLYSRV0016: Replaced deployment "TestWebService-1.0.0-SNAPSHOT.war" with deployment "TestWebService-1.0.0-SNAPSHOT.war"
        16:57:19,454 INFO  [org.jboss.as.repository] (DeploymentScanner-threads - 2) WFLYDR0002: Content removed from location /ssd/wildfly/dist/target/wildfly-9.0.0.CR3-SNAPSHOT/standalone/data/content/db/9ae3b888d42966ce916db0e0ff850b71d85b94/content
        
        16:57:37,425 INFO  [stdout] (default task-18) ***** class com.lmco.spacefence.webservices.util.XmlDateAdapter unmarshalling String '2015-07-07'
        16:57:37,425 INFO  [stdout] (default task-18) ***** class com.lmco.spacefence.webservices.util.XmlDatetimeAdapter unmarshalling String '2015-07-07T14:57:36Z'
        16:57:37,426 INFO  [com.lmco.spacefence.webservices.test.TestServiceImpl] (default task-18) testDate: Tue Jul 07 00:00:00 CEST 2015
        16:57:37,427 INFO  [com.lmco.spacefence.webservices.test.TestServiceImpl] (default task-18) testDatetime: java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+00:00",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2015,MONTH=6,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=7,DAY_OF_YEAR=1,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=14,MINUTE=57,SECOND=36,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
        16:57:37,428 INFO  [stdout] (default task-18) ***** class com.lmco.spacefence.webservices.util.XmlDateAdapter marshalling Date 'Tue Jul 07 00:00:00 CEST 2015'
        16:57:37,428 INFO  [stdout] (default task-18) ***** class com.lmco.spacefence.webservices.util.XmlDatetimeAdapter marshalling Calendar 'java.util.GregorianCalendar[time=?,areFieldsSet=false,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT+00:00",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2015,MONTH=6,WEEK_OF_YEAR=1,WEEK_OF_MONTH=1,DAY_OF_MONTH=7,DAY_OF_YEAR=1,DAY_OF_WEEK=5,DAY_OF_WEEK_IN_MONTH=1,AM_PM=0,HOUR=0,HOUR_OF_DAY=14,MINUTE=57,SECOND=36,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]'
        
        

         

         

        --- Message on the wire (through Wireshark) ---

        POST /NetCentric/TestService HTTP/1.1
        Content-Type: text/xml; charset=UTF-8
        Accept: */*
        SOAPAction: "http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test/Service/test" 
        User-Agent: Apache CXF 3.0.4
        Cache-Control: no-cache
        Pragma: no-cache
        Host: localhost:8080
        Connection: keep-alive
        Content-Length: 317
        
        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns3:test xmlns:ns2="http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test" xmlns:ns3="http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test/Operations" testDate="2015-07-07" testDatetime="2015-07-07T14:57:36Z"/></soap:Body></soap:Envelope>HTTP/1.1 200 OK 
        Connection: keep-alive
        X-Powered-By: Undertow/1
        Server: WildFly/9
        Content-Type: text/xml;charset=UTF-8
        Content-Length: 426
        Date: Tue, 07 Jul 2015 14:57:37 GMT
        
        <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns3:testResponse xmlns:ns2="http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test" xmlns:ns3="http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Test/Operations"><ns2:TestType><ns2:responseDate>2015-07-07</ns2:responseDate><ns2:responseDatetime>2015-07-07T14:57:36Z</ns2:responseDatetime></ns2:TestType></ns3:testResponse></soap:Body></soap:Envelope>
        
        

         

        This all looks ok to me.

        Now, it would be great if any further analysis could be performed by applying changes on top of the project here, so we can both easily try and reproduce what the other is getting.

        • 31. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
          geturner

          Well now the problem is that you have changed the construct of the WAR a great deal and have probably lost the cause of the problem.  I gave you the "reproducable" so that you could run it the way I am.  By removing all of the pieces from the generated.jar and putting them in the WEB-INF directly, you have probably changed the way the WAR is running so that the adapters function.  What I provided SHOULD work as is, but now you have placed the onus back on me to go discover the bug.  I have seven WARS that all use the same set of common schemas, so the first thing I will do is duplicate them into every WAR (which I should NOT have to do) and see if that changes anything.

          • 32. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
            asoldano

            what you provided was not "reproducable" as it was not even possible to build it the way you gave it to me. Provide a project that can be built and I'll test it as is. That's why showing a decent working scenario looked like a starting point.

            This said, I can move the common classes to a jar embedded into the war and attach it here, so that it better fits your scenario.

            • 33. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
              asoldano

              Here you go, attached you find a new zip with the 2 projects: the first (TestWebService-common) has the common classes & wsdl/xsd and can be build / installed in maven archive with a simple 'mvn clean install', the second is the same as I attached on yesterday except the common classes and wsdl/xsd are not there anymore as the TestWebService-common dependency is pulled and included in the war. The endpoint impl is back referencing /wsdl/TestService.wsdl in the wsdlLocation.

               

              Still, I get expected behavior with both adapters run on both sides.

               

              My offer to try a reproducer from you (that I can cleanly build and possibly import into my IDE and debug on it, should it actually reproduce the problem) is still valid.

              • 34. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
                geturner

                I am back working this again.  I have re-worked the entire build process, where I am using the cxf-codegen-plugin to build classes for each WAR and the schema and wsdl files are natively in WEB-INF/wsdl.  The adapter classes are back in a common jar that is in the WildFly global classpath (from a module).  Everything deploys and runs without errors, at least until I run my client tests.  Now I am back to one of my ORIGINAL problem, as I am no longer modifying the source in any way.  Now I get the original error:

                 

                2015-07-22 13:30:01,514 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 9.0.0.CR1 (WildFly Core 1.0.0.CR1) started in 46387ms - Started 3443 of 3717 services (469 services are lazy, passive or on-demand)

                 

                 

                2015-07-22 13:33:58,511 WARNING [org.apache.cxf.phase.PhaseInterceptorChain] (default task-1) Interceptor for {http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Subscription/Service}SubscriptionService#{http://www.C2SSA.gov/C2SSADomain/SpaceFence/v2/Subscription/Service}subscribe has thrown exception, unwinding now: java.lang.IllegalArgumentException: Can not set java.util.Calendar field gov.c2ssa.c2ssadomain.common.types.v3.CommonHeaderType.msgCreationTime to java.lang.String

                 

                 

                  at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)

                 

                 

                  at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)

                 

                 

                  at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)

                 

                 

                  at java.lang.reflect.Field.set(Field.java:758)

                 

                 

                  at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.set(Accessor.java:274)

                 

                 

                  at com.sun.xml.bind.v2.runtime.reflect.Accessor.receive(Accessor.java:166)

                 

                 

                  at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(UnmarshallingContext.java:614)

                 

                 

                  at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:221)

                 

                 

                  at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:185)

                 

                 

                  at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:415)

                 

                 

                  at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:394)

                 

                 

                  at org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:858)

                 

                 

                  at org.apache.cxf.jaxb.JAXBEncoderDecoder.access$100(JAXBEncoderDecoder.java:102)

                 

                 

                  at org.apache.cxf.jaxb.JAXBEncoderDecoder$2.run(JAXBEncoderDecoder.java:897)

                 

                 

                  at java.security.AccessController.doPrivileged(Native Method)

                 

                 

                  at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:895)

                 

                 

                  at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:712)

                 

                 

                  at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:176)

                 

                 

                  at org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:194)

                 

                 

                  at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)

                 

                 

                  at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

                 

                 

                  at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)

                 

                 

                  at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:111)

                 

                 

                  at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:136)

                 

                 

                  at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)

                 

                 

                  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)

                 

                 

                  at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)

                 

                 

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

                 

                 

                  at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)

                 

                 

                  at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)

                 

                 

                  at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

                 

                 

                  at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

                 

                 

                  at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

                 

                 

                  at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

                 

                 

                  at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

                 

                 

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                 

                 

                  at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

                 

                 

                  at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

                 

                 

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                 

                 

                  at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

                 

                 

                  at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

                 

                 

                  at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

                 

                 

                  at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

                 

                 

                  at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

                 

                 

                  at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

                 

                 

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                 

                 

                  at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

                 

                 

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                 

                 

                  at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

                 

                 

                  at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:274)

                 

                 

                  at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:253)

                 

                 

                  at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

                 

                 

                  at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

                 

                 

                  at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

                 

                 

                  at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

                 

                 

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                 

                 

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                 

                 

                  at java.lang.Thread.run(Thread.java:745)

                 

                 

                I have followed the specs exactly, and the binding.xjb file is setting all of the annotations, like this:

                 

                The class I am sending:

                @XmlRootElement(name = "Subscription")

                public class Subscription

                   extends AbstractMsgType

                   implements Serializable

                {

                ----------------------------------------------------------------------------------------------------------------------------------------------

                @XmlAccessorType(XmlAccessType.FIELD)

                @XmlType(name = "AbstractMsgType", propOrder = {

                   "noticeList",

                   "commonHeader"
                })

                @XmlSeeAlso({

                  CandidateRSOMsgType.class,

                  MetricObservationTrackMsgType.class
                })

                public class AbstractMsgType

                   implements Serializable

                {

                 

                   @XmlElement(name = "NoticeList", namespace = "urn:us:gov:ic:ism")

                   protected NoticeListType noticeList;

                   @XmlElement(name = "CommonHeader", required = true)

                   protected CommonHeaderType commonHeader;

                   @XmlAttribute(name = "schemaVersion", required = true)

                   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)

                   protected String schemaVersion;

                   @XmlAttribute(name = "externalNotice", namespace = "urn:us:gov:ic:ism")

                   protected Boolean externalNotice;

                   @XmlAttribute(name = "noticeType", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMNoticeValues> noticeType;

                   @XmlAttribute(name = "noticeReason", namespace = "urn:us:gov:ic:ism")

                   protected String noticeReason;

                   @XmlAttribute(name = "noticeDate", namespace = "urn:us:gov:ic:ism")

                   @XmlJavaTypeAdapter(XmlDateAdapter.class)

                   protected Date noticeDate;

                   @XmlAttribute(name = "unregisteredNoticeType", namespace = "urn:us:gov:ic:ism")

                   protected String unregisteredNoticeType;

                   @XmlAttribute(name = "resourceElement", namespace = "urn:us:gov:ic:ism", required = true)

                   protected boolean resourceElement;

                   @XmlAttribute(name = "createDate", namespace = "urn:us:gov:ic:ism", required = true)

                   @XmlJavaTypeAdapter(XmlDateAdapter.class)

                   protected Date createDate;

                   @XmlAttribute(name = "compliesWith", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMCompliesWithValues> compliesWith;

                   @XmlAttribute(name = "classification", namespace = "urn:us:gov:ic:ism", required = true)

                   protected CVEnumISMClassificationAll classification;

                   @XmlAttribute(name = "ownerProducer", namespace = "urn:us:gov:ic:ism", required = true)

                   protected List<CVEnumISMOwnerProducerValues> ownerProducer;

                   @XmlAttribute(name = "SCIcontrols", namespace = "urn:us:gov:ic:ism")

                   protected List<String> scIcontrols;

                   @XmlAttribute(name = "SARIdentifier", namespace = "urn:us:gov:ic:ism")

                   protected List<String> sarIdentifier;

                   @XmlAttribute(name = "atomicEnergyMarkings", namespace = "urn:us:gov:ic:ism")

                   protected List<String> atomicEnergyMarkings;

                   @XmlAttribute(name = "disseminationControls", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMDissemValues> disseminationControls;

                   @XmlAttribute(name = "displayOnlyTo", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMRelToValues> displayOnlyTo;

                   @XmlAttribute(name = "FGIsourceOpen", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMFGIOpenValues> fgIsourceOpen;

                   @XmlAttribute(name = "FGIsourceProtected", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMFGIProtectedValues> fgIsourceProtected;

                   @XmlAttribute(name = "releasableTo", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMRelToValues> releasableTo;

                   @XmlAttribute(name = "nonICmarkings", namespace = "urn:us:gov:ic:ism")

                   protected List<String> nonICmarkings;

                   @XmlAttribute(name = "classifiedBy", namespace = "urn:us:gov:ic:ism")

                   protected String classifiedBy;

                   @XmlAttribute(name = "compilationReason", namespace = "urn:us:gov:ic:ism")

                   protected String compilationReason;

                   @XmlAttribute(name = "derivativelyClassifiedBy", namespace = "urn:us:gov:ic:ism")

                   protected String derivativelyClassifiedBy;

                   @XmlAttribute(name = "classificationReason", namespace = "urn:us:gov:ic:ism")

                   protected String classificationReason;

                   @XmlAttribute(name = "nonUSControls", namespace = "urn:us:gov:ic:ism")

                   protected List<CVEnumISMNonUSControlsValues> nonUSControls;

                   @XmlAttribute(name = "derivedFrom", namespace = "urn:us:gov:ic:ism")

                   protected String derivedFrom;

                   @XmlAttribute(name = "declassDate", namespace = "urn:us:gov:ic:ism")

                   @XmlJavaTypeAdapter(XmlDateAdapter.class)

                   protected Date declassDate;

                   @XmlAttribute(name = "declassEvent", namespace = "urn:us:gov:ic:ism")

                   protected String declassEvent;

                   @XmlAttribute(name = "declassException", namespace = "urn:us:gov:ic:ism")

                   protected List<String> declassException;

                   @XmlAttribute(name = "DESVersion", namespace = "urn:us:gov:ic:ism", required = true)

                   protected String desVersion;

                 

                I have tried EVERYTHING.  I have been working with this same kind of code for years with Metro and have not had this kind of trouble since the JAXB 1.0 days.  What is the problem with CXF??????

                • 35. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
                  asoldano

                  Seriously how does the post above help in proceeding with the issue analysis here? It's yet a different scenario, that can't be tested. I could possibly guess an adapter is missing (also considering the error message talks about a class whose code is not shown..) or that the message being process somehow does not match the server side model of the service, but those would only be guesses. As I said previously, here we need a reproducer to proceed. The reproducer has to be a small project that can be built / deployed / run to show the error / unexpected behavior. Without that, there're not much to say besides that with the provided information I can't say for sure how to deal with the problem and you can only try waiting for the rest of the community to possibly help.

                  • 36. Re: XmlJavaTypeAdapter classes ignored in SOAP responses
                    gprade

                    Hello everyone,

                     

                    I am migrating from jboss 7.1 to wildfly 10.0 and facing similar issue.

                     

                    doing a post request and my json body is like below:

                    JSON BODY:

                    ===========

                    {

                    "id": null,

                    "jobType": "EXECUTE_DP_BACKUP",

                    "properties":{"dp_jobType": "EXECUTE_DP_BACKUP","dp_specName": "New1", "dp_specType": "DATALIST"}

                    }

                     

                    It can able to extract "id" and "jobType", but whenever it comes to properties i can see error as below:

                     

                    ERROR:

                    ======

                    Unrecognized field "dp_jobType" (class com.hp.im.jce.ws.common.model.serializers.PropertyMapXmlAdapter$PropertyList), not marked as ignorable (one known property: "property"]) at [Source: io.undertow.servlet.spec.ServletInputStreamImpl@3a180d80; line: 4, column: 30] (through reference chain: com.hp.im.jce.ws.common.model.Job["properties"]->com.hp.im.jce.ws.common.model.serializers.PropertyList["dp_jobType"])

                     

                     

                    I am having following dependency .

                    resteasy version : 3.0.14.Fnal

                    com.fasterxml.jackson.core version : tried with all released version.

                     

                     

                    <dependency>

                          <groupId>org.jboss.resteasy</groupId>

                          <artifactId>resteasy-jaxrs</artifactId>

                        </dependency>

                        <dependency>

                          <groupId>org.jboss.resteasy</groupId>

                          <artifactId>resteasy-cdi</artifactId>

                          <exclusions>

                      <exclusion>

                       <groupId>org.jboss.resteasy</groupId>

                       <artifactId>resteasy-jaxrs</artifactId>

                      </exclusion>

                          </exclusions>

                        </dependency>

                        <dependency>

                          <groupId>org.jboss.resteasy</groupId>

                          <artifactId>resteasy-jackson-provider</artifactId>

                        </dependency>

                        <dependency>

                          <groupId>org.jboss.resteasy</groupId>

                          <artifactId>resteasy-links</artifactId>

                        </dependency>

                        <dependency>

                          <groupId>org.hibernate</groupId>

                          <artifactId>hibernate-core</artifactId>

                        </dependency>

                      <dependency>

                      <groupId>com.fasterxml.jackson.core</groupId>

                      <artifactId>jackson-core</artifactId>

                      <version>${jackson.version}</version>

                      </dependency>

                      <dependency>

                      <groupId>com.fasterxml.jackson.core</groupId>

                      <artifactId>jackson-databind</artifactId>

                      <version>${jackson.version}</version>

                      </dependency>

                      <dependency>

                      <groupId>com.fasterxml.jackson.core</groupId>

                      <artifactId>jackson-annotations</artifactId>

                      <version>${jackson.version}</version>

                      </dependency>

                      <dependency>

                      <groupId>com.fasterxml.jackson.module</groupId>

                      <artifactId>jackson-module-jaxb-annotations</artifactId>

                      <version>${jackson.version}</version>

                      </dependency>

                      <dependency>

                      <groupId>com.fasterxml.jackson.jaxrs</groupId>

                      <artifactId>jackson-jaxrs-json-provider</artifactId>

                      <version>${jackson.version}</version>

                      </dependency>

                      <dependency>

                      <groupId>com.fasterxml.jackson.jaxrs</groupId>

                      <artifactId>jackson-jaxrs-base</artifactId>

                      <version>${jackson.version}</version>

                      </dependency>

                     

                     

                    Please find the source code as below.

                     

                    Job.java file

                    ======

                    @XmlAccessorType(XmlAccessType.NONE)

                    @XmlRootElement(name = "job")

                    @XmlType(name = "job_type", propOrder = { "id", "jobType""properties" })

                    @JsonIgnoreProperties(ignoreUnknown = true)

                    public class Job

                    {

                      @ResourceID

                      @XmlElement(name = "id")

                      private UUID id = null;

                     

                      @XmlElement(name = "jobType")

                      private String jobType = null;

                     

                     

                      @XmlElement(name = "properties")

                      @XmlJavaTypeAdapter(PropertyMapXmlAdapter.class)

                      private Map<String, String> properties;

                     

                    avoiding getter and setter methods .

                     

                    PropertyMapXmlAdapter.java:

                    ======================

                     

                    public class PropertyMapXmlAdapter extends XmlAdapter<PropertyMapXmlAdapter.PropertyList, Map<String, String>>

                    {

                      @XmlType(name = "properties_type")

                      static public class PropertyList

                      {

                       @XmlElement(name = "property")

                       public List<MapItem> propertyList = new ArrayList<MapItem>();

                      }

                     

                      @XmlType(name = "propertyMapItem_type")

                      static public class MapItem

                      {

                       @XmlAttribute
                       public String name;

                     

                       @XmlAttribute
                       public String value;

                     

                       /**
                      * @param name the name to set
                      */
                       public MapItem set(String name, String value)

                      {

                       this.name = name;

                       this.value = value;

                       return this;

                      }

                      }

                     

                      @Override
                      public PropertyList marshal(Map<String, String> mapValue) throws Exception

                      {

                      PropertyList result = null;

                      

                       if (mapValue != null)

                      {

                      result = new PropertyList();

                       for (Map.Entry<String, String> mapItem : mapValue.entrySet())

                      {

                      result.propertyList.add(new MapItem().set(mapItem.getKey(), mapItem.getValue()));

                      }

                      }

                      

                       return result;

                      }

                     

                      @Override
                      public Map<String, String> unmarshal(PropertyList listValue) throws Exception

                      {

                      Map<String, String> result = null;

                      

                       if (listValue != null)

                      {

                      result = new HashMap<String, String>();

                       for (MapItem listItem : listValue.propertyList)

                      {

                      result.put(listItem.name, listItem.value);

                      }

                      }

                      

                       return result;

                      }

                     

                    }

                    1 2 3 Previous Next