我正在使用Vaadin 6.8.2和Maven开发应用程序。
我已尝试通过以下链接中的逐步教程将日历附加组件(1.3.0-Vaadin 6的版本)添加到我的项目中:https://vaadin.com/book/vaadin6/-/page/addons.maven.html
但是,当我尝试在浏览器中加载应用程序时,出现以下错误:
Failed to load the widgetset: /myproject/VAADIN/widgetsets/my.company.ProjectWidgetSet/my.company.ProjectWidgetSet.nocache.js
如果在控制台中查看,则会看到以下内容:
INFO: Requested resource [VAADIN/widgetsets/my.company.ProjectWidgetSet/my.company.ProjectWidgetSet.nocache.js] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
您是否遇到过类似的问题?
有什么帮助吗? :)
最佳答案
您需要编译您的小部件集。要启用它,您需要在pom中添加以下内容:
<!-- vaadin update widgetset step 1: need (re)build? -->
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>1.0.2</version>
<executions>
<execution>
<goals>
<goal>update-widgetset</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- vaadin update widgetset part 2: compile -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.3.0-1</version>
<configuration>
<webappDirectory>src/main/webapp/VAADIN/widgetsets</webappDirectory>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<runTarget>clean</runTarget>
<hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
<noServer>true</noServer>
<port>8080</port>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
就绪后,重新编译您的应用程序。在所提供的链接之后,您应该会看到类似于第15.5.3章中所述的内容。编译窗口小部件集需要花费一些时间,因此它不会被忽略。
您还需要一个ProjectWidgetSet.gwt.xml并在web.xml中对其进行引用,但是由于您所收到的错误消息已经提到了ProjectWidgetSet(与DefaultWidgetset相对),我想您已经做到了。
关于maven - Vaadin:无法加载widgetset.nocache.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21066550/