"build-widgetset.xml" failed

Hello,

I ran
build-widgetset.xml
(vaadin-6.4.6) to create
colorpicker.jar
with Eclipse, and found it couldn’t pass. Please let me know what modification I should do.

My test steps were as the following:

  1. Ant build-widgetset.xml (Eclipse environment)
Buildfile: C:\vaadin-6.4.6\WebContent\docs\example-source\build-widgetset.xml
configure:
init:
     [echo]
 Requirements for classpath:
     [echo]
   ../../../gwt/gwt-dev.jar
     [echo]
   ../../../gwt/gwt-user.jar
     [echo]
   ../../../WebContent/WEB-INF/lib/vaadin-6.4.6.jar
     [echo]
   ../../../WebContent/WEB-INF/src
     [echo]
 Output will be written into ../../../WebContent/VAADIN/widgetsets
compile-server-side:
configure-widgetset:
     [echo]
 Modify this example Ant script to compile your own widget sets.
generate-widgetset:
compile-widgetset:
     [echo]
 Compiling com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet...
     [java]
 Compiling module com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet
     [java]
    Scanning for additional dependencies: jar:file:/C:/vaadin-6.4.6/WebContent/WEB-INF/lib/vaadin-6.4.6.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java
     [java]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
     [java]
          Rebinding com.vaadin.terminal.gwt.client.WidgetMap
     [java]
             Invoking com.google.gwt.dev.javac.StandardGeneratorContext@accc4e9
     [java]
                Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
     [java]
 [ERROR]
 Unexpected
     [java]
 java.lang.OutOfMemoryError: PermGen space
     [java]
 	at org.eclipse.jdt.internal.compiler.CompilationResult.record(CompilationResult.java:346)
     [java]
 	at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:571)
     [java]
 	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:498)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:123)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:234)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$200(AbstractCompiler.java:109)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:522)
     [java]
 	at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:112)
     [java]
 	at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:47)
     [java]
 	at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:430)
     [java]
 	at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:32)
     [java]
 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
     [java]
 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
     [java]
 	at com.google.gwt.dev.Compiler.run(Compiler.java:201)
     [java]
 	at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
     [java]
 	at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
     [java]
 	at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
     [java]
 	at com.google.gwt.dev.Compiler.main(Compiler.java:159)
     [java]
    [ERROR]
 Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)

BUILD FAILED
C:\vaadin-6.4.6\WebContent\docs\example-source\build-widgetset.xml:159: Java returned: 1

Total time: 46 seconds
  1. Increased memory defined in build-widgetset.xml:
        <java classname="com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder"
              failonerror="yes" fork="yes" maxmemory="[s]
256m
[/s]1024m"> 
            <arg value="${widgetset}"/>
            <jvmarg value="-Xss1024k"/>
            <jvmarg value="-Djava.awt.headless=true"/>
            <classpath>
                <path refid="compile.classpath"/>
            </classpath>
        </java> 
  1. The log information was changed:
Buildfile: C:\vaadin-6.4.6\WebContent\docs\example-source\build-widgetset.xml
configure:
init:
     [echo]
 Requirements for classpath:
     [echo]
   ../../../gwt/gwt-dev.jar
     [echo]
   ../../../gwt/gwt-user.jar
     [echo]
   ../../../WebContent/WEB-INF/lib/vaadin-6.4.6.jar
     [echo]
   ../../../WebContent/WEB-INF/src
     [echo]
 Output will be written into ../../../WebContent/VAADIN/widgetsets
compile-server-side:
configure-widgetset:
     [echo]
 Modify this example Ant script to compile your own widget sets.
generate-widgetset:
compile-widgetset:
     [echo]
 Compiling com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet...
     [java]
 Compiling module com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet
     [java]
    Scanning for additional dependencies: jar:file:/C:/vaadin-6.4.6/WebContent/WEB-INF/lib/vaadin-6.4.6.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java
     [java]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
     [java]
          Rebinding com.vaadin.terminal.gwt.client.WidgetMap
     [java]
             Invoking com.google.gwt.dev.javac.StandardGeneratorContext@7681720a
     [java]
                Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
     [java]
 [ERROR]
 Unexpected
     [java]
 java.lang.OutOfMemoryError: PermGen space

BUILD FAILED
C:\vaadin-6.4.6\WebContent\docs\example-source\build-widgetset.xml:159: Java returned: 1

Total time: 59 seconds

You might need to increase the max PermGen size, which is different from the heap size. Try adding

The build was failed again with following setting on a 2G-memory computer:

      <java classname="com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder"
              failonerror="yes" fork="yes" maxmemory="1024m">
            <arg value="${widgetset}"/>
            <jvmarg value="-Xss1024k"/>
            <jvmarg value="-Djava.awt.headless=true"/>
        	<jvmarg value="-Xmx1024m"/>
        	<jvmarg value="-XX: PermSize=1024m"/>
        	<jvmarg value="-XX:MaxPermSize=1024m"/> 
            <classpath>
                <path refid="compile.classpath"/>
            </classpath>
        </java>

Log:

Buildfile: C:\vaadin-6.4.6\WebContent\docs\example-source\build-widgetset.xml
configure:
init:
     [echo]
 Requirements for classpath:
     [echo]
   ../../../gwt/gwt-dev.jar
     [echo]
   ../../../gwt/gwt-user.jar
     [echo]
   ../../../WebContent/WEB-INF/lib/vaadin-6.4.6.jar
     [echo]
   ../../../WebContent/WEB-INF/src
     [echo]
 Output will be written into ../../../WebContent/VAADIN/widgetsets
compile-server-side:
configure-widgetset:
     [echo]
 Modify this example Ant script to compile your own widget sets.
generate-widgetset:
compile-widgetset:
     [echo]
 Compiling com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet...
     [java]
 Compiling module com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet
     [java]
    Scanning for additional dependencies: jar:file:/C:/vaadin-6.4.6/WebContent/WEB-INF/lib/vaadin-6.4.6.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java
     [java]
       Computing all possible rebind results for 'com.vaadin.terminal.gwt.client.WidgetMap'
     [java]
          Rebinding com.vaadin.terminal.gwt.client.WidgetMap
     [java]
             Invoking com.google.gwt.dev.javac.StandardGeneratorContext@b09851a
     [java]
                Detecting Vaadin components in classpath to generate WidgetMapImpl.java ...
     [java]
    [ERROR]
 Errors in 'jar:file:/C:/vaadin-6.4.6/WebContent/WEB-INF/lib/vaadin-6.4.6.jar!/com/vaadin/terminal/gwt/client/WidgetSet.java'
     [java]
       [ERROR]
  Internal compiler error
     [java]
 java.lang.OutOfMemoryError: PermGen space
     [java]
 	at java.lang.ClassLoader.defineClass1(Native Method)
     [java]
 	at java.lang.ClassLoader.defineClassCond(Unknown Source)
     [java]
 	at java.lang.ClassLoader.defineClass(Unknown Source)
     [java]
 	at java.security.SecureClassLoader.defineClass(Unknown Source)
     [java]
 	at java.net.URLClassLoader.defineClass(Unknown Source)
     [java]
 	at java.net.URLClassLoader.access$000(Unknown Source)
     [java]
 	at java.net.URLClassLoader$1.run(Unknown Source)
     [java]
 	at java.security.AccessController.doPrivileged(Native Method)
     [java]
 	at java.net.URLClassLoader.findClass(Unknown Source)
     [java]
 	at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]
 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]
 	at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]
 	at java.lang.Class.forName0(Native Method)
     [java]
 	at java.lang.Class.forName(Unknown Source)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer.tryToAdd(ClassPathExplorer.java:544)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer.searchForPaintables(ClassPathExplorer.java:496)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer.getPaintablesHavingWidgetAnnotation(ClassPathExplorer.java:120)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator.getUsedPaintables(WidgetMapGenerator.java:208)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator.generateClass(WidgetMapGenerator.java:136)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator.generate(WidgetMapGenerator.java:97)
     [java]
 	at com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:418)
     [java]
 	at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:38)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:108)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:54)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:143)
     [java]
 	at com.google.gwt.dev.Precompile$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(Precompile.java:317)
     [java]
 	at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:95)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:200)
     [java]
 	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:123)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:234)
     [java]
 [ERROR]
 Unexpected
     [java]
 java.lang.OutOfMemoryError: PermGen space
     [java]
 	at java.lang.ClassLoader.defineClass1(Native Method)
     [java]
 	at java.lang.ClassLoader.defineClassCond(Unknown Source)
     [java]
 	at java.lang.ClassLoader.defineClass(Unknown Source)
     [java]
 	at java.security.SecureClassLoader.defineClass(Unknown Source)
     [java]
 	at java.net.URLClassLoader.defineClass(Unknown Source)
     [java]
 	at java.net.URLClassLoader.access$000(Unknown Source)
     [java]
 	at java.net.URLClassLoader$1.run(Unknown Source)
     [java]
 	at java.security.AccessController.doPrivileged(Native Method)
     [java]
 	at java.net.URLClassLoader.findClass(Unknown Source)
     [java]
 	at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]
 	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]
 	at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]
 	at java.lang.Class.forName0(Native Method)
     [java]
 	at java.lang.Class.forName(Unknown Source)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer.tryToAdd(ClassPathExplorer.java:544)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer.searchForPaintables(ClassPathExplorer.java:496)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer.getPaintablesHavingWidgetAnnotation(ClassPathExplorer.java:120)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator.getUsedPaintables(WidgetMapGenerator.java:208)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator.generateClass(WidgetMapGenerator.java:136)
     [java]
 	at com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator.generate(WidgetMapGenerator.java:97)
     [java]
 	at com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGeneratorContext.java:418)
     [java]
 	at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:38)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.tryRebind(StandardRebindOracle.java:108)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:54)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:154)
     [java]
 	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:143)
     [java]
 	at com.google.gwt.dev.Precompile$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(Precompile.java:317)
     [java]
 	at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:95)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:200)
     [java]
 	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:123)
     [java]
 	at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:234)
     [java]
    [ERROR]
 Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)

BUILD FAILED
C:\vaadin-6.4.6\WebContent\docs\example-source\build-widgetset.xml:162: Java returned: 1

Total time: 42 seconds

The build process can be passed now. There are two places should be modified, and I only modified one. Thank you, Artur!