SAP / hybris-commerce-eclipse-plugin

A plugin for Eclipse IDE that makes developers more efficient when developing on SAP Hybris Commerce.
Apache License 2.0
34 stars 28 forks source link

Out of Memory error while importing cmssmartedit into eclipse #99

Closed jeff-innovent closed 2 years ago

jeff-innovent commented 2 years ago

Describe the bug An out of memory error occurs using the SAP import to import Hybris 2105 into Eclipse. It works fine on 2005 and 1905.

To Reproduce Steps to reproduce the behavior:

  1. Use eclipse import to import a 2105 Hybris install into the Eclipse environment.

Expected behavior Expect a successful import like 2005 and 1905.

Eclipse Log Entries !ENTRY org.eclipse.core.jobs 4 2 2021-12-08 10:30:16.746 !MESSAGE An internal error occurred during: "C:\hybris2105\hybris\bin\modules\smartedit\cmssmartedit". !STACK 0 java.lang.OutOfMemoryError: Java heap space at org.eclipse.core.internal.watson.ElementTreeIterator.requestPath(ElementTreeIterator.java:168) at org.eclipse.core.internal.resources.ResourceProxy.requestFullPath(ResourceProxy.java:119) at org.eclipse.core.internal.resources.ResourceProxy.requestResource(ResourceProxy.java:129) at org.eclipse.core.internal.resources.Resource.lambda$1(Resource.java:117) at org.eclipse.core.internal.resources.Resource$$Lambda$881/0x0000000100aa7db8.visit(Unknown Source) at org.eclipse.core.internal.resources.Resource.lambda$0(Resource.java:85) at org.eclipse.core.internal.resources.Resource$$Lambda$337/0x00000001003a30f8.visitElement(Unknown Source) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:85) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:90) at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:135) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:94) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:55) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:117) at org.eclipse.core.internal.resources.Resource.accept(Resource.java:105) at org.eclipse.ui.internal.wizards.datatransfer.expressions.HasFileRecursivelyExpression.evaluate(HasFileRecursivelyExpression.java:76) at org.eclipse.ui.internal.wizards.datatransfer.ProjectConfiguratorExtensionManager.getAllActiveProjectConfiguratorsUntyped(ProjectConfiguratorExtensionManager.java:105) at org.eclipse.ui.internal.wizards.datatransfer.ProjectConfiguratorExtensionManager.getAllActiveProjectConfigurators(ProjectConfiguratorExtensionManager.java:142) at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.importProjectAndChildrenRecursively(SmartImportJob.java:427) at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.run(SmartImportJob.java:255) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.core.jobs 4 2 2021-12-08 10:30:16.753 !MESSAGE An internal error occurred during: "Sending build events with disabled autobuild". !STACK 0 java.lang.OutOfMemoryError: Java heap space at org.eclipse.core.runtime.Path.append(Path.java:334) at org.eclipse.core.internal.dtree.DeltaDataTree.getChildren(DeltaDataTree.java:553) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:149) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.createDelta(ResourceDeltaFactory.java:158) at org.eclipse.core.internal.events.ResourceDeltaFactory.computeDelta(ResourceDeltaFactory.java:64) at org.eclipse.core.internal.events.NotificationManager.getDelta(NotificationManager.java:240) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149) at org.eclipse.core.internal.resources.Workspace.broadcastBuildEvent(Workspace.java:367) at org.eclipse.core.internal.events.AutoBuildJob$AutoBuildOffJob.run(AutoBuildJob.java:319) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Desktop (please complete the following information):

Extra Context The hard failure happens with eclipse.ini configured with -Xmx2048m.

Configuring eclipse.ini to -Xmx4096m stops the out of memory error, but the import just hangs on smartedit. Log entry below. I manually terminated after one hour.

!ENTRY com.hybris.hyeclipse.importer 1 0 2021-12-08 11:23:12.381 !MESSAGE Importing Eclipse project [smartedit]

JimmySimard commented 2 years ago

Hi! Have you found a solution to your problem ? Cause I got the same kind of error with my eclipse

mikolayek commented 2 years ago

Hi! Thank you for your message. To be frank, I haven't noticed that I got that error being raised. I will take a look at that soon.

All the best, Pawel

mikolayek commented 2 years ago

Hi there, I have tested my local environment with 2011 and 2105 on Mac. All works fine.

I have noticed that you have used hidden/experimental import approach:

org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.importProjectAndChildrenRecursively(SmartImportJob.java:427)
at org.eclipse.ui.internal.wizards.datatransfer.SmartImportJob.run(SmartImportJob.java:255)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

which is behind File -> Open Project from File System...

One of your eclipse plugins (not mine one!!) which has configured project configurator (internal eclipse stuff.. don't want to go into details, but that is about plugin configuration: https://git.eclipse.org/c/m2e/m2e-core.git/plain/org.eclipse.m2e.importer/plugin.xml) has condition HasFileRecursivelyExpression, which lost somewhere in one of SAP Commerce directories symlinks on Windows 10.

I have also tested that on Mac, with standard Maven plugin, which has the same condition and looks for "pom.xml" files. Again. It went smoothly on my Mac.

As a solution I would recommend to use standard approach with importing SAP Commerce Cloud, which is File -> Import... then SAP -> Import SAP Platform. That works fine and doesn't go recursively through FS.

Hope that solves issue.

I have lost access to Windows machine, so not able to test it on Windows anymore :(