On Mon, Nov 26, 2012 at 6:56 PM, dunnlow <dunn...@yahoo.com> wrote:
> With camel 2.10 and Spring 3.1 I am trying to test to see if a string in a
> header exists OR is too short.  The test for null works as expected, but I
> seem to be unable to check the length.  Any thoughts as to why?
>
> <camel:choice>
>    <camel:when>
>      <camel:javascript>
>           request.headers.get('name')==null ||
> request.headers.get('name').length
>      </camel:javascript>
>      <camel:setBody><camel:constant>Name too
> small</camel:constant></camel:setBody>
>    <camel:when>
> </camel:choice>
>
> Is there a better way to do this?
>
> Oddly, while trying to figure out the issue, I added an otherwise statement
> like:
> <camel:otherwise>
>     <camel:setBody>
>        <camel:javaScript>String("Hello").length</camel:javaScript>
>     </camel:setBody>
> <camel:otherwise>
>
> I get the exception
> java.lang.ClassNotFoundException  org.apache.hadoop.hbase.util.Bytes
>

Do you run this in some container? If so what is that?
It seems that the header is a hbase type, and that class is not on the
classpath.


> my simple little test does not use hadoop
>
> (I also tried just "Hello".length and got the same exception)
>
> Thanks for any insight,
> -J
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/If-header-a-string-exists-and-length-is-5-then-via-Spring-DSL-tp5723252.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to