Grails
  1. Grails
  2. GRAILS-8272

java.lang.NoClassDefFoundError on compiling new app

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0-RC1, 2.0-RC3
    • Fix Version/s: 2.0-RC2
    • Labels:
      None
    • Environment:
      Windows 7, jdk 1.6.0_27, grails 2.0.0.BUILD-SNAPSHOT, build 1554

      Description

      When trying to compile newly created app, grails throws java.lang.NoClassDefFoundError. If I try compiling second time, compilation passes without error.

      Steps to reproduce:

      grails create-app sometotallynewapp
      cd sometotallynewapp
      grails compile

      Last statement produces:

      | Error Fatal error during compilation java.lang.NoClassDefFoundError: org/hibernate/proxy/HibernateProxy (Use --stacktrace to see the full trace)

      Trying to compile second time, compilation passes.

      To get the error again, one must delete ~/.grails/2.0.0.BUILD-SNAPSHOT/projects/sometotallynewapp. After that, above steps will produce the same error again.

        Activity

        Show
        Graeme Rocher added a comment - This is already fixed by https://github.com/grails/grails-core/commit/9ac1e3f6b8b8d6b615c7bf9d51a31ccad8167722
        Hide
        Lari Hotari added a comment -

        I can reproduce this problem in latest 2.0.x snapshot by adding "compile ':functional-test:1.2.7'" to plugins in BuildConfig.groovy.

        It gives this error:

        | Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: Lcom/gargoylesoftware/htmlunit/html/HTMLParser$HtmlUnitDOMBuilder; (Use --stacktrace to see the full trace)
        
        Show
        Lari Hotari added a comment - I can reproduce this problem in latest 2.0.x snapshot by adding "compile ':functional-test:1.2.7'" to plugins in BuildConfig.groovy. It gives this error: | Error Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: Lcom/gargoylesoftware/htmlunit/html/HTMLParser$HtmlUnitDOMBuilder; (Use --stacktrace to see the full trace)
        Hide
        Graeme Rocher added a comment -

        Lari - that is a different error and happens with 1.3.x and the functional test plugin

        Show
        Graeme Rocher added a comment - Lari - that is a different error and happens with 1.3.x and the functional test plugin
        Hide
        Lari Hotari added a comment -

        Problem exists in 2.0-RC3. Maybe another case (jar files in lib-directory of a plugin?).

        Show
        Lari Hotari added a comment - Problem exists in 2.0-RC3. Maybe another case (jar files in lib-directory of a plugin?).
        Hide
        Lari Hotari added a comment - - edited

        Sorry, I didn't notice your comment. I reopened this one before reading it. This problem is hitting me when I'm running grails-functional-tests against latest snapshot build of 2.0.x.

        Show
        Lari Hotari added a comment - - edited Sorry, I didn't notice your comment. I reopened this one before reading it. This problem is hitting me when I'm running grails-functional-tests against latest snapshot build of 2.0.x.
        Hide
        Raviteja added a comment -

        is it because Hibernate is not set as a compile time dependency just like in GPQUARTZ-97

        Show
        Raviteja added a comment - is it because Hibernate is not set as a compile time dependency just like in GPQUARTZ-97
        Hide
        Jeff Scott Brown added a comment -

        Ravi,

        No, I don't think configuring Hibernate as compile time dependency is relevant here.

        I am pretty sure that this issue was resolved before we released 2.0. The problem with HTMLParser$HtmlUnitDOMBuilder still exists the first time you build a project under certain circumstances but that is not a new thing and is largely unrelated to the original issue here related to org.hibernate.proxy.HibernateProxy.

        Show
        Jeff Scott Brown added a comment - Ravi, No, I don't think configuring Hibernate as compile time dependency is relevant here. I am pretty sure that this issue was resolved before we released 2.0. The problem with HTMLParser$HtmlUnitDOMBuilder still exists the first time you build a project under certain circumstances but that is not a new thing and is largely unrelated to the original issue here related to org.hibernate.proxy.HibernateProxy.

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Damir Murat
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development