我想在osgi(fuse esb)中部署一个基于spring的包。在spring上下文中,我指的是资源文件夹内的db4o文件。根据我的理解,Maven项目将确保在资源文件夹下可用的任何文件将在项目类路径中可用。我已将该文件保存在资源/ META-INF/spring/repo/test.db4o下。春季OSGi类路径资源问题
下面是春天的条目。
<bean id="objectContainer" class="org.springmodules.db4o.ObjectContainerFactoryBean">
<property name="databaseFile" value="classpath:META-INF/spring/repo/test.db4o" />
</bean>
一旦我安装并尝试启动应用程序,我收到以下异常。
java.io.FileNotFoundException: OSGi resource[classpath:META-INF/spring/repo/test.db4o|bnd.id=258|bnd.sym=taxonomydaoimplbundle] cannot be resolved to absolute file path because it does not reside in the file system: bundle://258.0:1/META-INF/spring/repo/test.db4o
我试过不同的组合,但OSGi似乎没有认出这个文件。任何指针将不胜感激。
-Thanks
捆绑'test.db4o'文件在哪?你必须把它们放在同一个包中。 – 2011-06-13 02:33:06
它在同一个包中。 – Shamik 2011-06-13 15:09:12
您是否尝试过'classpath:/ META-INF/spring/repo/test.db4o'(路径以斜线开头) – FrVaBe 2011-06-14 09:11:24