Error during compile
Closed this issue · 4 comments
I tried to recompile the default widgetset with the addon at the command line using Vaadin 7.6.6 and Oracle Java 1.8.0_92 in Ubuntu (15.04) and I failed. "-" in javascript function names are not allowed, are they? Can you help?
In the current directory I put all vaadin jars (without vaadin-widgets-7.6.6.jar) with its dependencies, the addon and in the subdirectory widgetset is the unpacked default vaadin-widgets-7.6.6.jar
Command line and output:
java -cp "*:widgetset" com.vaadin.tools.WidgetsetCompiler vaadin-componentrenderer
...
Compiling 1 permutation
Compiling permutation 0...
Compile of permutations succeeded
Compilation succeeded -- 32,973s
Linking into /home/franz/test/compiling/war/vaadin-componentrenderer
Invoking Linker Cross-Site-Iframe
Attempting to optimize JS
[ERROR] Unable to parse JavaScript
com.google.gwt.dev.js.JsParserException: StandardLinkerContext.optimizeJavaScript(17): missing ( before function parameters
function vaadin-componentrenderer() {
----------------^
at com.google.gwt.dev.js.JsParser$1.error(JsParser.java:111)
at com.google.gwt.dev.js.rhino.Context.reportError(Context.java:459)
at com.google.gwt.dev.js.rhino.TokenStream.reportSyntaxError(TokenStream.java:1594)
at com.google.gwt.dev.js.rhino.Parser.reportError(Parser.java:72)
at com.google.gwt.dev.js.rhino.Parser.mustMatchToken(Parser.java:64)
at com.google.gwt.dev.js.rhino.Parser.function(Parser.java:189)
at com.google.gwt.dev.js.rhino.Parser.parse(Parser.java:116)
at com.google.gwt.dev.js.JsParser.parseImpl(JsParser.java:134)
at com.google.gwt.dev.js.JsParser.parse(JsParser.java:89)
at com.google.gwt.dev.js.JsParser.parseInto(JsParser.java:94)
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.optimizeJavaScript(StandardLinkerContext.java:441)
at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.generateSelectionScript(SelectionScriptLinker.java:422)
at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.generateSelectionScript(SelectionScriptLinker.java:411)
at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.emitSelectionScript(SelectionScriptLinker.java:299)
at com.google.gwt.core.ext.linker.impl.SelectionScriptLinker.link(SelectionScriptLinker.java:212)
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.invokeFinalLink(StandardLinkerContext.java:336)
at com.google.gwt.dev.Link.doSimulatedShardingLink(Link.java:465)
at com.google.gwt.dev.Link.link(Link.java:182)
at com.google.gwt.dev.Compiler.run(Compiler.java:246)
at com.google.gwt.dev.Compiler.run(Compiler.java:158)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:127)
at com.vaadin.tools.WidgetsetCompiler$1.run(WidgetsetCompiler.java:80)
at java.lang.Thread.run(Thread.java:745)
Not sure in which context you came to that commandline, but I suggest compiling the widgetset using the vaadin maven plugin. Putting all the right options for the widgetset compile by hand is an errorprone and unnecessary effort (unless you have very good reasons to do so). If you desperatly need the "pure" commandline call, I suggest running the widgetset compile by maven with the "-X" option. It outputs the commandline during the build and you can copy&paste it and start from that. The vaadin Eclipse-plugin also should have some widgetset compile button, but honestly I never used it.
If you checkout the demo-project from github and compile it with maven you should have a working example.
See the readme for compilation instructions.
Just for completeness, here is the widgetsetcompiler commandline copied out of the maven compile:
mvn clean install -X
/bin/sh -c /home/example/programs/jdk1.8.0_40/jre/bin/java -Xmx512M -Xss1024k -classpath /home/example/privat/projekte/vaadin/widgets/componentrenderer-release/componentrenderer-demo/src/main/java:/home/example/privat/projekte/vaadin/widgets/componentrenderer-release/componentrenderer-demo/src/main/resources:/home/example/privat/projekte/vaadin/widgets/componentrenderer-release/componentrenderer-demo/target/classes:/home/example/privat/projekte/vaadin/widgets/componentrenderer-release/componentrenderer-demo/src/main/java:/home/example/privat/projekte/vaadin/widgets/componentrenderer-release/componentrenderer-demo/src/main/resources:/home/example/.m2/repository/de/datenhahn/vaadin/componentrenderer/1.0.0/componentrenderer-1.0.0.jar:/home/example/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar:/home/example/.m2/repository/org/vaadin/viritin/1.44/viritin-1.44.jar:/home/example/.m2/repository/org/vaadin/addon/confirmdialog/2.1.3/confirmdialog-2.1.3.jar:/home/example/.m2/repository/org/commonjava/googlecode/markdown4j/markdown4j/2.2-cj-1.0/markdown4j-2.2-cj-1.0.jar:/home/example/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar:/home/example/.m2/repository/commons-beanutils/commons-beanutils/1.9.2/commons-beanutils-1.9.2.jar:/home/example/.m2/repository/javax/el/javax.el-api/2.2.4/javax.el-api-2.2.4.jar:/home/example/.m2/repository/javax/servlet/javax.servlet-api/3.0.1/javax.servlet-api-3.0.1.jar:/home/example/.m2/repository/com/vaadin/vaadin-server/7.6.2/vaadin-server-7.6.2.jar:/home/example/.m2/repository/com/vaadin/vaadin-sass-compiler/0.9.13/vaadin-sass-compiler-0.9.13.jar:/home/example/.m2/repository/com/vaadin/external/flute/flute/1.3.0.gg2/flute-1.3.0.gg2.jar:/home/example/.m2/repository/com/yahoo/platform/yui/yuicompressor/2.4.8/yuicompressor-2.4.8.jar:/home/example/.m2/repository/rhino/js/1.7R2/js-1.7R2.jar:/home/example/.m2/repository/com/vaadin/vaadin-shared/7.6.2/vaadin-shared-7.6.2.jar:/home/example/.m2/repository/com/vaadin/external/streamhtmlparser/streamhtmlparser-jsilver/0.0.10.vaadin1/streamhtmlparser-jsilver-0.0.10.vaadin1.jar:/home/example/.m2/repository/com/vaadin/external/google/guava/16.0.1.vaadin1/guava-16.0.1.vaadin1.jar:/home/example/.m2/repository/org/jsoup/jsoup/1.8.3/jsoup-1.8.3.jar:/home/example/.m2/repository/com/vaadin/vaadin-client/7.6.2/vaadin-client-7.6.2.jar:/home/example/.m2/repository/org/w3c/css/sac/1.3/sac-1.3.jar:/home/example/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA.jar:/home/example/.m2/repository/javax/validation/validation-api/1.0.0.GA/validation-api-1.0.0.GA-sources.jar:/home/example/.m2/repository/org/fluttercode/datafactory/datafactory/0.8/datafactory-0.8.jar:/home/example/.m2/repository/com/vaadin/vaadin-client-compiler/7.6.2/vaadin-client-compiler-7.6.2.jar:/home/example/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar:/home/example/.m2/repository/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/home/example/.m2/repository/ant/ant/1.6.5/ant-1.6.5.jar:/home/example/.m2/repository/net/sourceforge/cssparser/cssparser/0.9.11/cssparser-0.9.11.jar:/home/example/.m2/repository/ant/ant-launcher/1.6.5/ant-launcher-1.6.5.jar:/home/example/.m2/repository/org/ow2/asm/asm/5.0.3/asm-5.0.3.jar:/home/example/.m2/repository/org/ow2/asm/asm-util/5.0.3/asm-util-5.0.3.jar:/home/example/.m2/repository/org/ow2/asm/asm-tree/5.0.3/asm-tree-5.0.3.jar:/home/example/.m2/repository/org/ow2/asm/asm-commons/5.0.3/asm-commons-5.0.3.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-annotations/8.1.12.v20130726/jetty-annotations-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-plus/8.1.12.v20130726/jetty-plus-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/orbit/javax.transaction/1.1.1.v201105210645/javax.transaction-1.1.1.v201105210645.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-jndi/8.1.12.v20130726/jetty-jndi-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-server/8.1.12.v20130726/jetty-server-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar:/home/example/.m2/repository/org/eclipse/jetty/orbit/javax.mail.glassfish/1.4.1.v201005082020/javax.mail.glassfish-1.4.1.v201005082020.jar:/home/example/.m2/repository/org/eclipse/jetty/orbit/javax.activation/1.1.0.v201105071233/javax.activation-1.1.0.v201105071233.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-webapp/8.1.12.v20130726/jetty-webapp-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-xml/8.1.12.v20130726/jetty-xml-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-servlet/8.1.12.v20130726/jetty-servlet-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-security/8.1.12.v20130726/jetty-security-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/orbit/javax.annotation/1.1.0.v201108011116/javax.annotation-1.1.0.v201108011116.jar:/home/example/.m2/repository/org/eclipse/jetty/orbit/org.objectweb.asm/3.1.0.v200803061910/org.objectweb.asm-3.1.0.v200803061910.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-servlets/8.1.12.v20130726/jetty-servlets-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-continuation/8.1.12.v20130726/jetty-continuation-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-client/8.1.12.v20130726/jetty-client-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-http/8.1.12.v20130726/jetty-http-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-io/8.1.12.v20130726/jetty-io-8.1.12.v20130726.jar:/home/example/.m2/repository/org/eclipse/jetty/jetty-util/8.1.12.v20130726/jetty-util-8.1.12.v20130726.jar:/home/example/.m2/repository/org/jdesktop/swing-worker/1.1/swing-worker-1.1.jar:/home/example/.m2/repository/commons-codec/commons-codec/1.8/commons-codec-1.8.jar:/home/example/.m2/repository/org/apache/james/apache-mime4j/0.6/apache-mime4j-0.6.jar:/home/example/.m2/repository/org/apache/httpcomponents/httpclient/4.3.1/httpclient-4.3.1.jar:/home/example/.m2/repository/org/apache/httpcomponents/httpcore/4.3/httpcore-4.3.jar:/home/example/.m2/repository/org/apache/httpcomponents/httpmime/4.3.1/httpmime-4.3.1.jar:/home/example/.m2/repository/net/sourceforge/nekohtml/nekohtml/1.9.19/nekohtml-1.9.19.jar:/home/example/.m2/repository/xalan/serializer/2.7.1/serializer-2.7.1.jar:/home/example/.m2/repository/xerces/xercesImpl/2.11.0/xercesImpl-2.11.0.jar:/home/example/.m2/repository/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar:/home/example/.m2/repository/com/ibm/icu/icu4j/50.1.1/icu4j-50.1.1.jar:/home/example/.m2/repository/com/vaadin/vaadin-client-compiler-deps/1.2.0/vaadin-client-compiler-deps-1.2.0.jar:/home/example/.m2/repository/com/vaadin/vaadin-themes/7.6.2/vaadin-themes-7.6.2.jar:/home/example/.m2/repository/com/vaadin/vaadin-client/7.6.2/vaadin-client-7.6.2.jar:/home/example/.m2/repository/com/vaadin/vaadin-client-compiler/7.6.2/vaadin-client-compiler-7.6.2.jar com.vaadin.server.widgetsetutils.WidgetSetBuilder de.datenhahn.vaadin.componentrenderer.demo.DemoWidgetSet
Maven is no option because I'm in an offline environment. Any ideas?
without maven you will have lots of problems getting all the dependencies I fear. Instead of downloading all dependencies by hand and doing all the compile, etc. stuff by hand I would suggest you build your software on an online server and only deploy the war file to the offline server. if the requirement is to build it on the offline server, just do a maven build on the online server and then copy the local maven registry to the offline server. You can run maven with the -o option on the offline server so it does not try to connect to the internet (for newer packages etc.) it will still fail though if it does not find the packets in the local registry. For corporate build setups think about an own maven repository like nexus or artifactory where you either mirror maven central, or only copy certain maven central libraries allowed by your corporation into your own repo.
If you really want to do everything by hand, you can still try with the commandline from the maven build I posted you. You will have to tweak it to your needs, but how the basic install works should be clear.
Also you might try if the Eclipse-Plugin works for your use case.
Can you tell me more about your use case? For now I would assume you have a corporate server without access to the internet.
Well, as far as I tried vaadin in general seems to be useable offline. All tutorials and documentation can't be applied (due to maven) but it works. In the meantime I tried to compile your addon again and compiling worked (- I didn't try the result). The new commandline looks like this:
java -Xms256M -Xmx512M -Xss8M -cp "*:widgetset" com.google.gwt.dev.Compiler -war WebContent/VAADIN/widgetsets com.vaadin.DefaultWidgetSet componentrenderer
The mistake was a wrong component name. It must be "componentrenderer" instead of "vaddin-componentrenderer" Maybe it's useful for someone else.
BTW: I tried the vaadin plugin but without internet connection I was not able to use 7.6.6. No idea how to update the vaadin version there manually.