EJB容器中的Spring 2.5

时间:2021-08-23 20:14:26

I would like to use the spring framework within an EJB3 project. In detail I would like to use the JDBC template class which should be instantinated from a given data source. When I put the spring.jar to my Jboss lib directoy everything is working fine. But when I put the JAR inside my EAR only there seems to be external dependencies from JDbcTemplate to other libraries. EARs/EJBs classloader try to instantinate the JdbcTemplate and shows me that he can not load the class because of external dependencies. It does not show me which additional JARs I have to put in.

我想在EJB3项目中使用spring框架。详细地说,我想使用JDBC模板类,它应该从给定的数据源进行即时处理。当我把spring.jar放到我的Jboss lib directoy时,一切都运行正常。但是当我将JAR放入我的EAR中时,似乎存在从JDbcTemplate到其他库的外部依赖。 EAR / EJBs类加载器尝试即时更新JdbcTemplate,并向我显示由于外部依赖性,他无法加载该类。它没有告诉我我必须添加哪些额外的JAR。

Question: Does some body know which addtional JARs I have to include or even how I can search for depending JARs with external tool. I remember there is a tool which can do this, but I do not know its name anymore. I think something like jarjar etc.

问题:是否有人知道我必须包含哪些附加JAR,甚至我如何使用外部工具搜索依赖JAR。我记得有一个工具可以做到这一点,但我不知道它的名字了。我觉得像jarjar等。

Could anyone help please? Thank you.

有人可以帮忙吗?谢谢。

1 个解决方案

#1


This smells like an EAR config problem not an Spring problem. Are you sure that the jar is in the EJB's classpath? You might want to check the MANIFEST.MF file of the EJB's jar to verify this.

这有点像EAR配置问题而不是Spring问题。你确定jar是在EJB的类路径中吗?您可能想要检查EJB jar的MANIFEST.MF文件以验证这一点。

#1


This smells like an EAR config problem not an Spring problem. Are you sure that the jar is in the EJB's classpath? You might want to check the MANIFEST.MF file of the EJB's jar to verify this.

这有点像EAR配置问题而不是Spring问题。你确定jar是在EJB的类路径中吗?您可能想要检查EJB jar的MANIFEST.MF文件以验证这一点。