org.springframework.beans.factory.BeanDefinitionStoreException:从类路径资源解析 XML 文档时出现意外异常

发布于 2024-08-10 06:00:47 字数 5562 浏览 8 评论 0原文

您好,我正在开发一个 RIA 应用程序,使用 SWING 作为客户端,使用 HTTPInvoker 在服务器端使用 Java WebStart JNLP 和 Spring。

当我尝试启动时收到以下错误消息:从 JNLP 运行我的应用程序。但是,如果我运行与 java 应用程序相同的操作,它可以正常工作并与服务器通信并使用 spring bean 获取数据。

我的 client.xml 文件位于客户端包中,由 jnlp 查看。

这是我的 JNLP 文件:

<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="1.0+" codebase="http://localhost:9080/fawsServer" href="fawsWebstart.jnlp">   
  <information> 
    <title>Force Analyst</title> 
    <vendor>***</vendor>      
    <description>Force Analyst</description>     
    <description kind="short">
       A demo of the capabilities of JAVA WebStart.
    </description>     
    <offline-allowed>false</offline-allowed>
  </information>

  <resources> 
    <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/> 
    <jar href="fawsClient.jar" download="eager" main="true"/>
    <jar href="fawsModel.jar" download="eager" main="false"/>
    <jar href="fawsIcons.jar" download="eager" main="false"/>   
    <jar href="spring-core.jar" download="eager" main="false"/>
    <jar href="commons-logging-1.0.4.jar" download="eager" main="false"/>
    <jar href="spring-2.5.6.jar" download="eager" main="false"/>
  </resources> 

  <application-desc
         name="Force Analyst Application"
         main-class="com.att.edge.fawsclient.main.SplashWindow"
         width="710"
         height="380">
  </application-desc>
  <update check="background"/>
</jnlp>

错误:

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
    at com.att.edge.fawsclient.dao.factory.DAOFactory.getMessagesDAO(DAOFactory.java:110)
    at com.att.edge.fawsclient.comm.messages.ReadMessagesFrame.<init>(ReadMessagesFrame.java:114)
    at com.att.edge.fawsclient.comm.messages.ReadMessagesFrame.getReadMessagesFrame(ReadMessagesFrame.java:87)
    at com.att.edge.fawsclient.main.ForceAnalystPalette.getMessageFrame(ForceAnalystPalette.java:306)
    at com.att.edge.fawsclient.main.ForceAnalystPalette.actionPerformed(ForceAnalystPalette.java:1173)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [fawsClient-client.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
    at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
    at com.att.edge.fawsclient.dao.factory.DAOFactory$BeanFactoryHolder.<clinit>(DAOFactory.java:40)
    ... 30 more
Caused by: java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:99)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:78)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createBeanDefinitionDocumentReader(XmlBeanDefinitionReader.java:518)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:505)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
    ... 35 more

Hi I am developing a RIA application using SWING as client,Java WebStart JNLP and Spring on server side using HTTPInvoker.

I am getting the below error message when I am trying to Launch & Run my application from JNLP. But if I run the same as java application it workes fine and communicate with server and fetch data using spring bean.

My client.xml file is in a client package and looked by jnlp.

Here is my JNLP file :

<?xml version="1.0" encoding="utf-8"?> 
<jnlp spec="1.0+" codebase="http://localhost:9080/fawsServer" href="fawsWebstart.jnlp">   
  <information> 
    <title>Force Analyst</title> 
    <vendor>***</vendor>      
    <description>Force Analyst</description>     
    <description kind="short">
       A demo of the capabilities of JAVA WebStart.
    </description>     
    <offline-allowed>false</offline-allowed>
  </information>

  <resources> 
    <j2se version="1.5+" href="http://java.sun.com/products/autodl/j2se"/> 
    <jar href="fawsClient.jar" download="eager" main="true"/>
    <jar href="fawsModel.jar" download="eager" main="false"/>
    <jar href="fawsIcons.jar" download="eager" main="false"/>   
    <jar href="spring-core.jar" download="eager" main="false"/>
    <jar href="commons-logging-1.0.4.jar" download="eager" main="false"/>
    <jar href="spring-2.5.6.jar" download="eager" main="false"/>
  </resources> 

  <application-desc
         name="Force Analyst Application"
         main-class="com.att.edge.fawsclient.main.SplashWindow"
         width="710"
         height="380">
  </application-desc>
  <update check="background"/>
</jnlp>

ERROR :

Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
    at com.att.edge.fawsclient.dao.factory.DAOFactory.getMessagesDAO(DAOFactory.java:110)
    at com.att.edge.fawsclient.comm.messages.ReadMessagesFrame.<init>(ReadMessagesFrame.java:114)
    at com.att.edge.fawsclient.comm.messages.ReadMessagesFrame.getReadMessagesFrame(ReadMessagesFrame.java:87)
    at com.att.edge.fawsclient.main.ForceAnalystPalette.getMessageFrame(ForceAnalystPalette.java:306)
    at com.att.edge.fawsclient.main.ForceAnalystPalette.actionPerformed(ForceAnalystPalette.java:1173)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [fawsClient-client.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:73)
    at org.springframework.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:61)
    at com.att.edge.fawsclient.dao.factory.DAOFactory$BeanFactoryHolder.<clinit>(DAOFactory.java:40)
    ... 30 more
Caused by: java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.makeAccessible(Ljava/lang/reflect/Constructor;)V
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:99)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:78)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createBeanDefinitionDocumentReader(XmlBeanDefinitionReader.java:518)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:505)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
    ... 35 more

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半葬歌 2024-08-17 06:00:47

相关类(org.springframework.util.ReflectionUtils)同时存在于 sping-2.5.6.jar 和 spring-core.jar 中,我猜它会导致混淆。首先,我会放弃 spring-core.jar,因为它包含在大 spring.jar 中。

The relevant class (org.springframework.util.ReflectionUtils) exists in both sping-2.5.6.jar and in spring-core.jar, and I guess it causes a mix up. As a start, I would drop spring-core.jar, as it is included in the big spring.jar.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文