Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6004

GZIPFeature: SAXParseException - Content is not allowed in prolog

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • 3.0.1
    • Invalid
    • Core, JAX-WS Runtime
    • None
    • Java 7
      Win7

    • Unknown

    Description

      When I'm using GZIPFeature on a CXF client (autogenerated), I'm getting the following exception:
      javax.xml.ws.soap.SOAPFaultException: org.xml.sax.SAXParseException: Content is not allowed in prolog. ~[cxf-rt-frontend-jaxws-3.0.1.jar:3.0.1]

      This does not occur on the first request I send to the specific webservice, as the first request is always uncompressed to check if the server supports gzip.
      Every request from the 2nd onwords fails with the exception above.

      //I don't think the logging feature has anything to do with the error
      LoggingFeature log = new LoggingFeature();
      log.setPrettyLogging(true);

      //MyService extends CXFService, autogenerated from wsdl
      MyService service = new MyService(new SpringBus(), log, new GZIPFeature());
      service.getPort().invoke(..);

      I checked the XML request with and without gzip, also with showing control characters. They are absolutely identically apart from the "Content-Encoding=[gzip]" statement:

      Without GZIP:
      Encoding: UTF-8
      Http-Method: POST
      Content-Type: text/xml
      Headers:

      {Accept=[*/*], Accept-Encoding=[gzip;q=1.0, identity; q=0.5, *;q=0], SOAPAction=[""]}

      [...]

      With GZIP:
      Encoding: UTF-8
      Http-Method: POST
      Content-Type: text/xml
      Headers:

      {Accept=[*/*], Accept-Encoding=[gzip;q=1.0, identity; q=0.5, *;q=0], Content-Encoding=[gzip], SOAPAction=[""]}

      [...]

      (I cannot post the XML request here as it a paid soap service I'm executing my client against).

      javax.xml.ws.soap.SOAPFaultException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159) ~[cxf-rt-frontend-jaxws-3.0.1.jar:3.0.1]
      at com.sun.proxy.$Proxy137.hotelDetailAvail(Unknown Source) ~[?:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_51]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_51]
      at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_51]
      at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:63) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:95) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.expression.spel.ast.MethodReference.access$000(MethodReference.java:44) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.expression.spel.ast.MethodReference$MethodValueRef.getValue(MethodReference.java:258) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:84) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:114) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:111) ~[spring-expression-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:159) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:268) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:142) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:75) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:71) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:170) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_51]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_51]
      at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_51]
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) ~[spring-aop-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) ~[spring-aop-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.integration.monitor.SimpleMessageHandlerMetrics.handleMessage(SimpleMessageHandlerMetrics.java:106) ~[spring-integration-jmx-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.monitor.SimpleMessageHandlerMetrics.invoke(SimpleMessageHandlerMetrics.java:86) ~[spring-integration-jmx-4.0.3.RELEASE.jar:?]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207) ~[spring-aop-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at com.sun.proxy.$Proxy140.handleMessage(Unknown Source) ~[?:?]
      at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:255) ~[spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:109) [spring-messaging-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.messaging.core.GenericMessagingTemplate.doSendAndReceive(GenericMessagingTemplate.java:144) [spring-messaging-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.messaging.core.GenericMessagingTemplate.doSendAndReceive(GenericMessagingTemplate.java:44) [spring-messaging-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.messaging.core.AbstractMessagingTemplate.sendAndReceive(AbstractMessagingTemplate.java:75) [spring-messaging-4.0.7.RELEASE.jar:4.0.7.RELEASE]
      at org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:250) [spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceiveMessage(MessagingGatewaySupport.java:224) [spring-integration-core-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.ip.tcp.TcpInboundGateway.doOnMessage(TcpInboundGateway.java:99) [spring-integration-ip-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.ip.tcp.TcpInboundGateway.onMessage(TcpInboundGateway.java:89) [spring-integration-ip-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.ip.tcp.connection.TcpNioConnection.sendToChannel(TcpNioConnection.java:349) [spring-integration-ip-4.0.3.RELEASE.jar:?]
      at org.springframework.integration.ip.tcp.connection.TcpNioConnection.run(TcpNioConnection.java:222) [spring-integration-ip-4.0.3.RELEASE.jar:?]
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [?:1.7.0_51]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [?:1.7.0_51]
      at java.lang.Thread.run(Thread.java:744) [?:1.7.0_51]
      Caused by: org.apache.cxf.binding.soap.SoapFault: org.xml.sax.SAXParseException: Content is not allowed in prolog.
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:84) ~[cxf-rt-bindings-soap-3.0.1.jar:3.0.1]
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:51) ~[cxf-rt-bindings-soap-3.0.1.jar:3.0.1]
      at org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:40) ~[cxf-rt-bindings-soap-3.0.1.jar:3.0.1]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:113) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69) ~[cxf-rt-bindings-soap-3.0.1.jar:3.0.1]
      at org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34) ~[cxf-rt-bindings-soap-3.0.1.jar:3.0.1]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:798) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1636) ~[cxf-rt-transports-http-3.0.1.jar:3.0.1]
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1525) ~[cxf-rt-transports-http-3.0.1.jar:3.0.1]
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1330) ~[cxf-rt-transports-http-3.0.1.jar:3.0.1]
      at java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:241) ~[?:1.7.0_51]
      at org.apache.cxf.io.AbstractWrappedOutputStream.close(AbstractWrappedOutputStream.java:77) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.io.AbstractThresholdOutputStream.close(AbstractThresholdOutputStream.java:102) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:215) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:638) ~[cxf-rt-transports-http-3.0.1.jar:3.0.1]
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:514) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:423) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) ~[cxf-core-3.0.1.jar:3.0.1]
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) ~[cxf-rt-frontend-simple-3.0.1.jar:3.0.1]
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:137) ~[cxf-rt-frontend-jaxws-3.0.1.jar:3.0.1]
      ... 57 more

      If I enable MTOM (just as a tryout):
      reqCtx.put(Message.MTOM_ENABLED, true);

      The Error is:
      javax.xml.ws.soap.SOAPFaultException: multipart/related stream invalid, no root part was found
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:159) ~[cxf-rt-frontend-jaxws-3.0.1.jar:3.0.1]

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            membersound member sound
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment