Eclipse(和m2eclipse)的问题

时间:2010-07-12 15:42:19

标签: java eclipse jsf m2eclipse

我使用Eclipse而且我遇到了严重的问题:-(首先我试着为你粗暴地重建我的情况:

  1. 我安装了Eclipse Java EE Helios和JDK 1.6.0_21并配置了windows'system vaariables
  2. 我安装了m2eclipse
  3. 我为JSF Web项目
  4. 生成了一个原型

    我使用的是Windows XP Professional SP3

    所以......现在Eclipse有很大的问题。当我尝试打开pom.xml或使用一些maven特定选项时,eclipse停止工作并发生permgen空间错误,就像在我上一次会话中一样:

    !SESSION 2010-07-12 16:45:23.671 -----------------------------------------------
    eclipse.buildId=I20100608-0911
    java.version=1.6.0_21
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
    Framework arguments:  -product org.eclipse.epp.package.jee.product
    Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
    
    !ENTRY org.eclipse.core.resources 2 10035 2010-07-12 16:45:24.796
    !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
    
    !ENTRY org.eclipse.ui 4 0 2010-07-12 16:54:53.046
    !MESSAGE Unhandled event loop exception
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(Unknown Source)
     at java.lang.ClassLoader.defineClass(Unknown Source)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:580)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:550)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:481)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:469)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
     at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at org.eclipse.jface.action.ActionContributionItem.copyMenu(ActionContributionItem.java:1270)
     at org.eclipse.jface.action.ActionContributionItem.handleShowProxy(ActionContributionItem.java:1248)
     at org.eclipse.jface.action.ActionContributionItem.access$4(ActionContributionItem.java:1237)
     at org.eclipse.jface.action.ActionContributionItem$8.handleEvent(ActionContributionItem.java:1210)
     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
     at org.eclipse.swt.widgets.Control.WM_INITMENUPOPUP(Control.java:4485)
     at org.eclipse.swt.widgets.Control.windowProc(Control.java:4188)
     at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
     at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
     at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
     at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886)
     at org.eclipse.swt.internal.win32.OS.TrackPopupMenu(Native Method)
     at org.eclipse.swt.widgets.Menu._setVisible(Menu.java:256)
    
    !ENTRY org.eclipse.core.jobs 4 2 2010-07-12 16:54:53.046
    !MESSAGE An internal error occurred during: "Periodic workspace save.".
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(Unknown Source)
     at java.lang.ClassLoader.defineClass(Unknown Source)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:580)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:550)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:481)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:469)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
     at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at org.eclipse.jdt.internal.core.JavaModelManager.saveVariablesAndContainers(JavaModelManager.java:3819)
     at org.eclipse.jdt.internal.core.JavaModelManager.saving(JavaModelManager.java:4065)
     at org.eclipse.core.internal.resources.SaveManager.executeLifecycle(SaveManager.java:361)
     at org.eclipse.core.internal.resources.SaveManager$1.run(SaveManager.java:170)
     at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
     at org.eclipse.core.internal.resources.SaveManager.broadcastLifecycle(SaveManager.java:173)
     at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1108)
     at org.eclipse.core.internal.resources.SaveManager.save(SaveManager.java:1087)
     at org.eclipse.core.internal.resources.DelayedSnapshotJob.run(DelayedSnapshotJob.java:44)
     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    
    !ENTRY org.eclipse.ui 4 0 2010-07-12 16:54:56.109
    !MESSAGE Unhandled event loop exception
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
     at java.lang.Class.getDeclaredMethods0(Native Method)
     at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
     at java.lang.Class.getMethod0(Unknown Source)
     at java.lang.Class.getMethod0(Unknown Source)
     at java.lang.Class.getMethod0(Unknown Source)
     at java.lang.Class.getMethod0(Unknown Source)
     at java.lang.Class.getMethod0(Unknown Source)
     at java.lang.Class.getMethod0(Unknown Source)
     at java.lang.Class.getMethod(Unknown Source)
     at org.eclipse.ui.internal.handlers.WidgetMethodHandler.getMethodToExecute(WidgetMethodHandler.java:265)
     at org.eclipse.ui.internal.handlers.WidgetMethodHandler.isHandled(WidgetMethodHandler.java:247)
     at org.eclipse.ui.internal.handlers.WidgetMethodHandler.updateEnablement(WidgetMethodHandler.java:57)
     at org.eclipse.ui.internal.handlers.WidgetMethodHandler$1.handleEvent(WidgetMethodHandler.java:49)
     at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
     at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
     at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
     at org.eclipse.swt.widgets.Control.sendFocusEvent(Control.java:2618)
     at org.eclipse.swt.widgets.Widget.wmSetFocus(Widget.java:2402)
     at org.eclipse.swt.widgets.Control.WM_SETFOCUS(Control.java:4792)
     at org.eclipse.swt.widgets.Canvas.WM_SETFOCUS(Canvas.java:448)
     at org.eclipse.swt.widgets.Decorations.WM_SETFOCUS(Decorations.java:1748)
     at org.eclipse.swt.widgets.Control.windowProc(Control.java:4229)
     at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
     at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
     at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
     at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886)
     at org.eclipse.swt.internal.win32.OS.BringWindowToTop(Native Method)
     at org.eclipse.swt.widgets.Decorations.bringToTop(Decorations.java:230)
     at org.eclipse.swt.widgets.Shell.open(Shell.java:1194)
     at org.eclipse.jface.window.Window.open(Window.java:797)
    
    !ENTRY org.eclipse.ui 4 4 2010-07-12 16:55:02.046
    !MESSAGE An internal error has occurred.
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
    
    !ENTRY org.eclipse.ui 4 0 2010-07-12 16:55:09.781
    !MESSAGE Unhandled event loop exception
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
    !SESSION 2010-07-12 17:17:04.234 -----------------------------------------------
    eclipse.buildId=I20100608-0911
    java.version=1.6.0_21
    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
    Framework arguments:  -product org.eclipse.epp.package.jee.product
    Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product
    
    !ENTRY org.eclipse.core.resources 2 10035 2010-07-12 17:17:05.359
    !MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.
    
    !ENTRY org.eclipse.jdt.core 4 4 2010-07-12 17:17:05.843
    !MESSAGE Unable to read variable and containers file
    !STACK 0
    java.io.EOFException
     at java.io.DataInputStream.readInt(DataInputStream.java:375)
     at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadInt(JavaModelManager.java:3344)
     at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.loadProjects(JavaModelManager.java:3373)
     at org.eclipse.jdt.internal.core.JavaModelManager$VariablesAndContainersLoadHelper.load(JavaModelManager.java:3212)
     at org.eclipse.jdt.internal.core.JavaModelManager.loadVariablesAndContainers(JavaModelManager.java:3049)
     at org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:4705)
     at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:5048)
     at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
     at java.security.AccessController.doPrivileged(Native Method)
     at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
     at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
     at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
     at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
     at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
     at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
     at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
     at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
     at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338)
     at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232)
     at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197)
     at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
     at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
     at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
     at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
     at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.addModifyListener(PreferenceServiceRegistryHelper.java:90)
     at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.getModifyListeners(PreferenceServiceRegistryHelper.java:186)
     at org.eclipse.core.internal.preferences.PreferencesService.firePreApplyEvent(PreferencesService.java:440)
     at org.eclipse.core.internal.preferences.PreferencesService.applyPreferences(PreferencesService.java:122)
     at org.eclipse.core.internal.resources.ProjectPreferences.read(ProjectPreferences.java:234)
     at org.eclipse.core.internal.resources.ProjectPreferences.updatePreferences(ProjectPreferences.java:302)
     at org.eclipse.core.internal.resources.File.updateMetadataFiles(File.java:414)
     at org.eclipse.core.internal.localstore.RefreshLocalVisitor.visit(RefreshLocalVisitor.java:297)
     at org.eclipse.core.internal.localstore.UnifiedTree.accept(UnifiedTree.java:108)
     at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshResource(FileSystemResourceManager.java:824)
     at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:808)
     at org.eclipse.core.internal.localstore.FileSystemResourceManager.refreshRoot(FileSystemResourceManager.java:855)
     at org.eclipse.core.internal.localstore.FileSystemResourceManager.refresh(FileSystemResourceManager.java:801)
     at org.eclipse.core.internal.resources.Resource.refreshLocal(Resource.java:1661)
     at org.eclipse.core.internal.refresh.RefreshJob.runInWorkspace(RefreshJob.java:166)
     at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
     at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    
    !ENTRY org.eclipse.ui 4 4 2010-07-12 17:20:11.921
    !MESSAGE Could not create action delegate for id: org.maven.ide.eclipse.editor.RenameProjectAction
    
    !ENTRY org.eclipse.ui 4 4 2010-07-12 17:20:11.921
    !MESSAGE Internal plug-in action delegate error on creation.
    !STACK 0
    java.lang.OutOfMemoryError: PermGen space
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
     at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:580)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:550)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:481)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:469)
     at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
     at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
     at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
     at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
     at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
     at java.lang.Class.getDeclaredConstructors0(Native Method)
     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
     at java.lang.Class.getConstructor0(Class.java:2699)
     at java.lang.Class.newInstance0(Class.java:326)
     at java.lang.Class.newInstance(Class.java:308)
     at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
     at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
     at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
     at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
     at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:259)
     at org.eclipse.ui.internal.PluginAction.createDelegate(PluginAction.java:122)
     at org.eclipse.ui.internal.PluginAction.selectionChanged(PluginAction.java:275)
     at org.eclipse.ui.internal.PluginAction.<init>(PluginAction.java:112)
     at org.eclipse.ui.internal.ObjectPluginAction.<init>(ObjectPluginAction.java:83)
     at org.eclipse.ui.internal.ActionDescriptor.createAction(ActionDescriptor.java:272)
    

    我无法向自己解释,原因很多。也许有人有类似的问题,可以帮助我。

    更新

    :-( 30分钟后,它再次泄漏: - (

    似乎Eclipse仍处于无休止的循环中。 “Eclipse”任务不断使用我CPU的50%。

    这很奇怪。这是我的eclipse.ini:

    -startup
    plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
    -product
    org.eclipse.epp.package.jee.product
    --launcher.defaultAction
    openFile
    -XX:MaxPermSize=256m
    -showsplash
    org.eclipse.platform
    --launcher.defaultAction
    openFile
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms128m
    -Xmx512m
    

    也许有问题?!?有人有想法吗?

    编辑:我需要说它更好。这个问题很少发生。

    更新2:

    May Somebaody请帮我配置我的eclips.ini。所以我可以使用JDK 6-21 ......或者我应该使用旧版本?

    到目前为止:

    -startup
    plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
    -product
    org.eclipse.epp.package.jee.product
    --launcher.defaultAction
    openFile
    -XX:PermSize=128M
    -XX:MaxPermSize=256m
    -showsplash
    org.eclipse.platform
    --launcher.defaultAction
    openFile
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms128m
    -Xmx512m
    

    好的,我按照船长的推荐,发布了另一个问题: Trouble with Eclipse

3 个答案:

答案 0 :(得分:10)

另一个对我有用的选择是添加运行 - >调试配置...-&gt;(您的Maven版本) - &gt; JRE标签 - > VM参数一些VM参数:

-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:NewSize=128m

希望这有帮助...

已更新:

甚至,您可以将相同的参数添加到:

Window-&gt;偏好设置 - &gt; Java-&gt;已安装的JRE-&gt;(您首选的JDK或Maven实例使用的JRE ) - &gt;默认VM参数< /强>

答案 1 :(得分:6)

你需要通过在eclipse.ini中传递-XX:MaxPermSize = 256m来增加你的最大烫发大小

注意:对于Helios和您的java版本,请使用上面的内容,使用其他参数(launcher.XXMaxPermSize)将因为一个错误而无效。

在以下链接中查看更多信息: http://wiki.eclipse.org/FAQ_How_do_I_increase_the_permgen_size_available_to_Eclipse%3F

https://bugs.eclipse.org/bugs/show_bug.cgi?id=319514

答案 2 :(得分:0)

我的日食伽利略似乎有类似的问题。使用JDK 6 update 3时,它一直工作正常,直到我更新了我的jdk 1.6.0_21。

当我将JDK路径更改为指向Jdk 6 update 3时,它开始正常工作。

希望这有帮助!!!

谢谢, Amit Chhajed