Hi
I’m trying to evaluate the charts add-on in a simple prototype application using the Maven application archetype within IntelliJ IDEA 13 and have run into a problem trying to run the install goal. Although following the steps in the Book of Vaadin and building the widget set using the maven goal appears to be successful, attempts to compile and deploy fail with an annoyingly cryptic GWT internal error that doesn’t give me enough information to track the bug down. I’m sure I have done something wrong but despite cleaning and then rebuilding the project from scratch I can’t seem to escape from the error. If anyone is able to help I’d be very grateful!
Console output (install goal):
Information:Compilation completed with 20 errors and 0 warnings in 9 sec
Information:20 errors
Information:0 warnings
Error:GWT Compiler: Unexpected internal compiler error
Error:GWT Compiler: at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:464)
Error:GWT Compiler: at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:423)
Error:GWT Compiler: at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:373)
Error:GWT Compiler: at com.google.gwt.dev.Precompile.precompile(Precompile.java:246)
Error:GWT Compiler: at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
Error:GWT Compiler: at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)
Error:GWT Compiler: at com.google.gwt.dev.Compiler.run(Compiler.java:232)
Error:GWT Compiler: at com.google.gwt.dev.Compiler.run(Compiler.java:198)
Error:GWT Compiler: at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
Error:GWT Compiler: at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
Error:GWT Compiler: at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
Error:GWT Compiler: at com.google.gwt.dev.Compiler.main(Compiler.java:177)
Error:GWT Compiler: at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
Error:GWT Compiler: at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
Error:GWT Compiler: at java.security.AccessController.doPrivileged(Native Method)
Error:GWT Compiler: at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
Error:GWT Compiler: at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
Error:GWT Compiler: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Error:GWT Compiler: at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
POM file:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>uk.co.ravingmonkey</groupId>
<artifactId>mcp</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>Vaadin Web Application</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.1.10</vaadin.version>
<vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
</properties>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>vaadin-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-server</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiled</artifactId>
<version>${vaadin.version}</version>
</dependency>
<!--
Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory).
For widgetset compilation, vaadin-client-compiler is automatically added on the
compilation classpath by vaadin-maven-plugin so normally there is no need for an
explicit dependency.
-->
<!--
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
-->
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<version>${vaadin.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-push</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-themes</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin.addon</groupId>
<artifactId>vaadin-charts</artifactId>
<version>1.1.4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.0.2.Final</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
<!-- directory is cleaned properly -->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/VAADIN/widgetsets</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<!-- <runTarget>mobilemail</runTarget> -->
<!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
way compatible with Vaadin eclipse plugin. -->
<webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
</webappDirectory>
<hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
</hostedWebapp>
<noServer>true</noServer>
<!-- Remove draftCompile when project is ready -->
<draftCompile>false</draftCompile>
<compileReport>true</compileReport>
<style>OBF</style>
<strict>true</strict>
<runTarget>http://localhost:8080/</runTarget>
</configuration>
<executions>
<execution>
<configuration>
<!-- if you don't specify any modules, the plugin will find them -->
<!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module>
</modules> -->
</configuration>
<goals>
<goal>clean</goal>
<goal>resources</goal>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile-theme</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>com.vaadin</groupId>
<artifactId>
vaadin-maven-plugin
</artifactId>
<versionRange>
[7.1.10,)
</versionRange>
<goals>
<goal>resources</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<goal>update-theme</goal>
<goal>compile-theme</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Finally, the chart class I’m trying to instantiate:
public class EventsPerMonthChart extends Chart {
public EventsPerMonthChart() {
super(ChartType.PIE);
setCaption("Events per month");
getConfiguration().setTitle("");
getConfiguration().getChart().setType(ChartType.PIE);
setWidth("100%");
setHeight("90%");
DataSeries series = new DataSeries();
ArrayList<Evnt> events = (ArrayList)MockDataProvider.getEvntCollection();
Calendar cal = Calendar.getInstance();
HashMap<String, Integer> eventsPerMonth = new HashMap<String, Integer>();
Long id = 1L;
String month;
for (Evnt e: events) {
cal.setTime(e.getStartDateTime());
month = cal.getDisplayName(Calendar.MONTH, Calendar.LONG, Locale.ENGLISH);
// TODO bugged!
if (eventsPerMonth.get(month) != null) {
eventsPerMonth.put(month, eventsPerMonth.get(month) + 1);
} else
{
eventsPerMonth.put(month, 1);
}
}
Set<String> monthsOfYear = eventsPerMonth.keySet();
for (String m: monthsOfYear) {
series.add(new DataSeriesItem(m, eventsPerMonth.get(m)));
}
getConfiguration().setSeries(series);
}
}