0
我在调用其中一个GWT服务时出错。GWT RPC:使用其他服务实现的方法失败
Eclipse控制台拿出这样的:
SCHWERWIEGEND: javax.servlet.ServletContext log: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract de.hdm.gruppe09.clickandlove.shared.report.AllInfosOfProfileReport de.hdm.gruppe09.clickandlove.shared.ReportGenerator.createAllInfosOfProfileReport(de.hdm.gruppe09.clickandlove.shared.bo.Profil) throws java.lang.IllegalArgumentException' threw an unexpected exception: java.lang.NullPointerException
.......
Caused by: java.lang.NullPointerException
at de.hdm.gruppe09.clickandlove.server.report.ReportGeneratorImpl.createAllInfosOfProfileReport(ReportGeneratorImpl.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:130)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
... 40 more
ReportGeneratorImpl.java:107看起来像这样(107是第一个两Sysos的):
103 //Abrufen des eingeloggten Profils. Wird benoetigt für die anschließende Berechnung des Aehnlichkeitsmaßes
104 Profil ep = this.verwaltung.getEingeloggtesProfil();
//Ausgaben über das ep. Nur zu Textzwecken
107 System.out.println("RGImpl: eingeloggtesProfilID:" + ep.getId());
System.out.println("RGImpl: eingeloggtesProfilMail:" + ep.getEmail());
//Abrufen des Aehnlichkeitsma�es
int score = this.verwaltung.berechneAhnlichkeit(p, ep);
System.out.println("RGImpl: Score:" + score);
//Score Int Wert in String umwandeln, da new Column nur String Werte annimmt
String scorestring = Integer.toString(score);
//Setzen des Aehnlichkeitsma�es
Row TopRow = new Row();
TopRow.addColumn(new Column(fullname));
TopRow.addColumn(new Column(scorestring));
显然,对象ep必须为空。可能因为第104行失败。 只要我使用“this.verwaltung”的方法,我的方法就会失败。 这里是我创造我的VERWALTUNG的对象:
private Verwaltung verwaltung = null;
public void init() throws IllegalArgumentException {
VerwaltungImpl a = new VerwaltungImpl();
a.init();
this.verwaltung = a;
}
由于两个“ReportGeneratorImpl”和VerwatlungImpl”我明白,我不需要回调使用方法彼此在服务器上运行,对不对?
基督教,你怎么登录本PROFIL?什么时候eingeloggtesProfil被设置? – thst