Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1042

NoClassDefFoundError in Spring when calling static methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-3
    • 1.0-JSR-4
    • None
    • None

    Description

      Hi,

      In Grails we are currently experiencing a problem with calling Groovy objects that are configured in the Spring application context. The Groovy classes are compiled at runtime with GroovyClassLoader.

      The objects can be looked up from the application context and its methods can be called. However, when one of these methods calls a static method on another Groovy class NoClassDefFoundError is thrown with the other Groovy class as message.

      package test

      public class OrderService {
      def findAllOrders()

      { return Orders.findAll() }

      }

      I found a workaround by providing the full name of the call although they both reside in the same package:

      package test

      public class OrderService {
      def findAllOrders()

      { return test.Orders.findAll() }

      }

      This problem is not experienced when we run the same classes wth the groovy command. However, I think this problem is internal to Groovy.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            devijvers Steven Devijver
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: