- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我最近尝试开始使用 Grails,现在我想将我的 gwt 客户端部分集成到 grails 项目中。我正在使用 Grails GWT 插件并最终修复了所有编译器错误,除了这个:
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$Tokenizer 和 UserPlace$Tokenizer 重复相同的操作,除了我还收到:
[ERROR] Annotation error: expected class java.lang.Class, got null
这些类是我使用内置 ActivitiesAndPlaces 框架实现 MVP 模式的一部分。AppPlaceHistoryMapper 的代码是这样的:
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
和:
[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
在 onModuleLoad() 中,我以这种方式创建 AppPlaceHistoryMapper:
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,也许我漏掉了什么。谁能帮帮我?
最佳答案
我觉得这个link (谷歌群组)可能会有所帮助。
基本上,您必须编译使用注释创建的类(那些带有 Tokenizers,在 PlaceHistoryMapper 上引用的类)。编译这些类后,将它们添加到 GWTCompiler 的类路径中。
希望对你有帮助
关于java - Grails gwt 模块中的 ClassNotFoundException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9612717/
我的应用在尝试访问外部依赖项时遇到 NoClassDefFoundError,但仅限于作为 jar 运行时。 使用 Intellij,我有一个带有主类的简单应用程序,其中包含一些对外部依赖项(例如 s
我收到以下异常: java.lang.ClassNotFoundException: org.jboss.resteasy.plugins.server.servlet.ResteasyBootstr
我正在尝试使用eclipse和tomcat调试solr4.6源代码。我收到错误消息:HTTP 状态 500 - {msg=SolrCore 'collection1' 由于初始化失败而不可用:[sch
我是新来的,很抱歉我的英语不好;)。 我尝试使用以下代码在 java 中加载插件 jar: package testprogramm; import java.io.File; import java
我重新安装了 ADT Bundle,因为我在更新 eclipse 后遇到了一些问题。 现在,当我想测试我的应用程序时,出现以下异常: 06-05 10:33:35.770: E/AndroidRunt
我浏览过现有的帖子,这些帖子处理在 Eclipse 中的 Tomcat 下运行 Java Web 应用程序的 ClassNotFoundException。 我无法提供源代码和配置 Artifact
我忙于我的应用一个多星期,突然: 11-12 07:59:17.860 1653-1653/nl.test.myapp E/AndroidRuntime﹕ FATAL EXCEPTION: ma
我的应用程序有问题,昨天一切正常,但今天我更新了 sdk,现在当我尝试运行我的应用程序时,出现这样的错误 05-21 00:14:19.285: W/dalvikvm(7061): Unable t
我正在阅读 JPA docs在 Spring ,我正在尝试重组我的代码。 我现在所拥有的: BrewerRepository @Repository public class BrewerReposi
我想像 BalusC's example 一样实现 fileUpload . 不幸的是,我已经在努力声明 servlet。 Extensions Filter javax.faces
在某些机器上运行这个小程序不起作用,但在其他机器上它工作得很好。在所有情况下看起来都安装了 JRE 1.6.0_26。 var attributes = {codebase:'http://kas
我将跟随这个非常简单的教程(http://www.tutorialspoint.com/hadoop/hadoop_mapreduce.htm)一起学习,直到我尝试运行Java文件为止,一切运行良好。
我看到了帖子,并按照流程进行了操作。但这没有用。 ClassNotFoundException, while running example job of Hadoop 请帮助我。 创建的 mapre
我尝试在cloudera quickstart vm上为hadoop运行Mahout Kmeans示例。我在这里读link to clouudera block和这里stack overflow po
我有一个mapreduce程序,其中我使用Hcatalog从Hive表'A'中获取带有HcatInputFormat的详细信息,对其进行处理,然后使用HcatOutput格式将其写回到Hive表'B'
我是激发应用程序编程的新手,因此在这里为这个基本的编程而苦苦挣扎。 我有 scala ide 并附加了来自最新 hadoop 和 spark 发行版的相关 jar 文件。我正在使用的只有一个基本的 s
我正在尝试在本地模式下运行Spark示例,但是正在获取以下堆栈跟踪: Exception in thread "main" java.lang.NoClassDefFoundError: org/ap
我有以下代码: // Test TODO remove try { System.out.println(System.getProperties().getPrope
我有以下文件: src/my_proj/myns.clj: (ns my-proj.myns) (defrecord MyRecord [a b c]) 测试/my_proj/myns_test.c
我试图让应用程序动态加载某些类,然后调用启动方法,但问题是,由于 ClassLoader 不同,一个类无法调用另一个类的方法,但是正如我已经用 google 搜索的那样,我用父类创建了两个类加载器。这
我是一名优秀的程序员,十分优秀!