You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by "Lionel Cons (Created) (JIRA)" <ji...@apache.org> on 2011/12/20 14:03:31 UTC

[jira] [Created] (APLO-122) org.josql.QueryParseException when using a negation

org.josql.QueryParseException when using a negation
---------------------------------------------------

                 Key: APLO-122
                 URL: https://issues.apache.org/jira/browse/APLO-122
             Project: ActiveMQ Apollo
          Issue Type: Bug
            Reporter: Lionel Cons


When trying to use the "NOT" operator in the REST interface, Apollo reports an exception:

org.josql.QueryParseException: Unable to find function (method): "NOT(java.lang.Boolean)" in any user-defined function handlers or the default function handler
	at org.josql.expressions.Function.init(Function.java:248)
	at org.josql.expressions.BinaryExpression.init(BinaryExpression.java:92)
	at org.josql.Query.init(Query.java:2171)
	at org.josql.Query.parse(Query.java:2048)
	at org.apache.activemq.apollo.web.resources.BrokerResource.narrow(BrokerResource.scala:449)
	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
	at org.fusesource.hawtdispatch.Future$$anon$2.merge(Future.scala:125)
	at org.fusesource.hawtdispatch.SettableFuture$class.set(Future.scala:46)
	at org.fusesource.hawtdispatch.Future$$anon$2.set(Future.scala:124)
	at org.fusesource.hawtdispatch.SettableFuture$class.apply(Future.scala:41)
	at org.fusesource.hawtdispatch.Future$$anon$2.apply(Future.scala:124)
	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
	at scala.Option.foreach(Option.scala:197)

FWIW, the expression I tried to use was "(id LIKE '%bar%') AND NOT (id LIKE '%foo%')".

First, I would have expected such an exception to cause the REST interface to report a "server error". Instead, it only reported "404 Not Found".

Then, why can't I use the unary NOT this way?

--
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] (APLO-122) org.josql.QueryParseException when using a negation

Posted by "Hiram Chirino (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APLO-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174424#comment-13174424 ] 

Hiram Chirino commented on APLO-122:
------------------------------------

In the newly deployed snapshot you should be able to use your original query now.
                
> org.josql.QueryParseException when using a negation
> ---------------------------------------------------
>
>                 Key: APLO-122
>                 URL: https://issues.apache.org/jira/browse/APLO-122
>             Project: ActiveMQ Apollo
>          Issue Type: Bug
>            Reporter: Lionel Cons
>            Assignee: Hiram Chirino
>             Fix For: 1.0
>
>
> When trying to use the "NOT" operator in the REST interface, Apollo reports an exception:
> org.josql.QueryParseException: Unable to find function (method): "NOT(java.lang.Boolean)" in any user-defined function handlers or the default function handler
> 	at org.josql.expressions.Function.init(Function.java:248)
> 	at org.josql.expressions.BinaryExpression.init(BinaryExpression.java:92)
> 	at org.josql.Query.init(Query.java:2171)
> 	at org.josql.Query.parse(Query.java:2048)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource.narrow(BrokerResource.scala:449)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.merge(Future.scala:125)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.set(Future.scala:46)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.set(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.apply(Future.scala:41)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.apply(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at scala.Option.foreach(Option.scala:197)
> FWIW, the expression I tried to use was "(id LIKE '%bar%') AND NOT (id LIKE '%foo%')".
> First, I would have expected such an exception to cause the REST interface to report a "server error". Instead, it only reported "404 Not Found".
> Then, why can't I use the unary NOT this way?

--
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] (APLO-122) org.josql.QueryParseException when using a negation

Posted by "Hiram Chirino (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APLO-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174235#comment-13174235 ] 

Hiram Chirino commented on APLO-122:
------------------------------------

The query works if you move the NOT so it's ahead of the LIKE operator.  Example:

"(id LIKE '%bar%') AND (id NOT LIKE '%foo%')"
                
> org.josql.QueryParseException when using a negation
> ---------------------------------------------------
>
>                 Key: APLO-122
>                 URL: https://issues.apache.org/jira/browse/APLO-122
>             Project: ActiveMQ Apollo
>          Issue Type: Bug
>            Reporter: Lionel Cons
>
> When trying to use the "NOT" operator in the REST interface, Apollo reports an exception:
> org.josql.QueryParseException: Unable to find function (method): "NOT(java.lang.Boolean)" in any user-defined function handlers or the default function handler
> 	at org.josql.expressions.Function.init(Function.java:248)
> 	at org.josql.expressions.BinaryExpression.init(BinaryExpression.java:92)
> 	at org.josql.Query.init(Query.java:2171)
> 	at org.josql.Query.parse(Query.java:2048)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource.narrow(BrokerResource.scala:449)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.merge(Future.scala:125)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.set(Future.scala:46)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.set(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.apply(Future.scala:41)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.apply(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at scala.Option.foreach(Option.scala:197)
> FWIW, the expression I tried to use was "(id LIKE '%bar%') AND NOT (id LIKE '%foo%')".
> First, I would have expected such an exception to cause the REST interface to report a "server error". Instead, it only reported "404 Not Found".
> Then, why can't I use the unary NOT this way?

--
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] (APLO-122) org.josql.QueryParseException when using a negation

Posted by "Hiram Chirino (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APLO-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174188#comment-13174188 ] 

Hiram Chirino commented on APLO-122:
------------------------------------

Could you post the full URL you tried to access? Thanks.
                
> org.josql.QueryParseException when using a negation
> ---------------------------------------------------
>
>                 Key: APLO-122
>                 URL: https://issues.apache.org/jira/browse/APLO-122
>             Project: ActiveMQ Apollo
>          Issue Type: Bug
>            Reporter: Lionel Cons
>
> When trying to use the "NOT" operator in the REST interface, Apollo reports an exception:
> org.josql.QueryParseException: Unable to find function (method): "NOT(java.lang.Boolean)" in any user-defined function handlers or the default function handler
> 	at org.josql.expressions.Function.init(Function.java:248)
> 	at org.josql.expressions.BinaryExpression.init(BinaryExpression.java:92)
> 	at org.josql.Query.init(Query.java:2171)
> 	at org.josql.Query.parse(Query.java:2048)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource.narrow(BrokerResource.scala:449)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.merge(Future.scala:125)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.set(Future.scala:46)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.set(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.apply(Future.scala:41)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.apply(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at scala.Option.foreach(Option.scala:197)
> FWIW, the expression I tried to use was "(id LIKE '%bar%') AND NOT (id LIKE '%foo%')".
> First, I would have expected such an exception to cause the REST interface to report a "server error". Instead, it only reported "404 Not Found".
> Then, why can't I use the unary NOT this way?

--
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] (APLO-122) org.josql.QueryParseException when using a negation

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

Hiram Chirino resolved APLO-122.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0
         Assignee: Hiram Chirino

Just committed a change wich add  a NOT(Boolean) query function.  Return a ErrorDTO holding the error message for all 40x and 50x status codes.  Really return a 500 error result and log as a warning on all unexpected exceptions. Updated management api to reflect the change in the error handling.
                
> org.josql.QueryParseException when using a negation
> ---------------------------------------------------
>
>                 Key: APLO-122
>                 URL: https://issues.apache.org/jira/browse/APLO-122
>             Project: ActiveMQ Apollo
>          Issue Type: Bug
>            Reporter: Lionel Cons
>            Assignee: Hiram Chirino
>             Fix For: 1.0
>
>
> When trying to use the "NOT" operator in the REST interface, Apollo reports an exception:
> org.josql.QueryParseException: Unable to find function (method): "NOT(java.lang.Boolean)" in any user-defined function handlers or the default function handler
> 	at org.josql.expressions.Function.init(Function.java:248)
> 	at org.josql.expressions.BinaryExpression.init(BinaryExpression.java:92)
> 	at org.josql.Query.init(Query.java:2171)
> 	at org.josql.Query.parse(Query.java:2048)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource.narrow(BrokerResource.scala:449)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.merge(Future.scala:125)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.set(Future.scala:46)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.set(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.apply(Future.scala:41)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.apply(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at scala.Option.foreach(Option.scala:197)
> FWIW, the expression I tried to use was "(id LIKE '%bar%') AND NOT (id LIKE '%foo%')".
> First, I would have expected such an exception to cause the REST interface to report a "server error". Instead, it only reported "404 Not Found".
> Then, why can't I use the unary NOT this way?

--
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] (APLO-122) org.josql.QueryParseException when using a negation

Posted by "Hiram Chirino (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/APLO-122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13174231#comment-13174231 ] 

Hiram Chirino commented on APLO-122:
------------------------------------

I was able to replicate using the follow curl command:

curl -u "admin:password" `echo 'http://localhost:61680/broker/virtual-hosts/localhost/queues.json?f=id&q=(id LIKE "%bar%") and not (id LIKE "%foo%")' | sed 's/%/%25/g' | sed 's/ /%20/g'`
                
> org.josql.QueryParseException when using a negation
> ---------------------------------------------------
>
>                 Key: APLO-122
>                 URL: https://issues.apache.org/jira/browse/APLO-122
>             Project: ActiveMQ Apollo
>          Issue Type: Bug
>            Reporter: Lionel Cons
>
> When trying to use the "NOT" operator in the REST interface, Apollo reports an exception:
> org.josql.QueryParseException: Unable to find function (method): "NOT(java.lang.Boolean)" in any user-defined function handlers or the default function handler
> 	at org.josql.expressions.Function.init(Function.java:248)
> 	at org.josql.expressions.BinaryExpression.init(BinaryExpression.java:92)
> 	at org.josql.Query.init(Query.java:2171)
> 	at org.josql.Query.parse(Query.java:2048)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource.narrow(BrokerResource.scala:449)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.apache.activemq.apollo.web.resources.BrokerResource$$anonfun$queues$1$$anonfun$20.apply(BrokerResource.scala:528)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.merge(Future.scala:125)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.set(Future.scala:46)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.set(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$class.apply(Future.scala:41)
> 	at org.fusesource.hawtdispatch.Future$$anon$2.apply(Future.scala:124)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$map$1.apply(Future.scala:105)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at org.fusesource.hawtdispatch.SettableFuture$$anonfun$set$1.apply(Future.scala:57)
> 	at scala.Option.foreach(Option.scala:197)
> FWIW, the expression I tried to use was "(id LIKE '%bar%') AND NOT (id LIKE '%foo%')".
> First, I would have expected such an exception to cause the REST interface to report a "server error". Instead, it only reported "404 Not Found".
> Then, why can't I use the unary NOT this way?

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