JBI component - spring load from classpath
I have a JBI binding component that tries to use spring to load in configuration properties from a file bundled in the component jar. I instantiate the bean container in my componentsinit()method
ClassPathResource resource =new ClassPathResource(xmlConfigFile);
beanFactory =new XmlBeanFactory(resource);
and see the following in my glassfish b-33/openesb log file:
Caused by: java.io.FileNotFoundException:class path resource [spring-basic.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:137)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:351)
... 17 more
The spring-basic.xml file is in the root of my component jar file and I'm not sure what is going on. I guess that that my component classloader is different from what I am expecting, but not sure what to do at this point to move forward.
As an additional piece of info, this same component loads properly in ServiceMix 3.1-incubating SNAPSHOT.
Any light shed on this would be appreciated.
[1279 byte] By [
wwiv4a] at [2007-11-26 17:42:00]

# 2
Mark,
Thank you for your quick reply. I had tried that and a few other variations with no luck, including putting my spring-basic.xml file in the META-INF directory. Below is the jbi.xml that I though would have worked, including the spring file listed in the component-class-path.
<?xml version="1.0" encoding="UTF-8"?>
<jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
<component type="service-engine">
<identification>
<name>my-binding-component</name>
<description>My Binding Component</description>
</identification>
<component-class-name>com.jeff.MyComponent</component-class-name>
<component-class-path>
<path-element>.</path-element>
<path-element>lib/commons-logging-1.0.4.jar</path-element>
<path-element>lib/soap-2.3.1.jar</path-element>
<path-element>lib/servicemix-core-3.0-incubating.jar</path-element>
<path-element>lib/backport-util-concurrent-2.1.jar</path-element>
<path-element>lib/spring-core-2.0.1.jar</path-element>
<path-element>lib/spring-beans-2.0.1.jar</path-element>
<path-element>spring-basic.xml</path-element>
</component-class-path>
<bootstrap-class-name>org.apache.servicemix.common.BaseBootstrap</bootstrap-class-name>
<bootstrap-class-path>
<path-element>.</path-element>
<path-element>lib/servicemix-common-3.0-incubating.jar</path-element>
<path-element>lib/commons-logging-1.0.4.jar</path-element>
</bootstrap-class-path>
</component>
</jbi>
And I double checked the spring-basic.xml is in the root of the component jar file.
Jeff