[ 
https://issues.apache.org/activemq/browse/SMXCOMP-496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=50925#action_50925
 ] 

Guillaume Nodet commented on SMXCOMP-496:
-----------------------------------------

A workaround is to not specify "file:" at the beginning of the file path.
It will be resolved as a plain file instead and will work whereas the file 
exists or not.

> Problem with file poller and creation of folders in smx4
> --------------------------------------------------------
>
>                 Key: SMXCOMP-496
>                 URL: https://issues.apache.org/activemq/browse/SMXCOMP-496
>             Project: ServiceMix Components
>          Issue Type: Bug
>    Affects Versions: servicemix-file-2009.01
>            Reporter: Guillaume Nodet
>
> {code}
> 15:30:55,748 | ERROR | xtenderThread-73 | OsgiBundleXmlApplicationContext  | 
> gatedExecutionApplicationContext  366 | Post refresh error
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'org.apache.servicemix.file.FilePollerEndpoint#0' defined in URL 
> [bundle://158.0:0/META-INF/spring/file-poller.xml]: Initialization of bean 
> failed; nested exception is org.springframework.beans.TypeMismatchException: 
> Failed to convert property value of type [java.lang.String] to required type 
> [java.io.File] for property 'file'; nested exception is 
> java.lang.IllegalArgumentException: Could not retrieve File for OSGi 
> resource[file:/Users/gnodet/work/apps/apache-servicemix-4.0.0/input|bnd.id=158|bnd.sym=file-poller.xml]:
>  OSGi 
> resource[file:/Users/gnodet/work/apps/apache-servicemix-4.0.0/input|bnd.id=158|bnd.sym=file-poller.xml]
>  cannot be resolved to absolute file path
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>       at 
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>       at 
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>       at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>       at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
>       at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:68)
>       at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:343)
>       at 
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
>       at 
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:308)
>       at 
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:138)
>       at java.lang.Thread.run(Thread.java:613)
> Caused by: org.springframework.beans.TypeMismatchException: Failed to convert 
> property value of type [java.lang.String] to required type [java.io.File] for 
> property 'file'; nested exception is java.lang.IllegalArgumentException: 
> Could not retrieve File for OSGi 
> resource[file:/Users/gnodet/work/apps/apache-servicemix-4.0.0/input|bnd.id=158|bnd.sym=file-poller.xml]:
>  OSGi 
> resource[file:/Users/gnodet/work/apps/apache-servicemix-4.0.0/input|bnd.id=158|bnd.sym=file-poller.xml]
>  cannot be resolved to absolute file path
>       at 
> org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
>       ... 16 more
> Caused by: java.lang.IllegalArgumentException: Could not retrieve File for 
> OSGi 
> resource[file:/Users/gnodet/work/apps/apache-servicemix-4.0.0/input|bnd.id=158|bnd.sym=file-poller.xml]:
>  OSGi 
> resource[file:/Users/gnodet/work/apps/apache-servicemix-4.0.0/input|bnd.id=158|bnd.sym=file-poller.xml]
>  cannot be resolved to absolute file path
>       at 
> org.springframework.beans.propertyeditors.FileEditor.setAsText(FileEditor.java:100)
>       at 
> org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:382)
>       at 
> org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:358)
>       at 
> org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:173)
>       at 
> org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
>       at 
> org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
>       ... 20 more
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to