简体   繁体   English

GWT超级源在开发模式下无法解析类java / lang / Object

[英]GWT super-source gives unable to resolve class java/lang/Object in development mode

I am trying to emulate some java.lang and java.io classes, eg OutputStream within GWT. 我试图模拟一些java.lang和java.io类,例如GWT中的OutputStream。

I have created a "super" package in my module and referenced it using super-source. 我在模块中创建了一个“ super”包,并使用super-source对其进行了引用。

My package structure looks like 我的包裹结构看起来像

com/example/gwt/client
com/example/gwt/server
com/example/gwt/shared
com/example/gwt/super
com/example/gwt/super/java/io/OutputStream.java
com/example/gwt/mymodule.get.xml

and mymodule.xml contains an entry 并且mymodule.xml包含一个条目

<super-source path="super" />

Within Eclipse all of the files within the super folder are in error - to be expected because the package structure is wrong. 在Eclipse中,超级文件夹中的所有文件均错误-可以预料,因为包结构错误。 .class files are being generated in the WEB-INF/classes folder, again with the "wrong" package structure so should be ignored. .class文件正在WEB-INF / classes文件夹中生成,再次使用“错误的”程序包结构,因此应忽略。

When I run my application in development mode I get lots of 当我在开发模式下运行应用程序时,会得到很多

unable to resolve class java/lang/Object

errors. 错误。 What am I doing wrong? 我究竟做错了什么?

Rename ....get.xml to ....gwt.xml? 将.... get.xml重命名为.... gwt.xml?

You can exclude "super" from the eclipse build path. 您可以从Eclipse构建路径中排除“ super”。 Try right-clicking or the build path menu exclusion options.. 尝试单击鼠标右键或构建路径菜单排除选项。

There was nothing wrong with the approach - just the execution. 这种方法没有什么问题-只是执行。

I had compile errors in the emulated classes which were being masked by the fact that Eclipse was showing errors because of the "incorrect" package structure. 我在仿真类中遇到了编译错误,但由于“不正确”的包结构,Eclipse显示了错误,因此掩盖了这些错误。 Running the compiler from within Eclipse flushed these out. 从Eclipse中运行编译器会将其清除。

It also seems that deleting the gwt-unitCache might have helped. 似乎删除gwt-unitCache可能有所帮助。 As I was moving code around it seems that there were stale entries in here that were still being referenced. 当我四处移动代码时,似乎这里有过时的条目仍在被引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM