2016-06-11 9 views
0

내 GWT 서비스 중 하나를 호출하는 중 오류가 발생합니다.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 개의 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

이클립스 콘솔이 끈다 오브젝트 ep는 null이 아니면 안됩니다. 아마도 라인 104가 실패하기 때문일 것입니다. "this.verwaltung"메서드를 사용할 때마다 내 메서드가 실패합니다. 그 권리 인 "ReportGeneratorImpl"및 VerwatlungImpl "나는 더 콜백이 서로 방법을 사용하지해야한다는 것을 이해 서버에서 실행중인 두 때문에

private Verwaltung verwaltung = null; 

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

:. 여기 내가 VERWALTUNG의 내 객체를 생성하는 방법이다 ?

+0

기독교를, 당신은 어떻게하기 Profil 로그인합니까? eingeloggtesProfil은 언제 설정됩니까? – thst

답변

0

은 분명히 개체 EP는 [원문] null이 될 musst.

당신이 그쪽 있도록, GWT는 디버거를 사용하는 임베디드 부두 서버를 시작하고 라인 (104)에 브레이크 포인트를 설정하는 생각 되세요 코드를 단계별로 실행하여 NullPointerException의 원인을 확인하십시오.

은 자세한 내용은 개발 여기 동안 테스트 서비스를 참조하십시오 http://www.gwtproject.org/doc/latest/DevGuideServerCommunication.html