Java Spring Blaze DS - ANTLR 异常

发布于 2024-10-12 17:38:31 字数 2478 浏览 2 评论 0原文

我设置了一个简单的 java spring 服务器,它使用 hibernate 来访问数据库。但是,当尝试对数据库表执行查询时,Flex 数据服务向导 testOperation 函数会返回此错误消息。

InvocationTargetException:There was an error while invoking the operation. Check your server settings and try invoking the operation again. 

Reason: Server error java.lang.NoClassDefFoundError : antlr/ANTLRException null 

现在 antlr jar 位于类路径和服务器上的 lib 文件夹中,所以我看不出这是怎么回事。有谁知道为什么会发生此错误。这是控制台输出也有帮助。我创建了另一个名为 foo 的类,它使用相同的休眠模板将 bar 对象保存到数据库中,并且效果很好。就在尝试对用户数据库执行操作时。

BlazeDS]FlexSession created with id '0F8814A114349B363B928EDAF0694597' for an Http-based client connection.
[BlazeDS]Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=, responseURI=/0)
    (Array #0)
      [0] = (Typed Object #1 'flex.messaging.messages.RemotingMessage')
        timestamp = 0.0
        headers = (Array #2)
        operation = "findByFname"
        body = (Array #3)
          [0] = "Chris"
        source = null
        remotePassword = null
        remoteUsername = null
        parameters = (Array #4)
          [0] = "Chris"
        messageId = "3E55B425-C80A-FC8F-DE71-1781509D62F8"
        timeToLive = 0.0
        clientId = null
        destination = "userServiceImpl"

2011-01-16 21:27:36 DEBUG [http-8080-2] (SessionImpl.java:247) - opened session at timestamp: 12952132559
[BlazeDS]Serializing AMF/HTTP response
Version: 3
  (Header #0 name=AppendToGatewayUrl, mustUnderstand=true)
    ";jsessionid=0F8814A114349B363B928EDAF0694597"

  (Message #0 targetURI=/0/onStatus, responseURI=)
    (Typed Object #0 'flex.messaging.messages.ErrorMessage')
      headers = (Object #1)
      rootCause = (Typed Object #2 'java.lang.NoClassDefFoundError')
        message = "antlr/ANTLRException"
        localizedMessage = "antlr/ANTLRException"
        cause = (Typed Object #3 'java.lang.ClassNotFoundException')
          message = "antlr.ANTLRException"
          localizedMessage = "antlr.ANTLRException"
          cause = null
          exception = null
      body = null
      correlationId = "3E55B425-C80A-FC8F-DE71-1781509D62F8"
      faultDetail = null
      faultString = "java.lang.NoClassDefFoundError : antlr/ANTLRException"
      clientId = "3E55BD3A-0009-92C7-EA7F-7636A529BFBF"
      timeToLive = 0.0
      destination = "userServiceImpl"
      timestamp = 1.295213256298E12
      extendedData = null
      faultCode = "Server.Processing"
      messageId = "3E55C800-CA0B-BE98-FA79-64DC86BD18B1"

I have a simple java spring server set up that uses hibernate to access the database. However when tring to perform a query on a database table the flex data services wizard testOperation function returns this error message.

InvocationTargetException:There was an error while invoking the operation. Check your server settings and try invoking the operation again. 

Reason: Server error java.lang.NoClassDefFoundError : antlr/ANTLRException null 

now the antlr jar is on the classpath and in the lib folder on the server so i cant see how this is the problem . Does any one have any information on why this error might be occurring. this is the console output also f that helps. I have another class that was created called foo that uses the same hibernate template to save a bar object to the database and this works perfectly. Just when trying to perform actions on the user database.

BlazeDS]FlexSession created with id '0F8814A114349B363B928EDAF0694597' for an Http-based client connection.
[BlazeDS]Deserializing AMF/HTTP request
Version: 3
  (Message #0 targetURI=, responseURI=/0)
    (Array #0)
      [0] = (Typed Object #1 'flex.messaging.messages.RemotingMessage')
        timestamp = 0.0
        headers = (Array #2)
        operation = "findByFname"
        body = (Array #3)
          [0] = "Chris"
        source = null
        remotePassword = null
        remoteUsername = null
        parameters = (Array #4)
          [0] = "Chris"
        messageId = "3E55B425-C80A-FC8F-DE71-1781509D62F8"
        timeToLive = 0.0
        clientId = null
        destination = "userServiceImpl"

2011-01-16 21:27:36 DEBUG [http-8080-2] (SessionImpl.java:247) - opened session at timestamp: 12952132559
[BlazeDS]Serializing AMF/HTTP response
Version: 3
  (Header #0 name=AppendToGatewayUrl, mustUnderstand=true)
    ";jsessionid=0F8814A114349B363B928EDAF0694597"

  (Message #0 targetURI=/0/onStatus, responseURI=)
    (Typed Object #0 'flex.messaging.messages.ErrorMessage')
      headers = (Object #1)
      rootCause = (Typed Object #2 'java.lang.NoClassDefFoundError')
        message = "antlr/ANTLRException"
        localizedMessage = "antlr/ANTLRException"
        cause = (Typed Object #3 'java.lang.ClassNotFoundException')
          message = "antlr.ANTLRException"
          localizedMessage = "antlr.ANTLRException"
          cause = null
          exception = null
      body = null
      correlationId = "3E55B425-C80A-FC8F-DE71-1781509D62F8"
      faultDetail = null
      faultString = "java.lang.NoClassDefFoundError : antlr/ANTLRException"
      clientId = "3E55BD3A-0009-92C7-EA7F-7636A529BFBF"
      timeToLive = 0.0
      destination = "userServiceImpl"
      timestamp = 1.295213256298E12
      extendedData = null
      faultCode = "Server.Processing"
      messageId = "3E55C800-CA0B-BE98-FA79-64DC86BD18B1"

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

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

发布评论

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

评论(1

心房敞 2024-10-19 17:38:31

事实证明,这是新 ANTLR jar 的问题,如果您遇到此问题,请清理您的类路径并导入 antlr.2.7.6 并查看是否可以解决它。为我工作

Turns out this is a problem with the new ANTLR jar if you have this problem clean out ur classpath and import the antlr.2.7.6 and see if this solves it . Worked for me

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