Vaadin:加载失败widgetset.nocache.js

问题描述 投票:15回答:4

我使用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.

你在类似的问题上运行?任何帮助,请? :)

maven gwt vaadin add-on
4个回答
14
投票

您需要编译视窗元件。要启用它,你需要在你的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),我猜你已经做到了。


9
投票

我有同样的问题“无法加载视窗元件:”它来到了,当我试图从SVN取来运行Vernotologist演示应用程序。为了解决这个问题:

  1. 转到您的gwt.xml文件,并确保它在Eclipse项目资源管理器中选择
  2. 确保您的Eclipse插件Vaadin是安装
  3. 查找Eclipse工具栏编译视窗元件按钮,当属vaadin插件的一部分,看起来像一个齿轮。点击它
  4. 步骤3将编译控件集为您
  5. 重新启动服务器并重新运行应用程序

来源:16.2.2。编译widget集从Vaadin的书在此链接:https://vaadin.com/book/-/page/gwt.eclipse.html


3
投票

这是一个古老的线程,但在最近的版本Vaadin(7.x.x)的解决方案是完全不同的。没有GWT插件需要:

<plugin>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-maven-plugin</artifactId>
    <configuration>
        <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
        <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
        <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
        <noServer>true</noServer>
        <draftCompile>false</draftCompile>
        <style>OBF</style>
        <compileReport>true</compileReport>
        <runTarget>http://localhost:8080/</runTarget>
        <widgetsetMode>cdn</widgetsetMode>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile-theme</goal>
                <goal>update-widgetset</goal>
                <goal>compile</goal>
            </goals>
        </execution>
    </executions>
</plugin>

此外,请确保您的ProjectWidgetSet.gwt.xml是内部资源/编译上述前我/公司/文件夹。


-2
投票

我有同样的问题,“加载失败widgetset.nocache.js”但我通过重新安装“vaadin”插件解决了它

步骤:1)帮助 - >蚀市场 - >搜索vaadin - >(如果已安装)将其卸载,并再次通过点击“安装”按钮,安装2)重新编译项目并运行它

© www.soinside.com 2019 - 2024. All rights reserved.