为什么我的RPC总是不能编译

paulguard 2010-10-19 05:10:08
MessengerService.java


package Personal.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("messenger")
public interface MessengerService extends RemoteService{
Integer add();
}


MessengerServiceAsync.java


package Personal.client;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface MessengerServiceAsync {
void add(AsyncCallback<Integer> callback);
}



MessengerServiceImpl.java

package Personal.server;

import Personal.client.MessengerService;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

@SuppressWarnings("serial")
public class MessengerServiceImpl extends RemoteServiceServlet implements MessengerService{

public Integer add() {
// TODO Auto-generated method stub
return 10;
}

}



测试用java


package Personal.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.RootPanel;

public class Personal implements EntryPoint {

@Override
public void onModuleLoad() {
// TODO Auto-generated method stub
MessengerServiceAsync messengerService=(MessengerServiceAsync)GWT.create(MessengerService.class);

UserUI user=new UserUI();
AbsolutePanel bottom=user.BottomPanel();
RootPanel.get().add(bottom);

}

}



web.xml:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Personal</display-name>
<welcome-file-list>
<welcome-file>Personal.html</welcome-file>
</welcome-file-list>

<servlet>
<servlet-name>messenger</servlet-name>
<servlet-class>Personal.server.MessengerServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>messenger</servlet-name>
<url-pattern>/Personal.Personal/messenger</url-pattern>
</servlet-mapping>
</web-app>






运行之后的错误提示是

Compiling module Personal.Personal
Scanning for additional dependencies: file:/D:/workspace/Personal/src/Personal/client/UserUI.java
Adding '7' new generated units
Validating newly compiled units
[ERROR] Errors in 'generated://C6A505108C2A9ECA6BA42FAAF2B30A92/Personal/client/MessengerService_Proxy.java'
[ERROR] Line 11: Personal.client cannot be resolved to a type
[ERROR] Line 14: Personal.client cannot be resolved to a type
[ERROR] Line 14: Personal.client cannot be resolved to a type
[ERROR] Line 20: SERIALIZER cannot be resolved
See snapshot: C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MessengerService_Proxy3909647959864277479.java
[ERROR] Unable to find recently-generated type 'Personal.client.MessengerService_Proxy
[ERROR] Errors in 'file:/D:/workspace/Personal/src/Personal/client/UserUI.java'
[ERROR] Internal compiler error
java.lang.RuntimeException: Unable to commit generated files
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:131)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:200)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:123)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:234)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$200(AbstractCompiler.java:109)
at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:522)
at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:112)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:47)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:430)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:32)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
at com.google.gwt.dev.Compiler.run(Compiler.java:201)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
at com.google.gwt.dev.Compiler.main(Compiler.java:159)
Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.javac.StandardGeneratorContext.finish(StandardGeneratorContext.java:358)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:129)
... 17 more

[ERROR] Unexpected
java.lang.RuntimeException: Unable to commit generated files
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:131)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:200)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:123)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:234)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$200(AbstractCompiler.java:109)
at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:522)
at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:112)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:47)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:430)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:32)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:522)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:414)
at com.google.gwt.dev.Compiler.run(Compiler.java:201)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:152)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
at com.google.gwt.dev.Compiler.main(Compiler.java:159)
Caused by: com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.javac.StandardGeneratorContext.finish(StandardGeneratorContext.java:358)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:129)
... 17 more



各位大侠能否帮我看下,谢谢~!
...全文
155 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

25,984

社区成员

发帖
与我相关
我的任务
社区描述
高性能WEB开发
社区管理员
  • 高性能WEB开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧