2012-03-08 7 views
1

最近Grailsを使用しようとしましたが、gwtクライアント部分をgrailsプロジェクトに統合したいと考えています。私は、GrailsのGWTプラグインを使用していますが、最終的にこの1を除いて、すべてのコンパイルエラーを修正していますGrails gwtモジュールでClassNotFoundExceptionが発生しました

Compiling module com.CalendarMVP 
| Resolving com.client.mvp.AppPlaceHistoryMapper 
|  Found type 'com.client.mvp.AppPlaceHistoryMapper' 
|   [ERROR] Annotation error: cannot resolve com.client.place.HelloPlace$Tokenizer 
| java.lang.ClassNotFoundException: com.client.place.HelloPlace$Tokenizer 

そして、私はまた、受け取ることを除いてGreetingsPlace $トークナイザとUserPlace $トークナイザで同じ繰り返し、:

[ERROR] Annotation error: expected class java.lang.Class, got null 

このクラスはAppPlaceHistoryMapper用ビルトインActivitiesAndPlaces framework.Theコードを使用して自分のMVPパターン実現の一部は、このようなあるある:

package com.client.mvp; 

import com.google.gwt.place.shared.PlaceHistoryMapper; 
import com.google.gwt.place.shared.WithTokenizers; 

import com.client.place.GoodbyePlace; 
import com.client.place.GreetingsPlace; 
import com.client.place.HelloPlace; 
import com.client.place.ManagerCalendarPlace; 
import com.client.place.ManagerPlace; 
import com.client.place.UserPlace; 

@WithTokenizers({ HelloPlace.Tokenizer.class, GoodbyePlace.Tokenizer.class, 
GreetingsPlace.Tokenizer.class, ManagerPlace.Tokenizer.class, 
UserPlace.Tokenizer.class, ManagerCalendarPlace.Tokenizer.class 
}) 
public interface AppPlaceHistoryMapper extends PlaceHistoryMapper { 
} 

とHelloPlaceのために:

package com.client.place; 

import com.google.gwt.place.shared.Place; 

import com.google.gwt.place.shared.PlaceTokenizer; 


public class HelloPlace extends Place { 
private String helloName; 

public HelloPlace(String token) 
{ 
    this.helloName = token; 
} 

public String getHelloName() 
{ 
    return helloName; 
} 

public static class Tokenizer implements PlaceTokenizer<HelloPlace> 
{ 

    @Override 
    public String getToken(HelloPlace place) 
    { 
     return place.getHelloName(); 
    } 

    @Override 
    public HelloPlace getPlace(String token) 
    { 
     return new HelloPlace(token); 
    } 

} 

} 

エラーリストの最後に、私も持っている:

Computing all possible rebind results for 'com.client.mvp.AppPlaceHistoryMapper' 
|   Rebinding com.client.mvp.AppPlaceHistoryMapper 
|    Invoking generator com.google.gwt.place.rebind.PlaceHistoryMapperGenerator 
|    [ERROR] Generator 'com.google.gwt.place.rebind.PlaceHistoryMapperGenerator' threw an exception while rebinding 'com.client.mvp.AppPlaceHistoryMapper' 
| java.lang.NullPointerException 

と:

onModuleLoad()私は、このような方法でAppPlaceHistoryMapperを作成するには
[WARN] For the following type(s), generated source was never committed (did you forget to call commit()?) 
|   [WARN] com.client.mvp.AppPlaceHistoryMapperImpl 
| [ERROR] Errors in 'file:/D:/Naukma/Programing/JavaEE/STSworkspace/SocSystemGrails/src/gwt/com/client/CalendarMVP.java' 
|  [ERROR] Line 47: Failed to resolve 'com.client.mvp.AppPlaceHistoryMapper' via deferred binding 

public void onModuleLoad() 
{ 

    ClientFactory clientFactory = GWT.create(ClientFactoryImpl.class); 
    EventBus eventBus = clientFactory.getEventBus(); 
    PlaceController placeController = clientFactory.getPlaceController(); 

    ActivityMapper activityMapper = new AppActivityMapper(clientFactory); 
    ActivityManager activityManager = new ActivityManager(activityMapper, eventBus); 
    activityManager.setDisplay(appWidget); 

    AppPlaceHistoryMapper historyMapper= GWT.create(AppPlaceHistoryMapper.class); 
    PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper); 
    historyHandler.register(placeController, eventBus, defaultPlace); 

    RootPanel.get().add(appWidget); 
    // Goes to place represented on URL or default place 
    historyHandler.handleCurrentHistory(); 
} 

Grailsとの作業を開始し、おそらく私は何かを手掛けています。誰か助けてくれますか?

+0

あなたの 'client'フォルダの下に' AppPlaceHistoryMapper'がありますか? – Strelok

+0

はい、私のMVPクラスはすべて "client"フォルダにあります。com.client。*のようなパッケージになっています。*はexmpleの場所です。 AppPlaceHistoryMapperはcom.client.mvpにあります。また、 "client"フォルダはGrails GWTプラグインによって自動的に作成された "gwt"フォルダにあります。 – ferbolg

答えて

2

私はこれがlink(Googleグループ)が役立つと思います。

基本的には、アノテーション(PlaceHistoryMapperで参照されるトークナイザを使用するクラス)を使用して作成されたクラスをコンパイルする必要があります。 これらのクラスをコンパイルしたら、それらをGWTCompilerのクラスパスに追加します。

は、それが

1

If Error SDM compile: Finding entry point classes [ERROR] Unable to find type 'com.company.project.client.YourGWTApp' [ERROR] Hint: Check that the type name 'com.ajna4taiga.recycling.client.RecyclingEntryPoint' is really what you meant [ERROR] Hint: Check that your classpath includes all required source roots [ERROR] Compiler returned false

は アドバンス(ボタン) アドバンスフォルダ(自分のYourGWTAppプロジェクトのsrc direcotryを追加) Applay保存実行構成

if bellow error Compiling module com.company.project.YourGWTApp
Resolving com.ajna4taiga.recycling.client.AppPlaceHistoryMapper Found type 'com.company.project.client.AppPlaceHistoryMapper' [ERROR] Annotation error: cannot resolve com.company.project.client.places.HomePlace$HomePlaceTokenizer

SDM ユーザーエントリのクラスパスの実行構成を追加することができますホープ

あなたのSDMのためのあなたの実行のconigurationを追加する必要があります クラスパスのGWTプロジェクトを追加してください ユーザーエントリ ボタンプロジェクトを追加します あなたのGWTAppプロジェクトを確認します

関連する問題