Uploaded image for project: 'ZZZ-WSO2 Data Services Server'
  1. ZZZ-WSO2 Data Services Server
  2. DS-1194

"Nested Exception:- javax.xml.stream.XMLStreamException: Invalid Staring element" thrown when producing json responses with nested query where the query returned empty set

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Highest
    • Resolution: Fixed
    • Affects Version/s: 3.2.2
    • Fix Version/s: 3.5.1-RC1, 3.5.1
    • Component/s: core
    • Labels:
      None
    • Environment:
    • Severity:
      Major
    • Estimated Complexity:
      Moderate
    • Test cases added:
      Yes

      Description

      1. Use JSONSample and insert new record to offices table.
      2. Query :
      curl -X GET -H "Accept: application/json" http://localhost:9763/services/samples/JSONSample/offices

      Response:

      
      [2016-05-06 14:26:06,231]  INFO {org.wso2.carbon.core.services.util.CarbonAuthenticationUtil} -  'admin@carbon.super [-1234]' logged in at [2016-05-06 14:26:06,231+0530]
      ^[[A[2016-05-06 14:28:38,140]  WARN {org.wso2.carbon.core.deployment.DeploymentInterceptor} -  The service artifact of the samples/JSONSample service group has changed. Removing all registry entries and handling this as a new service addition. {super-tenant}
      [2016-05-06 14:28:38,155]  INFO {org.wso2.carbon.core.deployment.DeploymentInterceptor} -  Deploying Axis2 service: samples/JSONSample {super-tenant}
      [2016-05-06 14:32:53,525]  INFO {org.wso2.carbon.core.deployment.DeploymentInterceptor} -  Deploying Axis2 service: samples/JSONSample {super-tenant}
      [2016-05-06 14:34:06,060] ERROR {org.wso2.carbon.dataservices.core.description.query.SQLQuery} -  DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      	at org.wso2.carbon.dataservices.core.engine.StaticOutputElement.executeElement(StaticOutputElement.java:258)
      	at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
      	at org.wso2.carbon.dataservices.core.engine.OutputElementGroup.executeElement(OutputElementGroup.java:106)
      	at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
      	at org.wso2.carbon.dataservices.core.description.query.Query.writeResultEntry(Query.java:416)
      	at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processPostNormalQuery(SQLQuery.java:875)
      	at org.wso2.carbon.dataservices.core.description.query.SQLQuery.runPostQuery(SQLQuery.java:2313)
      	at org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:283)
      	at org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:188)
      	at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
      	at org.wso2.carbon.dataservices.core.description.resource.Resource.execute(Resource.java:67)
      	at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:474)
      	at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:96)
      	at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:107)
      	at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
      	at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.serializeAndConsume(OMSourcedElementImpl.java:754)
      	at org.apache.axis2.json.gson.JsonFormatter.writeTo(JsonFormatter.java:100)
      	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:411)
      	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:288)
      	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
      	at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
      	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
      	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
      	at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
      	at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
      	at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
      	at org.wso2.carbon.core.transports.CarbonServlet.handleRestRequest(CarbonServlet.java:303)
      	at org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
      	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
      	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      	at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
      	at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
      	at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
      	at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
      	at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      Caused by: javax.xml.stream.XMLStreamException: Invalid Staring element
      	at org.apache.axis2.json.gson.GsonXMLStreamWriter.writeStartElement(GsonXMLStreamWriter.java:351)
      	at org.wso2.carbon.dataservices.core.engine.XMLWriterHelper.writeResultElement(XMLWriterHelper.java:144)
      	at org.wso2.carbon.dataservices.core.engine.StaticOutputElement.executeElement(StaticOutputElement.java:250)
      	... 58 more
      [2016-05-06 14:34:06,062] ERROR {org.wso2.carbon.dataservices.core.engine.DataService} -  DS Fault Message: Error in 'SQLQuery.processPostNormalQuery': DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      DS Code: DATABASE_ERROR
      Source Data Service:-
      Name: JSONSample
      Location: /samples/JSONSample.dbs
      Description: N/A
      Default Namespace: http://ws.wso2.org/dataservice/samples/json_sample
      Current Request Name: _getoffices
      Current Params: {}
      Nested Exception:-
      DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      
      DS Fault Message: Error in 'SQLQuery.processPostNormalQuery': DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      DS Code: DATABASE_ERROR
      Source Data Service:-
      Name: JSONSample
      Location: /samples/JSONSample.dbs
      Description: N/A
      Default Namespace: http://ws.wso2.org/dataservice/samples/json_sample
      Current Request Name: _getoffices
      Current Params: {}
      Nested Exception:-
      DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      
      	at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processPostNormalQuery(SQLQuery.java:881)
      	at org.wso2.carbon.dataservices.core.description.query.SQLQuery.runPostQuery(SQLQuery.java:2313)
      	at org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:283)
      	at org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:188)
      	at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
      	at org.wso2.carbon.dataservices.core.description.resource.Resource.execute(Resource.java:67)
      	at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:474)
      	at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:96)
      	at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:107)
      	at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.internalSerialize(OMSourcedElementImpl.java:691)
      	at org.apache.axiom.om.impl.llom.OMSourcedElementImpl.serializeAndConsume(OMSourcedElementImpl.java:754)
      	at org.apache.axis2.json.gson.JsonFormatter.writeTo(JsonFormatter.java:100)
      	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:411)
      	at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:288)
      	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
      	at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.invokeBusinessLogic(AbstractInOutSyncMessageReceiver.java:45)
      	at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
      	at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
      	at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:144)
      	at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:139)
      	at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:837)
      	at org.wso2.carbon.core.transports.CarbonServlet.handleRestRequest(CarbonServlet.java:303)
      	at org.wso2.carbon.core.transports.CarbonServlet.doGet(CarbonServlet.java:152)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
      	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
      	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      	at org.wso2.carbon.tomcat.ext.servlet.DelegationServlet.service(DelegationServlet.java:68)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.wso2.carbon.tomcat.ext.filter.CharacterSetFilter.doFilter(CharacterSetFilter.java:61)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      	at org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
      	at org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:49)
      	at org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
      	at org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
      	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
      	at org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:744)
      Caused by: DS Fault Message: Error in XML generation at StaticOutputElement.execute
      DS Code: UNKNOWN_ERROR
      Nested Exception:-
      javax.xml.stream.XMLStreamException: Invalid Staring element
      
      	at org.wso2.carbon.dataservices.core.engine.StaticOutputElement.executeElement(StaticOutputElement.java:258)
      	at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
      	at org.wso2.carbon.dataservices.core.engine.OutputElementGroup.executeElement(OutputElementGroup.java:106)
      	at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
      	at org.wso2.carbon.dataservices.core.description.query.Query.writeResultEntry(Query.java:416)
      	at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processPostNormalQuery(SQLQuery.java:875)
      	... 53 more
      Caused by: javax.xml.stream.XMLStreamException: Invalid Staring element
      	at org.apache.axis2.json.gson.GsonXMLStreamWriter.writeStartElement(GsonXMLStreamWriter.java:351)
      	at org.wso2.carbon.dataservices.core.engine.XMLWriterHelper.writeResultElement(XMLWriterHelper.java:144)
      	at org.wso2.carbon.dataservices.core.engine.StaticOutputElement.executeElement(StaticOutputElement.java:250)
      	... 58 more
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                madhawag@wso2.com Madhawa Gunasekara
                Reporter:
                shashika@wso2.com Shashika Ubhayaratne
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: