I ran into the same issue when trying to create a selector comparing an int in 2.4.1. I haven't attempted to try other primitives but suspect the same behavior.
String selector = "id = 5 OR id = 6";
If you haven't already found out, try:
String selector = "id = '5' OR id = '6'";
The selector grammar was changes betwen these release. Please file a bugreport on sourceforge.
I got the same error using 2.4.1. Previously I my message selector looked as follows:
messageid = '5'
even though messageid was an int, i changed this to
messageid = 5
in our latest build and it all worked fine. i think that the latter version is more correct (i.e. it looks like this was a bug fix).