Hi,

I just wrote a simple test to reproduce the error, and found out current GuiceCamelContext doesn't take JndiBind as a part of registry element itself. You have to create the jndi context yourself like this[1].

[1]http://code.google.com/p/guiceyfruit/wiki/JNDI

On 8/17/11 5:42 AM, darkAR wrote:
I am trying to use a file filter for my route (as a consumer) and have tried
to get it to inject via guice. I've created a @Provides method and also
attached @JndiBind to it. It still will not get the filter.

Endpoint definition "file://src/test/resources?noop=true&filter=#fileFilter"

Provides method in guice module
        @Provides
        @JndiBind("fileFilter")
        public GenericFileFilter fileFilter(){
                return new TransportFileFilter();
        }

Error message
"Could not find a suitable setter for property: filter as there isn't a
setter method with same type: java.lang.String nor type conversion possible:
No type converter available to convert from type: java.lang.String to the
required type: org.apache.camel.component.file.GenericFileFilter with value
#fileFilter"

Any idea's?
Thanks in advance.


--
View this message in context: 
http://camel.465427.n5.nabble.com/Injecting-file-filter-via-Guice-tp4705927p4705927.html
Sent from the Camel - Users mailing list archive at Nabble.com.



--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Reply via email to