Oozie EL函数:尝试将String转换为类型"java.lang.Double"时发生异常. [英] Oozie EL function: An exception occured trying to convert String to type "java.lang.Double"

查看:226
本文介绍了Oozie EL函数:尝试将String转换为类型"java.lang.Double"时发生异常.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行一个调用EL函数replaceAll()的Oozie工作流程.使用replaceAll()的操作是这个

I am trying to run an Oozie workflow that calls EL function replaceAll(). The action that's using the replaceAll() is this

  <action name="createSuccess">
     <fs>
         <configuration>
             <property>
                 <name>runDate</name>
                 <value>${replaceAll(hdfsDir, nameNode + '/(.+)/' + region + '/([0-9\\-]+)/?', '$2')}</value>
             </property>
         </configuration>
         <mkdir path="${nameNode}/path/run/${region}/${runDate}"/>
         <touchz path="${nameNode}/path/run/${region}/${runDate}/success.txt"/>
     </fs>
     <ok to="end"/>
     <error to="sendEmailKill"/>
  </action>

hdfsDir类似于hdfs://nameNode:8020/some/path/region/2015-04-22,我需要在最后获取该日期作为属性并使用它.

hdfsDir is something like hdfs://nameNode:8020/some/path/region/2015-04-22 and I need to grab that date at the end as a property and use it.

但是当我执行上述操作时,出现了此异常:

But when I run the above action, I got this exception:

javax.servlet.jsp.el.ELException: An exception occured trying to convert String "hdfs://nameNode:8020" to type "java.lang.Double"
        at org.apache.commons.el.Logger.logError(Logger.java:481)
        at org.apache.commons.el.Logger.logError(Logger.java:498)
        at org.apache.commons.el.Logger.logError(Logger.java:566)
        at org.apache.commons.el.Coercions.coerceToPrimitiveNumber(Coercions.java:440)
        at org.apache.commons.el.Coercions.applyArithmeticOperator(Coercions.java:852)
        at org.apache.commons.el.ArithmeticOperator.apply(ArithmeticOperator.java:83)
        at org.apache.commons.el.BinaryOperatorExpression.evaluate(BinaryOperatorExpression.java:170)
        at org.apache.commons.el.FunctionInvocation.evaluate(FunctionInvocation.java:163)
        at org.apache.commons.el.ExpressionString.evaluate(ExpressionString.java:114)
        at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:274)
        at org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190)
        at org.apache.oozie.util.ELEvaluator.evaluate(ELEvaluator.java:203)
        at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:175)
        at org.apache.oozie.command.wf.ActionStartXCommand.execute(ActionStartXCommand.java:60)
        at org.apache.oozie.command.XCommand.call(XCommand.java:280)
        at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:326)
        at org.apache.oozie.service.CallableQueueService$CompositeCallable.call(CallableQueueService.java:255)
        at org.apache.oozie.service.CallableQueueService$CallableWrapper.run(CallableQueueService.java:175)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

有什么主意为什么要得到这个异常以及如何解决它?

Any ideas why I'm getting this exception and how to fix it?

推荐答案

尝试错误后,我发现我不能使用"+"来连接两个字符串.我必须使用这个:

After trial an error, I figured out that I can not use "+" to concatenate two strings. I have to use this:

${replaceAll(hdfsDumpDir, concat(concat(concat(nameNode, '/(.+)/'),  region), '/'), '')}

这篇关于Oozie EL函数:尝试将String转换为类型"java.lang.Double"时发生异常.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆