Exception when accessing resource file in osgi bundle
edebar Apr 11, 2014 8:39 AMHi,
I'm trying fuse 6.1 on a AIX server and having a little problem in a bean initialization :
I created a spring-dm bundle, based on the "com.fusesource.byexample.hellocamel".
I just add a bean BranchXmlSchemaValidatorBean, wich is declared as follow :
<bean id="BranchXmlSchemaValidatorBean"
class="com.fusesource.byexample.hellocamel.impl.XmlSchemaValidatorBean">
<property name="schemaPath" value="classpath:DocrouterBranch.xsd" />
</bean>
In the class, the method setSchemaPath is : public void setSchemaPath(Resource schemaPath)
Locally on my pc in eclipse, the route is working fine, BUT on the fuse 6.1 beta server, the route is NOT starting, see the stacktrace below.
I can say that in the jar file, the xsd is there in the root.
Can someone tell me the problem ?
Thanks a lot !
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BranchXmlSchemaValidatorBean' defined in URL [bundle://282.0:0/META-INF/spring/camel-context.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'schemaPath' threw exception; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:DocrouterBranch.xsd|bnd.id=282|bnd.sym=com.fusesource.byexample.hellocamel.HelloCamel] cannot be resolved to absolute file path
- 1423
- 1128
- 519
- 458
- 295
- 223
- 292
- 194
- 628
- 932
- at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[org.springframework.osgi:spring-osgi-core:1.2.1]
- at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[org.springframework.osgi:spring-osgi-core:1.2.1]
- at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[org.springframework.osgi:spring-osgi-core:1.2.1]
- at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[org.springframework.osgi:spring-osgi-core:1.2.1]
- at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[org.springframework.osgi:spring-osgi-extender:1.2.1]
- at java.lang.Thread.run(Thread.java:761)[:1.6.0]
- Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'schemaPath' threw exception; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:DocrouterBranch.xsd|bnd.id=282|bnd.sym=com.fusesource.byexample.hellocamel.HelloCamel] cannot be resolved to absolute file path
- 101
- 57
- 1420
- ... 15 more