我正在使用Vaadin 6.8.2和Maven来开发一个应用程序.
我试图通过以下链接逐步完成教程,将Calendar附加组件(1.3.0 - Vaadin 6的版本)添加到我的项目中:https://vaadin.com/book/vaadin6/-/页/ 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.
你有类似的问题吗?有什么帮助吗?:)
您需要编译您的widgetset.要启用它,您需要在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章中描述的内容类似的内容.编译widgetset需要一些时间,因此不会被忽视.
您还需要一个ProjectWidgetSet.gwt.xml以及它在web.xml中的引用,但由于您收到的错误消息已经提到ProjectWidgetSet(而不是DefaultWidgetset),我猜您已经这样做了.
我有同样的问题'无法加载widgetset:'当我尝试通过从svn获取运行Vernotologist演示应用程序时,它出现了.要解决这个问题:
转到你的gwt.xml文件,确保在eclipse中的项目资源管理器中选中它
确保安装了eclipse插件中的Vaadin
在Eclipse工具栏中找到Compile Widgetset按钮,它是vaadin插件的一部分,看起来就像一个装备.点击它
第3步将为您编译小部件集
重新启动服务器并重新运行您的应用程序
资料来源:16.2.2.在这个链接上编译来自Vaadin的Widget Set:https://vaadin.com/book/-/page/gwt.eclipse.html