【问题标题】:Vaadin: failed to load widgetset.nocache.jsVaadin:未能加载 widgetset.nocache.js
【发布时间】:2014-01-30 17:43:33
【问题描述】:

我正在使用 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


    【解决方案1】:

    我遇到了同样的问题“无法加载 widgetset.nocache.js”,但我通过重新安装“vaadin”插件解决了这个问题

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

    【讨论】:

      【解决方案2】:

      这是一个旧线程,但在较新版本的 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 位于 resources/my/company/ 文件夹中。

      【讨论】:

        【解决方案3】:

        我遇到了同样的问题“加载小部件集失败:”,当我尝试通过从 svn 中获取来运行 Vernotologist 演示应用程序时,它出现了。要解决这个问题:

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

        来源: 16.2.2.编译小部件集 来自 Vaadin 之书的链接:https://vaadin.com/book/-/page/gwt.eclipse.html

        【讨论】:

          【解决方案4】:

          您需要编译您的小部件集。要启用它,你的 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),我猜您已经这样做了。

          【讨论】:

          • 我不明白。我在 pom.xml 文件中声明了类似的插件(因为我使用 vaadin-archetype 创建了项目),我还在 web.xml 文件中声明并引用了自定义 .gwt.xml 文件,但它不起作用。但是,我复制了您对 pom.xml 的声明。它起作用了。感谢 atmo 花时间帮助我!我很感激:)
          猜你喜欢
          • 2014-09-09
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2011-12-20
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多