JBoss 6 部署 war 文件并收到错误 NoSuchFieldError :factoryFinder
我正在尝试在 JBoss 6 上部署我的应用程序,并且在我的应用程序中使用 hibernate3、struts2 和 spring3。但是当我部署我的应用程序时,它给出了错误:
信息[STDOUT] org.springframework.beans.factory.BeanCreationException:创建ServletContext资源[/WEB-INF/applicationContext.xml]中定义的名为“sessionFactory”的bean时出错:调用init方法失败;嵌套异常是 java.lang.NoSuchFieldError:factoryFinder
I am trying to deploy my application on JBoss 6 and I am using hibernate3, struts2 and spring3 in my application. But when I am deploying my Application it is giving error:
INFO [STDOUT] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchFieldError: factoryFinder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一些jar的版本不兼容。
一个 jar 期望另一个 jar 中有一个字段
factoryFinder
,但它在提供的版本中不存在。我无法从提供的信息中分辨出哪些是有问题的罐子。但请注意,JBoss 的库中可能包含一个 hibernate 版本,因此类加载器可能不会加载您的 jar。
The versions of some jars are incompatible.
One jar is expecting a field
factoryFinder
in the other jar, but it does not exist in the supplied version.Which are the offending jars I can't tell from the information provided. But note that maybe JBoss includes a version of hibernate in its libraries, so your jar might not be loaded by the classloader.
当我们尝试更改服务器时会发生此类错误。我们使用的库的版本应该与服务器的版本兼容。
假设如果您要升级服务器,那么您还必须更新 jar 依赖项。
您遇到的问题是由于 jar 文件不兼容造成的。但是,无法确定是由于哪个特定文件而显示此错误。
您必须追踪该异常是在什么时候抛出的,然后该类出现在哪个 jar 文件中。据此,您可以尝试更新您的 jar 文件并完成它。
由于答案很晚,您可能需要更新到所有 jar 文件的最新版本。
These kind of errors occur when we try to change the server. The versions of libraries we are using should be compatible with the version of server.
Suppose if you are upgrading your server then you will have to update your jar dependencies as well.
The issue which you are facing is due to incompatible jar files. However it cannot be said due to which particular file it is showing this error.
You will have to trace this out at what point this exception is thrown and then that class is present in which jar file. According to that you can try to update your jar files and get it done.
As it is very late answer you might want to update to the latest versions of all jar files.