You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "D A Jasintha Kapilajith Dasanayaka (Created) (JIRA)" <ji...@apache.org> on 2011/10/24 17:53:34 UTC

[jira] [Created] (AXIOM-395) "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message

"WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message
------------------------------------------------------------------------------------------------

                 Key: AXIOM-395
                 URL: https://issues.apache.org/jira/browse/AXIOM-395
             Project: Axiom
          Issue Type: Bug
            Reporter: D A Jasintha Kapilajith Dasanayaka
            Priority: Critical


we are trying to read larger text content through a mediator using axiom . our  code is as follows 

  private static String readFile(String file) throws IOException {
 
	FileInputStream fin = new FileInputStream(file);
	OMFactory factory = OMAbstractFactory.getOMFactory();
        String charSetEnc = BuilderUtil.getCharSetEncoding("text/plain");
        QName wrapperQName = BaseConstants.DEFAULT_TEXT_WRAPPER;
        Reader reader;
        try {
            reader = new InputStreamReader(fin, charSetEnc);
        } catch (UnsupportedEncodingException ex) {
            throw new AxisFault("Unsupported encoding: " + charSetEnc, ex);
        }
        OMElement om =  new OMSourcedElementImpl(wrapperQName, factory,
                new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
		return ((OMText) om.getFirstOMChild()).getText();

	}


Our file size is  8 KB but this method return only 4 KB all other data has been dropped.we experienced that  there is chunk size defined in WrappedTextNodeStreamReader class and it has been set to 4096

 but if return  "om.getText();" we can get the complete String 

--
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: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Resolved] (AXIOM-395) "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message

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

Andreas Veithen resolved AXIOM-395.
-----------------------------------

    Resolution: Invalid
      Assignee: Andreas Veithen

WrappedTextNodeStreamReader generates a CHARACTER event for each chunk it reads from the stream. If it is used to construct an OMSourcedElement and that element is expanded, then this results in the creation of multiple OMText nodes (one for each chunk). That means that the behavior of WrappedTextNodeStreamReader is similar to a non coalescing parser.

The code shown in the issue description gets the first OMText and therefore only returns the first chunk.

As a conclusion, the code works as designed.


                
> "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message
> ------------------------------------------------------------------------------------------------
>
>                 Key: AXIOM-395
>                 URL: https://issues.apache.org/jira/browse/AXIOM-395
>             Project: Axiom
>          Issue Type: Bug
>            Reporter: D A Jasintha Kapilajith Dasanayaka
>            Assignee: Andreas Veithen
>            Priority: Critical
>         Attachments: SmooksTestCase.zip, resourceForTestcase.zip
>
>
> we are trying to read larger text content through a mediator using axiom . our  code is as follows 
>   private static String readFile(String file) throws IOException {
>  
> 	FileInputStream fin = new FileInputStream(file);
> 	OMFactory factory = OMAbstractFactory.getOMFactory();
>         String charSetEnc = BuilderUtil.getCharSetEncoding("text/plain");
>         QName wrapperQName = BaseConstants.DEFAULT_TEXT_WRAPPER;
>         Reader reader;
>         try {
>             reader = new InputStreamReader(fin, charSetEnc);
>         } catch (UnsupportedEncodingException ex) {
>             throw new AxisFault("Unsupported encoding: " + charSetEnc, ex);
>         }
>         OMElement om =  new OMSourcedElementImpl(wrapperQName, factory,
>                 new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
> 		return ((OMText) om.getFirstOMChild()).getText();
> 	}
> Our file size is  8 KB but this method return only 4 KB all other data has been dropped.we experienced that  there is chunk size defined in WrappedTextNodeStreamReader class and it has been set to 4096
>  but if return  "om.getText();" we can get the complete String 

--
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: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Updated] (AXIOM-395) "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message

Posted by "D A Jasintha Kapilajith Dasanayaka (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIOM-395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

D A Jasintha Kapilajith Dasanayaka updated AXIOM-395:
-----------------------------------------------------

    Attachment: SmooksTestCase.zip

hi

Here i have attached a test-case for testing this issue

Thanks

                
> "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message
> ------------------------------------------------------------------------------------------------
>
>                 Key: AXIOM-395
>                 URL: https://issues.apache.org/jira/browse/AXIOM-395
>             Project: Axiom
>          Issue Type: Bug
>            Reporter: D A Jasintha Kapilajith Dasanayaka
>            Priority: Critical
>         Attachments: SmooksTestCase.zip
>
>
> we are trying to read larger text content through a mediator using axiom . our  code is as follows 
>   private static String readFile(String file) throws IOException {
>  
> 	FileInputStream fin = new FileInputStream(file);
> 	OMFactory factory = OMAbstractFactory.getOMFactory();
>         String charSetEnc = BuilderUtil.getCharSetEncoding("text/plain");
>         QName wrapperQName = BaseConstants.DEFAULT_TEXT_WRAPPER;
>         Reader reader;
>         try {
>             reader = new InputStreamReader(fin, charSetEnc);
>         } catch (UnsupportedEncodingException ex) {
>             throw new AxisFault("Unsupported encoding: " + charSetEnc, ex);
>         }
>         OMElement om =  new OMSourcedElementImpl(wrapperQName, factory,
>                 new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
> 		return ((OMText) om.getFirstOMChild()).getText();
> 	}
> Our file size is  8 KB but this method return only 4 KB all other data has been dropped.we experienced that  there is chunk size defined in WrappedTextNodeStreamReader class and it has been set to 4096
>  but if return  "om.getText();" we can get the complete String 

--
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: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[jira] [Updated] (AXIOM-395) "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message

Posted by "D A Jasintha Kapilajith Dasanayaka (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIOM-395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

D A Jasintha Kapilajith Dasanayaka updated AXIOM-395:
-----------------------------------------------------

    Attachment: resourceForTestcase.zip

Resources  for above test case
                
> "WrappedTextNodeOMDataSourceFromReader" looses some data when processing large text base message
> ------------------------------------------------------------------------------------------------
>
>                 Key: AXIOM-395
>                 URL: https://issues.apache.org/jira/browse/AXIOM-395
>             Project: Axiom
>          Issue Type: Bug
>            Reporter: D A Jasintha Kapilajith Dasanayaka
>            Priority: Critical
>         Attachments: SmooksTestCase.zip, resourceForTestcase.zip
>
>
> we are trying to read larger text content through a mediator using axiom . our  code is as follows 
>   private static String readFile(String file) throws IOException {
>  
> 	FileInputStream fin = new FileInputStream(file);
> 	OMFactory factory = OMAbstractFactory.getOMFactory();
>         String charSetEnc = BuilderUtil.getCharSetEncoding("text/plain");
>         QName wrapperQName = BaseConstants.DEFAULT_TEXT_WRAPPER;
>         Reader reader;
>         try {
>             reader = new InputStreamReader(fin, charSetEnc);
>         } catch (UnsupportedEncodingException ex) {
>             throw new AxisFault("Unsupported encoding: " + charSetEnc, ex);
>         }
>         OMElement om =  new OMSourcedElementImpl(wrapperQName, factory,
>                 new WrappedTextNodeOMDataSourceFromReader(wrapperQName, reader));
> 		return ((OMText) om.getFirstOMChild()).getText();
> 	}
> Our file size is  8 KB but this method return only 4 KB all other data has been dropped.we experienced that  there is chunk size defined in WrappedTextNodeStreamReader class and it has been set to 4096
>  but if return  "om.getText();" we can get the complete String 

--
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: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org