You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jeremy Nix (Created) (JIRA)" <ji...@apache.org> on 2012/04/20 16:04:41 UTC

[jira] [Created] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

BadgerFish JSON Reader throws invalid exception
-----------------------------------------------

                 Key: AXIS2-5295
                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
             Project: Axis2
          Issue Type: Bug
          Components: json
    Affects Versions: 1.6.1
            Reporter: Jeremy Nix
         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml

I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.

To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.

I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).

I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265473#comment-13265473 ] 

Hudson commented on AXIS2-5295:
-------------------------------

Integrated in Axis2 #1412 (See [https://builds.apache.org/job/Axis2/1412/])
    Improving the JSON code - Step 2 - Instead of using some hacks to extract the name of the element, just let Axiom determine it lazily using the feature introduced by AXIOM-399.

This should make databindings work with Badgerfish (although we have no integration test for this yet) and solve AXIS2-5158, AXIS2-5295 and AXIS2-5300. (Revision 1332402)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONDataSource.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/AbstractJSONOMBuilder.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONBadgerfishDataSource.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONBadgerfishMessageFormatter.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONBadgerfishOMBuilder.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONDataSource.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONMessageFormatter.java
* /axis/axis2/java/core/trunk/modules/json/src/org/apache/axis2/json/JSONOMBuilder.java
* /axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/JSONDataSourceTest.java
* /axis/axis2/java/core/trunk/modules/json/test/org/apache/axis2/json/JSONOMBuilderTest.java

                
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1
>            Reporter: Jeremy Nix
>            Assignee: Andreas Veithen
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258829#comment-13258829 ] 

Andreas Veithen commented on AXIS2-5295:
----------------------------------------

Potential duplicate of AXIS2-5158.

Note that from the point of view of Axiom, simply removing the check in forceExpand is obviously not an acceptable solution. A better solution is described in AXIOM-399.
                
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1
>            Reporter: Jeremy Nix
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Resolved] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved AXIS2-5295.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.0

Badgerfish is now fully supported with data bindings. The implementation uses the feature introduced by AXIOM-399.
                
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1, 1.6.2
>            Reporter: Jeremy Nix
>            Assignee: Andreas Veithen
>             Fix For: 1.7.0
>
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Updated] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-5295:
-----------------------------------

    Fix Version/s: 1.6.3
    
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1, 1.6.2
>            Reporter: Jeremy Nix
>            Assignee: Andreas Veithen
>             Fix For: 1.7.0, 1.6.3
>
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Updated] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen updated AXIS2-5295:
-----------------------------------

    Affects Version/s: 1.6.2
    
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1, 1.6.2
>            Reporter: Jeremy Nix
>            Assignee: Andreas Veithen
>             Fix For: 1.7.0
>
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Assigned] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen reassigned AXIS2-5295:
--------------------------------------

    Assignee: Andreas Veithen
    
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1
>            Reporter: Jeremy Nix
>            Assignee: Andreas Veithen
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Updated] (AXIS2-5295) BadgerFish JSON Reader throws invalid exception

Posted by "Jeremy Nix (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-5295?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Nix updated AXIS2-5295:
------------------------------

    Attachment: soap_request.xml
                badgerfish_request.json
                axiom_patch.txt

My test files and patch/hack.
                
> BadgerFish JSON Reader throws invalid exception
> -----------------------------------------------
>
>                 Key: AXIS2-5295
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5295
>             Project: Axis2
>          Issue Type: Bug
>          Components: json
>    Affects Versions: 1.6.1
>            Reporter: Jeremy Nix
>         Attachments: axiom_patch.txt, badgerfish_request.json, soap_request.xml
>
>
> I was unable to use the Badgerfish JSON implementation out of the box.  It kept throwing an exception ["Element namespace from data source is "http://www.i2b2.org/xsd/hive/msg/1.1/" not the expected].  I tried various configuration modifications before I dove into the code to see what was happening.  I tracked it down to an exception thrown in the Axiom-Impl OMSOurcedElementImpl#forceExpand method.  It is checking that its namespace matches whatever the datasource reader's namespace is.  The problem is that the OMSourcedElementImpl is created in AbstractJSONOMBuilder with no namespaces parsed out.  Parsing out of the namespaces occurs later once the BadgerFishXMLStreamReader is instantiated.
> To get around this issue, I saw a few possible options.  1) Update the AbstractJSONOMBuilder (or JSONBadgerfishOMBuilder) and change the processDocument method to dig further into the stream and parse out the namespace(s).  The problem with this solution is that I was worried about what ramifications would result now that we have read past the first element/object in the JSON input stream.  2) Update OMSourcedElementImpl and disable this validation check.
> I opted to go with the second solution.  I'm sure that it was put there for a reason, so a more elegant hack may involve looking at the content type and only avoiding this check if the content type is application/badgerfish/json (or similar).
> I'm going to attach my hack along with an example SOAP request and its badgerfish json equivalent.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org