camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Diego (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-4988) Problems with Simple language
Date Wed, 08 Feb 2012 07:46:05 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-4988?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13203343#comment-13203343
] 

Diego commented on CAMEL-4988:
------------------------------

The problem is that I upgraded my application to Camel 2.9.0 from Camel 2.8.0 and all the
routes with simple expressions started to fail. All the other routes seem to work as usual,
Camel is an great framework!

I debugged the application and the source of the problem seems to be in the simple expressions.
The parsers allways fails (sometimes silently) because the start and end tokens are strange
strings (like "97830e4816280eb7") instead of the usual strings "${", "}".

Debugging the application with a breakpoint in the SimpleLanguage constructor "public SimpleLanguage(String
functionStartToken, String functionEndToken)" I found that Camel automatically replaces the
standard tokens with these strange strings (I copy the stacktrace at the end of the comment).
It seems that in the SimpleLanguage initialization the SpringInjector chooses the wrong constructor
instead of the default one.

If I declare a bean with de SimpleLanguage an set explicitly the tokens everything works fine.

Thread [DefaultQuartzScheduler-camel-7_Worker-1] (Suspended (breakpoint at line 110 in SimpleLanguage))

	SimpleLanguage.<init>(String, String) line: 110	
	NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) line: not available [native
method]	
	NativeConstructorAccessorImpl.newInstance(Object[]) line: 39	
	DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 27	
	Constructor<T>.newInstance(Object...) line: 513	
	BeanUtils.instantiateClass(Constructor<T>, Object...) line: 126	
	CglibSubclassingInstantiationStrategy(SimpleInstantiationStrategy).instantiate(RootBeanDefinition,
String, BeanFactory, Constructor<?>, Object[]) line: 108	
	ConstructorResolver.autowireConstructor(String, RootBeanDefinition, Constructor[], Object[])
line: 280	
	DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).autowireConstructor(String,
RootBeanDefinition, Constructor[], Object[]) line: 1003	
	DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBeanInstance(String,
RootBeanDefinition, Object[]) line: 907	
	DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).doCreateBean(String, RootBeanDefinition,
Object[]) line: 485	
	DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(String, RootBeanDefinition,
Object[]) line: 456	
	DefaultListableBeanFactory(AbstractAutowireCapableBeanFactory).createBean(Class, int, boolean)
line: 331	
	SpringInjector.newInstance(Class<T>) line: 39	
	DefaultLanguageResolver.resolveLanguage(String, CamelContext) line: 75	
	SpringCamelContext(DefaultCamelContext).resolveLanguage(String) line: 951	
	SimpleBuilder.createExpression(Exchange) line: 86	
	SimpleBuilder.evaluate(Exchange, Class<T>) line: 80	
	Splitter.createProcessorExchangePairs(Exchange) line: 102	
	Splitter(MulticastProcessor).process(Exchange, AsyncCallback) line: 208	
	Splitter.process(Exchange, AsyncCallback) line: 97	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line: 73	
	InstrumentationProcessor(DelegateAsyncProcessor).processNext(Exchange, AsyncCallback) line:
99	
	InstrumentationProcessor(DelegateAsyncProcessor).process(Exchange, AsyncCallback) line: 90

	InstrumentationProcessor.process(Exchange, AsyncCallback) line: 71	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line: 73	
	TraceInterceptor(DelegateAsyncProcessor).processNext(Exchange, AsyncCallback) line: 99	
	TraceInterceptor(DelegateAsyncProcessor).process(Exchange, AsyncCallback) line: 90	
	TraceInterceptor.process(Exchange, AsyncCallback) line: 91	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line: 73	
	DefaultErrorHandler(RedeliveryErrorHandler).processErrorHandler(Exchange, AsyncCallback,
RedeliveryErrorHandler$RedeliveryData) line: 322	
	DefaultErrorHandler(RedeliveryErrorHandler).process(Exchange, AsyncCallback) line: 213	
	RouteContextProcessor.processNext(Exchange, AsyncCallback) line: 45	
	RouteContextProcessor(DelegateAsyncProcessor).process(Exchange, AsyncCallback) line: 90	
	DefaultChannel.process(Exchange, AsyncCallback) line: 303	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line: 73	
	Pipeline.process(Exchange, Exchange, AsyncCallback, Iterator<Processor>, AsyncProcessor)
line: 117	
	Pipeline.process(Exchange, AsyncCallback) line: 80	
	RouteContextProcessor.processNext(Exchange, AsyncCallback) line: 45	
	RouteContextProcessor(DelegateAsyncProcessor).process(Exchange, AsyncCallback) line: 90	
	UnitOfWorkProcessor.processAsync(Exchange, AsyncCallback, UnitOfWork) line: 150	
	UnitOfWorkProcessor.process(Exchange, AsyncCallback) line: 117	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line: 73	
	InstrumentationProcessor(DelegateAsyncProcessor).processNext(Exchange, AsyncCallback) line:
99	
	InstrumentationProcessor(DelegateAsyncProcessor).process(Exchange, AsyncCallback) line: 90

	InstrumentationProcessor.process(Exchange, AsyncCallback) line: 71	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange, AsyncCallback) line: 73	
	RoundRobinLoadBalancer(QueueLoadBalancer).process(Exchange, AsyncCallback) line: 44	
	AsyncProcessorHelper.process(AsyncProcessor, Exchange) line: 99	
	RoundRobinLoadBalancer(QueueLoadBalancer).process(Exchange) line: 71	
	QuartzEndpoint.onJobExecute(JobExecutionContext) line: 112	
	CamelJob.execute(JobExecutionContext) line: 54	
	JobRunShell.run() line: 216	
	SimpleThreadPool$WorkerThread.run() line: 549	

                
> Problems with Simple language
> -----------------------------
>
>                 Key: CAMEL-4988
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4988
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.0
>         Environment: Standalone application with Spring context and routes defined in
XML.
>            Reporter: Diego
>
> If you don't use a simple expresion that falls back to the SimpleBackwardsCompatibleParser,
the simple language doesn't seem to work. If I override the start and end token with an explicit
definition of the simplelanguage everything works well.
>   <bean id="simple" class="org.apache.camel.language.simple.SimpleLanguage">
>       <constructor-arg name="functionStartToken" value="${"/>
>       <constructor-arg name="functionEndToken" value="}"/>
>   </bean> 
> It seems that org.apache.camel.language.simple.SimpleExpressionParser.SimpleExpressionParser(String)
fails to create an expression because startToken and endToken are "automagically" changed
for strange Strings. It seems that when exchange.getContext().resolveLanguage("simple") tries
to resolve the languaje it doesn't use the default construtor and injects a strange start
and end token in the constructor SimpleLanguage(String functionStartToken, String functionEndToken).

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

        

Mime
View raw message