如何解决playN资产路径错误? [英] How to resolve the playN asset path error?
问题描述
找不到为/myproject/myproject.nocache.js找到的文件
另外,我在浏览器中只显示黑屏。
在MyProjectHtml.java文件中,我将路径
platform.assets()。setPathPrefix(myproject /);
如何解决这个问题。我没有找到名称为nocache的任何文件。
注意:我之前问题答案中的评论将会很有用: 谢谢。 您是通过 Maven c $ c> mvn test -Ptest-html )或 GWT项目( 如果您的路径设置正确,则第一种情况应该可行,但将其作为GWT项目运行对我而言始终失败。 我还建议做一个 由于您没有 不管怎样,只有在看到 I am getting the following error when I run my playN project. "No file found for: /myproject/myproject.nocache.js" Also I am getting only a black screen in the browser. In the MyProjectHtml.java file I am giving the path as "platform.assets().setPathPrefix("myproject/");" How can I resolve this problem. I am not finding any file with the name "nocache". Note: The comment in one of my previous question's answer will be useful: How to Run my playN game in production mode locally? Thank you. SOLVED: the resource folder under war was getting generated using eclipse compile only.I have created a source folder src/main/resources and moved all my resources package to it. Before it was under src/main/java. Now it works..! I can compile from terminal and run. Are you running the project via Maven ( The first case should work if your path is set correctly, but running it as a GWT project has always failed for me. I also suggest doing a Seeing as you don't have the Either way, your HTML version won't run until you see the 这篇关于如何解决playN资产路径错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ b 解决:战争中的资源文件夹是使用eclipse编译生成的。我创建了一个源文件夹src / main / resources,并将所有资源包移动到它。在src / main / java之前。现在它的作品..!我可以从终端进行编译并运行。 mvn gwt:run
)?
mvn clean install
,并查看哪些资源包含在 .war
文件中。你的 .nocache.js
文件应该在那里,如果没有,你可能有更大的问题(不正确的项目设置)。
更新:
.nocache.js
war 您的Maven配置有问题。看看下面的配置是否已经添加到您的插件标签中的HTML POM:
< plugin>
< groupId> org.codehaus.mojo< / groupId>
< artifactId> gwt-maven-plugin< / artifactId>
<执行次数>
<执行>
<阶段>准备包< /阶段>
<目标>
< goal>编译< / goal>
< /目标>
< /执行>
< /执行次数>
< / plugin>
时,HTML版本才会运行。 nocache.js
在 war
文件中。用新的PlayN项目仔细检查你的Maven配置,看看有什么区别。mvn test -Ptest-html
) or as GWT project (mvn gwt:run
)?mvn clean install
, and seeing which resources are contained within your .war
file. Your .nocache.js
file should be in there, if not, you probably have a bigger issue (incorrect project setup).Update:
.nocache.js
file in your war
something is wrong with your Maven configuration. See if the following config has been added to your HTML pom in your plugins tags:<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
.nocache.js
in your war
file. Double-check your Maven configuration with a new PlayN project, and see where there are differences.