2016-06-11 9 views
0

私のGWTサービスの1つを呼び出す際にエラーが発生します。GWT RPC:他のサービス実装のメソッドを使用できません

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)); 

明らかに:(107は2 Sysosの最初のものである)

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次のようになります。

enter image description here

Eclipseのコンソールには、これが出しオブジェクトepはnullでなければなりません。おそらく、ライン104が故障するからでしょう。 "this.verwaltung"のメソッドを使用するたびにメソッドが失敗します。ここ は、私がverwaltungの私のオブジェクトを作成する方法である:

private Verwaltung verwaltung = null; 

public void init() throws IllegalArgumentException { 
    VerwaltungImpl a = new VerwaltungImpl(); 
    a.init(); 
    this.verwaltung = a; 
} 

「ReportGeneratorImpl」とVerwatlungImpl」の両方が、私は私が互いにメソッドを使用するには、noコールバックを必要としないことを理解し、サーバー上で実行されているので、右のことです。 ?

+0

クリスチャン、どのようにあなたがプロフィールにログインしますか? eingeloggtesProfilはいつ設定されますか? – thst

答えて

0

明らかにオブジェクトのEPは[原文] nullにmusst。

あなたは股関節ので、GWTは、デバッガで使用する組み込みのJettyサーバを起動し、ライン104にブレークポイントを設定する考えがありますコードをステップ実行してNullPointerExceptionの原因を確認できますか?

は、詳細はこちらを開発中にテストサービスを参照してください:http://www.gwtproject.org/doc/latest/DevGuideServerCommunication.html

関連する問題