GWT webappcreator创建一个Maven项目:源附件不包含文件的源URLClassPath.class [英] GWT webappcreator creating a Maven project: the source attachment does not contain the source for the file URLClassPath.class

查看:796
本文介绍了GWT webappcreator创建一个Maven项目:源附件不包含文件的源URLClassPath.class的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个基于Maven2的GWT应用程序,将其导入到Eclipse中,当我调试为GWT Web应用程序时,Eclipse调试会话将以FileNotFoundException异常挂起。它显示一个窗口:源附件不包含URLClassPath.class文件的源。



我已经完全删除了Eclipse工作区(和.metadata子目录) ,创建/导入一个空白项目,同样的事情发生。如果我执行运行方式 GWT Web应用程序,它可以正常工作(有几个警告)。



重现问题的步骤



1)创建应用程序



webAppCreator -noant -maven -XnoEclipse -out MyApp com.example.MyApp



2)导入和更改设置




  • 将应用程序导入Eclipse工作区,在设置中勾选使用Google Web Toolkit复选框。


  • 此项目已经被检查了一个WAR目录。 WAR目录设置为src / main / webapp。




3)调试为



现在按下调试工具栏按钮,选择GWT Web应用程序,并选择目标/ www作为WAR目录。你也应该看到同样的问题。调试窗格中的调用堆栈包含以下内容:


MyApp.html [Web应用程序]

com.google 。$%

$ b行:644

URLClassPath $ JarLoader.access $ 600(URLClassPath $ JarLoader,
URL)行:540

URLClassPath $ JarLoader $ 1.run()行:
607

AccessController.doPrivileged(PrivilegedExceptionAction)
行:不可用[本机方法]

URLClassPath $ JarLoader.ensureOpen()
行:599

URLClassPath $ JarLoader(URL,
URLStreamHandler,
HashMap)行:583

URLClassPath $ JarLoader $ 3.run()行:
810

AccessController.doPrivileged(PrivilegedExceptionAction)
行:不可用[本机方法]

URLClassPath $ JarLoader.getResource(String,
boolean,Set)line : 806

URLClassPath $ JarLoader.getResource(String,
boolean)行:765

URLClassPath.getResource(String,
boolean)行:169

URLClassLoader $ 1.run()行:194

AccessController.doPrivileged(PrivilegedExceptionAction,
AccessControlContext)行:not
available [native method]

Launcher $ AppClassLoader(URLClassLoader).findClass(String)
line:190

Launcher $ AppClassLoader(ClassLoader).loadClass(String,
boolean)行:307

Launcher $ AppClassLoader.loadClass(String,
boolean)行:301

Launcher $ AppClassLoader(ClassLoader).loadClass(String)
行:248 C:\Program
Files\Java\jdk1.6.0_21\bin\javaw.exe
(2010年11月28日15:28:32)




版本和插件



GWT:2.1。



Eclipse:Helios



Maven:2.2.1。



JRE / JDK:JDK 1.6.0.21。 p>

Google插件Eclipse 3.6版本1.4.0.v201010280102。



Maven Integration for Eclipse(m2eclipse)版本0.10.2.20100623-1649(this已配置为指向Maven 2.2.1环境,而不使用嵌入式Maven3实例)。

解决方案

在Eclipse中转到窗口 - >首选项 - > Java - >调试并禁用挂起执行的所有选项。



由于此错误可能不是由您的应用程序引起的,您不会真的需要该类的源(URLClassPath)。您可以搜索Oracle / Sun的Java站点的源码,并将Eclipse指向它们,如果您真的想;)


I have created a Maven2-based GWT application, imported it into Eclipse, and when I Debug As a GWT Web Application, the Eclipse debug session suspends with a FileNotFoundException. It displays a window saying: the source attachment does not contain the source for the file URLClassPath.class.

I have completely wiped out the Eclipse workspace (and .metadata subdirectory), created/imported a blank project and the same thing happens. If I do Run As GWT Web Application it works ok (with a couple of warnings). What do I need to tweak to get this working in debug mode?

Steps to reproduce the problem

1) Create Application

webAppCreator -noant -maven -XnoEclipse -out MyApp com.example.MyApp

2) Import and change settings

  • The application is imported into the Eclipse workspace, in the settings the "Use Google Web Toolkit" checkbox is ticked.

  • "This project has a WAR directory" is checked. The WAR directory is set to src/main/webapp. The "Launch and deploy from this directory" is unchecked.

3) Debug As

Now the debug toolbar button is pressed, choose "GWT Web Application", and select target/www as the WAR directory. You should see the same problem. The call stack in the Debug pane contains the following:

MyApp.html [Web Application]
com.google.gwt.dev.DevMode at localhost:51620 Thread [main] (Suspended (exception FileNotFoundException))
URLClassPath$JarLoader.getJarFile(URL) line: 644
URLClassPath$JarLoader.access$600(URLClassPath$JarLoader, URL) line: 540
URLClassPath$JarLoader$1.run() line: 607
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]
URLClassPath$JarLoader.ensureOpen() line: 599
URLClassPath$JarLoader.(URL, URLStreamHandler, HashMap) line: 583
URLClassPath$JarLoader$3.run() line: 810
AccessController.doPrivileged(PrivilegedExceptionAction) line: not available [native method]
URLClassPath$JarLoader.getResource(String, boolean, Set) line: 806
URLClassPath$JarLoader.getResource(String, boolean) line: 765
URLClassPath.getResource(String, boolean) line: 169
URLClassLoader$1.run() line: 194
AccessController.doPrivileged(PrivilegedExceptionAction, AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: 190
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 307
Launcher$AppClassLoader.loadClass(String, boolean) line: 301
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 248 C:\Program Files\Java\jdk1.6.0_21\bin\javaw.exe (28 Nov 2010 15:28:32)

Versions and plugins

GWT: 2.1.

Eclipse: Helios (3.6).

Maven: 2.2.1.

JRE/JDK: JDK 1.6.0.21.

Google Plugin for Eclipse 3.6 version 1.4.0.v201010280102.

Maven Integration for Eclipse (m2eclipse) version 0.10.2.20100623-1649 (this has been configured to point to Maven 2.2.1 environment and NOT to use the embedded Maven3 "instance").

解决方案

In Eclipse go to Window -> Preferences -> Java -> Debug and disable all options for Suspend Execution.

As this error is probably not caused by your app, you don't really need the source for that class (URLClassPath). You can search Oracle's/Sun's Java site for the sources and point Eclipse to them, if you really want to ;)

这篇关于GWT webappcreator创建一个Maven项目:源附件不包含文件的源URLClassPath.class的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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