hallvard / plantuml

Embed UML diagrams in files and view them in Eclipse
http://plantuml.sourceforge.net/
209 stars 57 forks source link

Eclipse plugin: math formulas not shown after update to 1.1.25 #131

Open danieleb2000 opened 3 years ago

danieleb2000 commented 3 years ago

Screenshot 1.1.24 (it used to work):

image

danieleb2000 commented 3 years ago

Screenshot 1.1.25 (not working anymore):

image

hallvard commented 3 years ago

Perhaps there's some dependency issue that prevents the jlatexmath plugin to be activated/used with 1.1.25.

danieleb2000 commented 3 years ago

Everything has been installed from scratch. Some hints about how to investigate the dependency issue?

hallvard commented 3 years ago

Strange... when launched from my dev. eclipse (both Luna and 2020-6) the PlantUML view shows it as expected, while the PlantUML Svg view throws an exception:

formula=R(t) = e^(-lambda*t) Latex={R}{\left({t}\right)}={e}^{{-\lambda\cdot{t}}} java.lang.ClassNotFoundException: org.apache.batik.dom.GenericDOMImplementation cannot be found by net.sourceforge.plantuml.lib_1.2021.3 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:516) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at net.sourceforge.plantuml.math.ConverterSvg.getSvg(ConverterSvg.java:84) at net.sourceforge.plantuml.math.LatexBuilder.getSvg(LatexBuilder.java:74) at net.sourceforge.plantuml.math.AsciiMath.getSvg(AsciiMath.java:99)

danieleb2000 commented 3 years ago

By me also with normal diagram it is not correctly shown. Maybe some needed dependency is not installed?

danieleb2000 commented 2 years ago

Error still present in 1.1.26. Root cause understood?

hallvard commented 2 years ago

I agree, I don't seem to have understood the underlying problem... Which Eclipse version do you run on?

danieleb2000 commented 2 years ago

Issue persistent on both the following Eclipse versions:

Eclipse IDE for C/C++ Developers 2019-06 (4.12.0) Eclipse IDE for C/C++ Developers (includes Incubating components) Version: 2021-03 (4.19.0)

hallvard commented 2 years ago

I need stack traces to be able to debug this, do you find that in the Error Log view?

danieleb2000 commented 2 years ago

I need stack traces to be able to debug this, do you find that in the Error Log view?

What should I search for? I have only 3 entries in the Error Log, none of them is related to Plantuml stuff.

danieleb2000 commented 2 years ago

I need stack traces to be able to debug this, do you find that in the Error Log view?

I got the following 3 errors in the Error Log view:

0) org.eclipse.egit.ui: Warning: The environment variable HOME is not set. The following directory will be used to store the Git An exception stack trace is not available.

1) org.eclipse.ui.ide: Not properly disposed SWT resource

java.lang.Error: SWT Resource was not properly disposed at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) at org.eclipse.swt.graphics.Resource.(Resource.java:120) at org.eclipse.swt.graphics.Image.(Image.java:165) at org.eclipse.swt.graphics.Image.win32_new(Image.java:2163) at org.eclipse.swt.widgets.TaskBar.createShellLink(TaskBar.java:168) at org.eclipse.swt.widgets.TaskBar.createShellLinkArray(TaskBar.java:208) at org.eclipse.swt.widgets.TaskBar.setMenu(TaskBar.java:382) at org.eclipse.swt.widgets.TaskItem.setMenu(TaskItem.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.mylyn.commons.workbench.TaskBarManager$TaskBarMenuManager.setMenuOnTaskItem(TaskBarManager.java:121) at org.eclipse.mylyn.commons.workbench.TaskBarManager$TaskBarMenuManager.update(TaskBarManager.java:112) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:673) at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.addSystemTaskBarActions(TasksUiPlugin.java:479) at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.access$7(TasksUiPlugin.java:458) at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin$TasksUiInitializationJob.runInUIThread(TasksUiPlugin.java:394) at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4001) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3629) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) 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:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1461)

2) org.eclipse.ui.ide: Not properly disposed SWT resource

java.lang.Error: SWT Resource was not properly disposed at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172) at org.eclipse.swt.graphics.Resource.(Resource.java:120) at org.eclipse.swt.graphics.Image.(Image.java:165) at org.eclipse.swt.graphics.Image.win32_new(Image.java:2163) at org.eclipse.swt.widgets.TaskBar.createShellLink(TaskBar.java:168) at org.eclipse.swt.widgets.TaskBar.createShellLinkArray(TaskBar.java:208) at org.eclipse.swt.widgets.TaskBar.setMenu(TaskBar.java:382) at org.eclipse.swt.widgets.TaskItem.setMenu(TaskItem.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.mylyn.commons.workbench.TaskBarManager$TaskBarMenuManager.setMenuOnTaskItem(TaskBarManager.java:121) at org.eclipse.mylyn.commons.workbench.TaskBarManager$TaskBarMenuManager.update(TaskBarManager.java:112) at org.eclipse.jface.action.MenuManager.update(MenuManager.java:673) at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.addSystemTaskBarActions(TasksUiPlugin.java:479) at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.access$7(TasksUiPlugin.java:458) at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin$TasksUiInitializationJob.runInUIThread(TasksUiPlugin.java:394) at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4001) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3629) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1157) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401) 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:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590) at org.eclipse.equinox.launcher.Main.run(Main.java:1461)

hallvard commented 2 years ago

I was able to trigger this error, but I'm not sure how to solve it. I'll try to find some workaround, but can't guarantee anything as class path problems are difficult to debug.

danieleb2000 commented 2 years ago

@hallvard what is the cause of the error? what is the difference with 1.1.24 which was working good?

hallvard commented 2 years ago

The problem is that the plantuml library uses reflection to get hold of the GenericDOMImplementation class, and in this case doesn't find it. Such implicit dependencies are difficult to handle... I haven't found out how to satisfy this dependency, yet.

danieleb2000 commented 2 years ago

One generical question: it is not possible just to integrate the official plantuml.jar exactly as it is and then develop around it a wrapper? Other plugins work like that (for example, the plugin for MsWord or AsciiDoc).

arnaudroques commented 2 years ago

@hallvard If there is something we can do on the core plantuml library side that may help to solve this issue, please tell us.

hallvard commented 2 years ago

The main problem here is that the dependency on GenericDOMImplementation is implicit and not provided by the plantuml.jar itself. I think I can make my wrapper provide it by adding an explicit dependency on some other bundle with that implementation, or I may be able to add it manually to the wrapper. I don't fully understand the class loading magic within eclipse, so cannot promise it will just work. If plantuml contained the GenericDOMImplementation class itself, the problem would go away, but perhaps there's some licensing issue?

danieleb2000 commented 2 years ago

Some news about this issue?