控制在类路径中加载JAR的顺序 [英] Controlling the order of how JARs are loaded in the classpath

查看:104
本文介绍了控制在类路径中加载JAR的顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将GWT 2.4与gquery-dnd-bundle 1.0.4结合使用,以便可以构建具有拖放节点的树。我遇到了一个令人讨厌的错误(http://code.google.com/p/gwtquery-plugins/issues/detail?id=6)。要点是,我需要保证在我的WEB-INF / lib目录中的gwt-servlet.jar文件之前,类加载器会在运行时加载文件 gquery-dnd-bundle-1.0.4.jar。

I'm using GWT 2.4 with gquery-dnd-bundle 1.0.4 so that I can construct trees with drag-and-drop nodes. I've bumped into an annoying bug (http://code.google.com/p/gwtquery-plugins/issues/detail?id=6). The gist of it is I need to guarantee that the file "gquery-dnd-bundle-1.0.4.jar" gets loaded by the classloader at runtime before the gwt-servlet.jar file in my WEB-INF/lib directory.

我怎么保证呢?

我正在将Eclipse Indigo与GWT Web应用程序项目结合使用有用。

I'm using Eclipse Indigo with a GWT Web Application project if that is useful.

这是我看到的确切错误

[ERROR] [draganddroptree] - Errors in 'jar:file:/C:/Documents%20and%20Settings/E18538/workspace/DragAndDropTree/war/WEB-INF/lib/gquery-dnd-bundle-1.0.4.jar!/gwtquery/plugins/droppable/client/gwt/DragAndDropCellTree.java'
        [ERROR] [draganddroptree] - Line 24: The type com.google.gwt.user.cellview.client.CellTreeNodeView is not visible
        [ERROR] [draganddroptree] - Line 86: CellTreeNodeView cannot be resolved to a type
        [ERROR] [draganddroptree] - Line 87: The constructor DragAndDropCellTreeNodeView<T>(DragAndDropCellTree, CellTreeNodeView<?>, TreeViewModel.NodeInfo<T>, Element, T) refers to the missing type CellTreeNodeView
    [ERROR] [draganddroptree] - Unable to load module entry point class com.cme.draganddroptree.client.DragAndDropTree (see associated exception for details)
    [ERROR] [draganddroptree] - Failed to load module 'draganddroptree' from user agent 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1' at localhost:4490


推荐答案

要解决此错误,您应该使用gquery -dnd-bundle-1.0.4.jar在类路径中的GWT之前设置。在项目属性中使用Eclipse进入 Java Build Path / Order a export ,并确保gquery lib位于GWT之前。

To solve this bug you should have gquery-dnd-bundle-1.0.4.jar set before GWT in your classpath. Using Eclipse in your project properties go to Java Build Path / Order an export and make sure gquery lib is before GWT.

无论如何,您可能还会遇到另一个问题,因为gquery-dnd-bundle-1.0.4.jar与GWT 2.3.x兼容,并且您正在使用GWT 2.4。在dnd-bundle发行新版本之前,您可以使用 enhance-plugin-1.0.2 .jar (包含DND捆绑包)和 gwtquery-1.1。 0-SNAPSHOT.jar

Anyway you may have another problem as gquery-dnd-bundle-1.0.4.jar is compatible with GWT 2.3.x and you are using GWT 2.4. Until a new release of dnd-bundle you can use the enhance-plugin-1.0.2.jar (contains the DND bundle) and gwtquery-1.1.0-SNAPSHOT.jar.

您还应该查看GWT 2.4中添加的本机拖放支持。文档虽然很少,但是我发现了这个示例(您可以将模板从右侧拖放到任务详细信息),以及相关的源代码。 (此发布

You should look also at the native drag and drop support added in GWT 2.4. Documentation is scarce, but I found this example (you can drag templates from the right and drop them in the task details), and the relevant source code. (info from this post)

这篇关于控制在类路径中加载JAR的顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆