camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joni Nousiainen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-7262) IAE with calling String.replaceAll via simple expression in Karaf
Date Mon, 03 Mar 2014 11:59:23 GMT
Joni Nousiainen created CAMEL-7262:
--------------------------------------

             Summary: IAE with calling String.replaceAll via simple expression in Karaf
                 Key: CAMEL-7262
                 URL: https://issues.apache.org/jira/browse/CAMEL-7262
             Project: Camel
          Issue Type: Bug
          Components: camel-core, karaf
    Affects Versions: 2.12.3, 2.12.2
         Environment: Karaf version: 2.3.3
JDK/JRE: Oracle JDK 1.7.0_51
OS: Windows 7 Pro
            Reporter: Joni Nousiainen
            Priority: Minor


I have a Camel route along which I do something like this:

{code}
<setHeader headerName="CamelHttpPath">
  <simple>/resource/${headers.RESOURCE_ID.replaceAll("/", "%2F")}</simple>
</setHeader>
{code}

I have JUnit test set up for the route and it passes OK. But when I deploy my bundle to Karaf
I get the following exception:

{code}
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: .replaceAll("/",
"%2F") on null due to: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed
to invoke method: replaceAll("/", "%2F") on null due to: java.lang.IllegalArgumentException:
name must be specified and not empty
	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:117)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:132)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.model.language.ExpressionDefinition.evaluate(ExpressionDefinition.java:121)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.model.language.ExpressionDefinition.evaluate(ExpressionDefinition.java:113)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.builder.ExpressionBuilder$KeyedOgnlExpressionAdapter.evaluate(ExpressionBuilder.java:1814)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.builder.ExpressionBuilder$58.evaluate(ExpressionBuilder.java:1381)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.builder.SimpleBuilder.evaluate(SimpleBuilder.java:83)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:103)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:573)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:506)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:215)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:573)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:506)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:215)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Splitter.process(Splitter.java:98)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:573)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:506)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:215)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:573)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.doProcessSequential(MulticastProcessor.java:506)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.java:215)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Splitter.process(Splitter.java:98)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.FilterProcessor.process(FilterProcessor.java:58)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:401)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:201)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:165)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[73:org.apache.camel.camel-core:2.12.2]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_51]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_51]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_51]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_51]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51]
	at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
Caused by: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke
method: replaceAll("/", "%2F") on null due to: java.lang.IllegalArgumentException: name must
be specified and not empty
	at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:285)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:114)[73:org.apache.camel.camel-core:2.12.2]
	... 90 more
Caused by: java.lang.IllegalArgumentException: name must be specified and not empty
	at org.apache.camel.util.ObjectHelper.notEmpty(ObjectHelper.java:331)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.core.osgi.OsgiClassResolver.doLoadClass(OsgiClassResolver.java:87)[76:org.apache.camel.camel-spring:2.12.2]
	at org.apache.camel.core.osgi.OsgiClassResolver.resolveClass(OsgiClassResolver.java:47)[76:org.apache.camel.camel-spring:2.12.2]
	at org.apache.camel.component.bean.BeanHelper.isAssignableToExpectedType(BeanHelper.java:121)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.MethodInfo$2.evaluateParameterValue(MethodInfo.java:515)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.MethodInfo$2.evaluate(MethodInfo.java:472)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.MethodInfo.createMethodInvocation(MethodInfo.java:239)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:278)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:180)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:148)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:67)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.language.bean.BeanExpression$InvokeProcessor.process(BeanExpression.java:189)[73:org.apache.camel.camel-core:2.12.2]
	at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:281)[73:org.apache.camel.camel-core:2.12.2]
	... 91 more
{code}

The notable difference seems to be that the JUnit test uses `DefaultClassResolver` instead
of `OsgiClassResolver` which is used in Karaf.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message