[英]Rest service proxy accessing error using GWT
I have a Rest web service. 我有一个Rest Web服务。 I access it by using a java application and its package structure is given below.
我通过使用Java应用程序访问它,其包结构在下面给出。
src.app ->App.gwt.xml src.app-> App.gwt.xml
src.app.source->RestProxyClass.java// to access the Rest Application src.app.source-> RestProxyClass.java//访问Rest应用程序
Following is App.gwt.xml file contents 以下是App.gwt.xml文件的内容
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to="App">
<source path="source"/>
</module>
Using this java application I can access Rest web service. 使用此Java应用程序,我可以访问Rest Web服务。
I took this projects jar and add to GWT project. 我拿着这个项目jar并添加到GWT项目。 I add this jar file to library and select the jar from Order and Export.
我将此jar文件添加到库中,然后从“订单和导出”中选择jar。 I got this package in Referenced Libraries
我在参考库中得到了这个软件包
then I add this following code in .gwt.xml file 然后我在.gwt.xml文件中添加以下代码
<inherits name="app.App" />
But run time I got the following error : 但是运行时出现以下错误:
No source code is available for type app.source.RestProxyClass; did you forget to inherit a required module?
Following is GWT code 以下是GWT代码
public class RestProxyAccessClient implements EntryPoint {
public void onModuleLoad() {
RestProxyClass app=new RestProxyClass();
try {
//restProxy.check();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
确保*.java
文件打包在JAR中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.