You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Roman Stumm (Created) (JIRA)" <ji...@apache.org> on 2011/11/08 18:37:51 UTC

[jira] [Created] (CAMEL-4647) Simple expression does not find method toString()

Simple expression does not find method toString()
-------------------------------------------------

                 Key: CAMEL-4647
                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.8.0
         Environment: camel 2.8.0
            Reporter: Roman Stumm


In a route builder, we have a log definition: 

from("direct:testSimple")
 .log("${body.toString}");

The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.

The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
from("direct:testSimple")
 .log("${body.toInfoString}");

Why does simple expression have a problem with a method named "toString"?


--
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

        

Re: [jira] [Created] (CAMEL-4647) Simple expression does not find method toString()

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Nov 9, 2011 at 10:56 AM, Omar Atia <om...@its.ws> wrote:
> Dears,
>
> What is the difference between ?
>
> <simple>${bodyAs(String)} contains 'CommandResponseData'</simple>
>

This is a built-in function in the Simple language that uses the
Camel's type converters to convert the body to the provided type.


> And
>
> <simple>${body.toString} contains 'CommandResponseData'</simple>  which you raise JIRA Camel 4647 for it ?
>

This is OGNL support on the simple language, that will invoke the
method named toString on the message body. (Does not use the Camel's
type converters).


> Thanks,
> Omar Atia
>
> -----Original Message-----
> From: Roman Stumm (Created) (JIRA) [mailto:jira@apache.org]
> Sent: Tuesday, November 08, 2011 7:38 PM
> To: dev@camel.apache.org
> Subject: [jira] [Created] (CAMEL-4647) Simple expression does not find method toString()
>
> Simple expression does not find method toString()
> -------------------------------------------------
>
>                 Key: CAMEL-4647
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: camel 2.8.0
>            Reporter: Roman Stumm
>
>
> In a route builder, we have a log definition:
>
> from("direct:testSimple")
>  .log("${body.toString}");
>
> The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.
>
> The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
> from("direct:testSimple")
>  .log("${body.toInfoString}");
>
> Why does simple expression have a problem with a method named "toString"?
>
>
> --
> 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
>
>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

RE: [jira] [Created] (CAMEL-4647) Simple expression does not find method toString()

Posted by Omar Atia <om...@its.ws>.
Dears,

What is the difference between ? 

<simple>${bodyAs(String)} contains 'CommandResponseData'</simple>

And 

<simple>${body.toString} contains 'CommandResponseData'</simple>  which you raise JIRA Camel 4647 for it ?

Thanks,
Omar Atia

-----Original Message-----
From: Roman Stumm (Created) (JIRA) [mailto:jira@apache.org] 
Sent: Tuesday, November 08, 2011 7:38 PM
To: dev@camel.apache.org
Subject: [jira] [Created] (CAMEL-4647) Simple expression does not find method toString()

Simple expression does not find method toString()
-------------------------------------------------

                 Key: CAMEL-4647
                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.8.0
         Environment: camel 2.8.0
            Reporter: Roman Stumm


In a route builder, we have a log definition: 

from("direct:testSimple")
 .log("${body.toString}");

The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.

The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
from("direct:testSimple")
 .log("${body.toInfoString}");

Why does simple expression have a problem with a method named "toString"?


--
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

        

RE: [jira] [Created] (CAMEL-4647) Simple expression does not find method toString()

Posted by Omar Atia <om...@its.ws>.
Dears,

What is the difference between ? 

<simple>${bodyAs(String)} contains 'CommandResponseData'</simple>

And 

<simple>${body.toString} contains 'CommandResponseData'</simple>  which you raise JIRA Camel 4647 for it ?

Thanks,
Omar Atia

-----Original Message-----
From: Roman Stumm (Created) (JIRA) [mailto:jira@apache.org] 
Sent: Tuesday, November 08, 2011 7:38 PM
To: dev@camel.apache.org
Subject: [jira] [Created] (CAMEL-4647) Simple expression does not find method toString()

Simple expression does not find method toString()
-------------------------------------------------

                 Key: CAMEL-4647
                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.8.0
         Environment: camel 2.8.0
            Reporter: Roman Stumm


In a route builder, we have a log definition: 

from("direct:testSimple")
 .log("${body.toString}");

The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.

The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
from("direct:testSimple")
 .log("${body.toInfoString}");

Why does simple expression have a problem with a method named "toString"?


--
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

        

[jira] [Commented] (CAMEL-4647) Simple expression does not find method toString()

Posted by "Claus Ibsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13146885#comment-13146885 ] 

Claus Ibsen commented on CAMEL-4647:
------------------------------------

Just do .log("${body}") as Camel will convert the body to a String which then triggers a type conversion -> String.

When using the OGNL support in the simple language it leverages it from the bean component, which excludes the methods from java.lang.Object by default. We should possible include the toString() method.
                
> Simple expression does not find method toString()
> -------------------------------------------------
>
>                 Key: CAMEL-4647
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: camel 2.8.0
>            Reporter: Roman Stumm
>
> In a route builder, we have a log definition: 
> from("direct:testSimple")
>  .log("${body.toString}");
> The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.
> The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
> from("direct:testSimple")
>  .log("${body.toInfoString}");
> Why does simple expression have a problem with a method named "toString"?

--
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

        

[jira] [Assigned] (CAMEL-4647) Simple expression does not find method toString()

Posted by "Claus Ibsen (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4647?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen reassigned CAMEL-4647:
----------------------------------

    Assignee: Claus Ibsen
    
> Simple expression does not find method toString()
> -------------------------------------------------
>
>                 Key: CAMEL-4647
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: camel 2.8.0
>            Reporter: Roman Stumm
>            Assignee: Claus Ibsen
>
> In a route builder, we have a log definition: 
> from("direct:testSimple")
>  .log("${body.toString}");
> The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.
> The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
> from("direct:testSimple")
>  .log("${body.toInfoString}");
> Why does simple expression have a problem with a method named "toString"?

--
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

        

[jira] [Resolved] (CAMEL-4647) Simple expression does not find method toString()

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

Claus Ibsen resolved CAMEL-4647.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.9.0
                   2.8.3
    
> Simple expression does not find method toString()
> -------------------------------------------------
>
>                 Key: CAMEL-4647
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4647
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.8.0
>         Environment: camel 2.8.0
>            Reporter: Roman Stumm
>            Assignee: Claus Ibsen
>             Fix For: 2.8.3, 2.9.0
>
>
> In a route builder, we have a log definition: 
> from("direct:testSimple")
>  .log("${body.toString}");
> The body contains an object, that implements a public toString() method. But the problem is, that the simple-expression does not find the method toString() and route processing stops without throwing an exception.
> The funny thing is, that when we just rename the method, e.g. toInfoString(), then it works:
> from("direct:testSimple")
>  .log("${body.toInfoString}");
> Why does simple expression have a problem with a method named "toString"?

--
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