gama-platform / gama.old

Main repository for developing the 1.x versions of GAMA
GNU General Public License v3.0
304 stars 99 forks source link

Can't start new gama release on a fresh workspace #3860

Closed lesquoyb closed 1 year ago

lesquoyb commented 1 year ago

Describe the bug After installing the GAMA 1.9.2 release AND changing to a new workspace, I'm unable to run it anymore. Gama starts then nothing happens as soon as I pick a workspace. I still see the process in the task manager but it takes close to zero resources and basically seems to be dead. I'm also unable to run gama on previously working workspaces.

After some tweaking I finally managed to get a log here:

!SESSION 2023-09-05 10:32:21.424 -----------------------------------------------
eclipse.buildId=${build.id}
java.version=17.0.4.1
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -data @noDefault

!ENTRY org.eclipse.osgi 4 0 2023-09-05 10:32:29.732
!MESSAGE Application error
!STACK 1
java.lang.LinkageError: loader constraint violation: loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @4a41caed wants to load abstract class org.eclipse.e4.core.contexts.ContextFunction. A different abstract class with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @60511187. (org.eclipse.e4.core.contexts.ContextFunction is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @60511187, parent loader 'platform')
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.getHandler(HandlerServiceImpl.java:65)
    at org.eclipse.ui.internal.commands.CommandPersistence.readCommandsFromRegistry(CommandPersistence.java:196)
    at org.eclipse.ui.internal.commands.CommandPersistence.reRead(CommandPersistence.java:461)
    at org.eclipse.ui.internal.CommandToModelProcessor.process(CommandToModelProcessor.java:71)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:309)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:243)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.ui.internal.workbench.ModelAssembler.runProcessor(ModelAssembler.java:715)
    at org.eclipse.e4.ui.internal.workbench.ModelAssembler.runProcessors(ModelAssembler.java:649)
    at org.eclipse.e4.ui.internal.workbench.ModelAssembler.processModel(ModelAssembler.java:322)
    at org.eclipse.e4.ui.internal.workbench.ResourceHandler.loadMostRecentModel(ResourceHandler.java:199)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:371)
    at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:247)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:572)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
    at msi.gama.application.Application.start(Application.java:148)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

To Reproduce Steps to reproduce the behavior:

  1. Download the latest release (https://github.com/gama-platform/gama/releases/tag/1.9.2)
  2. Install
  3. Run gama
  4. create a new workspace
  5. See error

Additional context Tested on linux and no problem so it may be windows specific.

The manipulation that got me to be able to get a log is running the eclipse version on the same workspace first. Somehow it looks like it repaired things in the ws and that's after this that gama release was able to write a log. Here is the content of the eclipse console if that can help:

!ENTRY org.eclipse.ui 4 4 2023-09-05 10:31:11.467
!MESSAGE Unable to process element: editorOnboardingCommand in perspective extension: null

!ENTRY org.eclipse.ui 4 4 2023-09-05 10:31:11.471
!MESSAGE Unable to process element: editorOnboardingCommand in perspective extension: null
Refreshing GAMA Workspace: updating the library of models
> GAMA: Checking date of models library                 modified______ Mar 06,2023 10:21:50
Refreshing GAMA Workspace: recreating files metadata
> GAMA: Retrieving workspace metadata                   done in_______ 57ms
> GAMA: GAML artefacts                                  built in______ 48ms
> GAMA: Preloading preferences view                     done in_______ 11787ms
Error in reading metadata of file:/C:/Users/baptiste/Gama_Workspace1.9.2-clean-clean/.cache/download.geofabrik.de+_++_+europe+_+andorra-latest.osm.pbf
Refreshing GAMA Workspace: refreshing resources
Refreshing GAMA Workspace: deleting virtual folders caches
Refreshing GAMA Workspace: deleting virtual folders caches
Error in reading metadata of file:/C:/Users/baptiste/Gama_Workspace1.9.2-clean-clean/.cache/download.geofabrik.de+_++_+europe+_+andorra-latest.osm.pbf
> GAMA: workspace metadata                              saved in______ 581ms

Also now I'm able to run gama from eclipse without any issues, but not the release

AlexisDrogoul commented 1 year ago

No problem on macOS M1 with the release (the one w/ JDK)... I can start it in an existing workspace, create a new one, switch to it, back and forth...

lesquoyb commented 1 year ago

After some tests, I think gama was just using an old jdk for some reason. I downloaded it again with the embedded jdk and everything works well

hqnghi88 commented 1 year ago

I have the same behavior, on eclipse 2309, git base 1.9.3, right after refresh/create a workspace, here is the pop up message

An internal error occurred during: "Refreshing the GAMA Workspace". loader constraint violation: loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @710b30ef wants to load interface com.google.common.collect.Multimap. A different interface with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @22101c80. (com.google.common.collect.Multimap is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @22101c80, parent loader 'platform')

Screenshot 2023-09-19 at 09 33 00

and in eclipse console:

java.lang.LinkageError: loader constraint violation: loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @710b30ef wants to load interface com.google.common.collect.Multimap. A different interface with the same name was previously loaded by org.eclipse.osgi.internal.loader.EquinoxClassLoader @22101c80. (com.google.common.collect.Multimap is in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @22101c80, parent loader 'platform') at msi.gama.application.workspace.WorkspaceModelsManager.loadModelsLibrary(WorkspaceModelsManager.java:424) at ummisco.gama.ui.commands.RefreshHandler$3.runInWorkspace(RefreshHandler.java:149) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

hqnghi88 commented 1 year ago

Also, it is on M1, JDK 17.0.8

lesquoyb commented 1 year ago

Reappeared for me too in the development version on w11 eclipse 2023-09 jdk 17.0.4.1

lesquoyb commented 1 year ago

isn't that the same error message as the one pointed out in #3830 ?

hqnghi88 commented 1 year ago

The version defining of guava in msi.gama.ext is causing this issue. If i remove the min max version, gama can launch and refresh the library.

AlexisDrogoul commented 1 year ago

Merging this into #3830 as it is the same issue.