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

MarkupBuilder: no such field "owner" error while generating HTML

    XMLWordPrintableJSON

Details

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

    Description

      This works in the Groovy Shell:

      import groovy.xml.MarkupBuilder
      doc = new MarkupBuilder()
      doc.html() {
      head()

      { title("Groovy") }


      }

      But this fails:

      import groovy.xml.MarkupBuilder

      class HtmlMarkupSandbox
      {
      static void main(args)
      {
      doc = new MarkupBuilder()
      doc.html() {
      head()

      { title("Groovy") }

      }
      }
      }

      With the following error:

      java.lang.NoSuchFieldError: owner
      at
      org.codehaus.groovy.tools.HtmlMarkupSandbox$1.doCall(HtmlMarkupSandbox.groov
      y)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
      )
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
      .java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:758)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:214)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:188)
      at groovy.lang.Closure.invokeMethod(Closure.java:69)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:114)
      at
      org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:92
      )
      at groovy.lang.Closure.call(Closure.java:145)
      at groovy.lang.Closure.call(Closure.java:134)
      at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:129)
      at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:85)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:114)
      at
      org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:92
      )
      at
      org.codehaus.groovy.tools.HtmlMarkupSandbox.main(HtmlMarkupSandbox.groovy:9)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
      )
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
      .java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:758)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:273)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:121)
      at
      org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:92
      )
      at groovy.lang.GroovyShell.run(GroovyShell.java:171)
      at groovy.lang.GroovyShell.main(GroovyShell.java:85)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
      )
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
      .java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Activity

          People

            Unassigned Unassigned
            guillaume Guillaume Sauthier
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: