You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Sangwoo Han (JIRA)" <ji...@apache.org> on 2007/03/29 01:47:34 UTC

[jira] Created: (SM-902) File Binding example error with JaxenStringXPathExpression

 File Binding example error with JaxenStringXPathExpression 
------------------------------------------------------------

                 Key: SM-902
                 URL: https://issues.apache.org/activemq/browse/SM-902
             Project: ServiceMix
          Issue Type: Bug
          Components: servicemix-components
    Affects Versions: 3.1
         Environment: window xp, java1.5, 
            Reporter: Sangwoo Han
            Priority: Minor


I have tried example-file binding with servicemix3.1 (latest version) 
and the file generated in outbox was empty !! size zero ! 

So I commented out the rename part (filename property with JaxenStringXPathExpression) 
and it generated file with original file content. It worked !! 

Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
the expression.


======

 <sm:component> 
    <bean class="org.apache.servicemix.components.file.FileWriter"> 
      <property name="directory" value="D:/outbox" /> 
      <property name="marshaler"> 
        <bean 
          class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
        <!-- <property name="fileName"> 
           <bean 
               class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
              <constructor-arg 
                  value="concat('sample_', /sample/@id, '.xml')" /> 
       </bean> 
     </property> 
     --> 
     </bean> 
  </property> 
   </bean> 
  </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved SM-902.
--------------------------------

    Resolution: Fixed

URL: http://svn.apache.org/viewvc?view=rev&rev=534393
URL: http://svn.apache.org/viewvc?view=rev&rev=534395

Thanks for this patch Gert !


>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>         Assigned To: Gert Vanthienen
>            Priority: Minor
>             Fix For: 3.1.1, 3.2
>
>         Attachments: SM-902-with-flag.patch, SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated SM-902:
-------------------------------

    Patch Info: [Patch Available]
      Assignee: Gert Vanthienen

Thanks Gert, I will commit this patch for you since your account has not been created yet.

>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>         Assigned To: Gert Vanthienen
>            Priority: Minor
>             Fix For: 3.1.1, 3.2
>
>         Attachments: SM-902-with-flag.patch, SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Gert Vanthienen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gert Vanthienen updated SM-902:
-------------------------------

    Attachment: SM-902-with-flag.patch

Is this the kind of patch you're looking for?

The useMessageContent="false" attribute can be used to signal that an Expression doesn't access the message content, so no conversion will be done.

>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>            Priority: Minor
>         Attachments: SM-902-with-flag.patch, SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated SM-902:
-------------------------------

    Fix Version/s: 3.2
                   3.1.1

>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>         Assigned To: Gert Vanthienen
>            Priority: Minor
>             Fix For: 3.1.1, 3.2
>
>         Attachments: SM-902-with-flag.patch, SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Gert Vanthienen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39050 ] 

Gert Vanthienen commented on SM-902:
------------------------------------

I have run into the same issue once again, now while building an Auditor which wants to save all messages being handled by ServiceMix to the disk.  From the moment I read the message content, the stream becomes unusable, so it's impossible to read it for auditing purposes and again within the service that actually needs the contents.

Wouldn't it be better to change our NormalizedMessageImpl to that it automatically transforms any (not-rereadable) StreamSource being set into e.g. a StringSource to solve all these types of problems in one move?  Or would that be too much of a performance overhead?

>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>            Priority: Minor
>         Attachments: SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Gert Vanthienen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gert Vanthienen updated SM-902:
-------------------------------

    Attachment: SM-902.patch

I think this patch might at least solve the issue, but I admit it is a very naive solution.

Main problem: the NormalizedMessage is always copied, even when only e.g.message properties are used in the expression (resulting in some overhead in that case).  Any suggestions on how to avoid that?

>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>            Priority: Minor
>         Attachments: SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SM-902) File Binding example error with JaxenStringXPathExpression

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/SM-902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39052 ] 

Guillaume Nodet commented on SM-902:
------------------------------------

I'd really like to keep the possibility to deal with huge files by keeping the stream when possible.
This is really useful for ftp, file, or even http protocols.

I think the XPath expression should check the Source type of the message and convert it to a re-readable source by default (this could maybe be deactivated by a boolean flag on the expression if needed).  This would ensure that things work correctly while not adding any burden on the caller.

>  File Binding example error with JaxenStringXPathExpression 
> ------------------------------------------------------------
>
>                 Key: SM-902
>                 URL: https://issues.apache.org/activemq/browse/SM-902
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-components
>    Affects Versions: 3.1
>         Environment: window xp, java1.5, 
>            Reporter: Sangwoo Han
>            Priority: Minor
>         Attachments: SM-902.patch
>
>
> I have tried example-file binding with servicemix3.1 (latest version) 
> and the file generated in outbox was empty !! size zero ! 
> So I commented out the rename part (filename property with JaxenStringXPathExpression) 
> and it generated file with original file content. It worked !! 
> Guillaume Nodet(gnodet) suspects a problem with the input stream which is not converted before evaluating 
> the expression.
> ======
>  <sm:component> 
>     <bean class="org.apache.servicemix.components.file.FileWriter"> 
>       <property name="directory" value="D:/outbox" /> 
>       <property name="marshaler"> 
>         <bean 
>           class="org.apache.servicemix.components.util.DefaultFileMarshaler"> 
>         <!-- <property name="fileName"> 
>            <bean 
>                class="org.apache.servicemix.expression.JaxenStringXPathExpression"> 
>               <constructor-arg 
>                   value="concat('sample_', /sample/@id, '.xml')" /> 
>        </bean> 
>      </property> 
>      --> 
>      </bean> 
>   </property> 
>    </bean> 
>   </sm:component>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.