archi-contribs / specialization-plugin

Plugin for Archi to specialize concepts (figure, icon...)
Other
29 stars 2 forks source link

2.0.0.alpha doesn't work with Archi 4.5.1 #40

Closed kvaleev closed 3 years ago

kvaleev commented 4 years ago

When I updated Archi to the latest version 4.5.1, the 2.0.0.alpha version of the specialization plugin (2.0.0.alpha1.jar) causes the error java.lang.NullPointerException when I try to add a new element to a model.

The whole error log:

!SESSION 2019-09-16 13:53:13.845 -----------------------------------------------
eclipse.buildId=unknown
java.version=11.0.3
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_RU
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -clean

This is a continuation of log file /Users/user/Library/Application Support/Archi4/.metadata/.bak_0.log
Created Time: 2019-09-16 13:53:49.914

!ENTRY org.eclipse.ui 4 0 2019-09-16 13:53:49.914
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
    at org.archicontribs.specialization.propertysections.SpecializationModelSection.getSelectedClass(SpecializationModelSection.java:1177)
    at org.archicontribs.specialization.types.ElementSpecializationMap.getElementSpecialization(ElementSpecializationMap.java:132)
    at org.archicontribs.specialization.SpecializationPlugin.drawIcon(SpecializationPlugin.java:905)
    at org.archicontribs.specialization.uiProvider.elements.figures.ApplicationComponentFigure.drawIcon(ApplicationComponentFigure.java:22)
    at com.archimatetool.editor.diagram.figures.elements.ApplicationComponentFigure.drawFigure(ApplicationComponentFigure.java:46)
    at com.archimatetool.editor.diagram.figures.AbstractContainerFigure.paintFigure(AbstractContainerFigure.java:93)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1118)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1209)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
    at org.eclipse.draw2d.ScalableFreeformLayeredPane.paintClientArea(ScalableFreeformLayeredPane.java:60)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1200)
    at org.eclipse.draw2d.Viewport.paintClientArea(Viewport.java:160)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
    at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
    at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
    at org.eclipse.draw2d.DeferredUpdateManager.paint(DeferredUpdateManager.java:168)
    at org.eclipse.draw2d.LightweightSystem.paint(LightweightSystem.java:203)
    at org.eclipse.draw2d.LightweightSystem$2.handleEvent(LightweightSystem.java:110)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4363)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1520)
    at org.eclipse.swt.widgets.Control.drawWidget(Control.java:1278)
    at org.eclipse.swt.widgets.Canvas.drawWidget(Canvas.java:175)
    at org.eclipse.swt.widgets.Widget.drawRect(Widget.java:776)
    at org.eclipse.swt.widgets.Canvas.drawRect(Canvas.java:169)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:6005)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:5254)
    at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5683)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
    at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:97)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
    at org.eclipse.jface.window.Window.open(Window.java:799)
    at com.archimatetool.editor.actions.AboutHandler.execute(AboutHandler.java:25)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:96)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:320)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:254)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
    at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:156)
    at org.eclipse.core.commands.Command.executeWithChecks(Command.java:497)
    at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:490)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:195)
    at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.runCommand(CocoaUIHandler.java:651)
    at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler.access$5(CocoaUIHandler.java:637)
    at org.eclipse.e4.ui.workbench.renderers.swt.cocoa.CocoaUIHandler$3.widgetSelected(CocoaUIHandler.java:509)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4363)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1512)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1535)
    at org.eclipse.swt.widgets.Widget.sendSelectionEvent(Widget.java:1585)
    at org.eclipse.swt.widgets.MenuItem.sendSelection(MenuItem.java:595)
    at org.eclipse.swt.widgets.Display.windowProc(Display.java:5800)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
    at org.eclipse.swt.widgets.Display.applicationNextEventMatchingMask(Display.java:5254)
    at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5683)
    at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
    at org.eclipse.swt.internal.cocoa.NSApplication.nextEventMatchingMask(NSApplication.java:97)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
    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:566)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
    at com.archimatetool.editor.Application.start(Application.java:84)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
    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(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.base/java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
herve91 commented 4 years ago

Hi,

I know... The Archi developers changed a Java class in Archi 4.5 and I need to adapt all my plugins to the new class. I am concentrating to the database plugin at the moment and will adapt the specialization plugin asap.

Best regards Hervé

daniel-kruger commented 4 years ago

Has this been resolved yet ? Getting the same error with Archi 4.6.0.

herve91 commented 4 years ago

to be honest, I haven't had much time and confinement did not arrange ...

Archi 4.7 introduces the ability to change objects label (using the same variables I created in my plugin). Would this suit your needs ?

https://www.archimatetool.com/downloads/beta/change-log.txt

kvaleev commented 4 years ago

Would this suit your needs ?

Archi 4.7 supports changing labels but unfortunately doesn't support icon replacement.

sudr commented 3 years ago

Hmm...this one has been open for a while. If you can point me to the code and pointers on how to solve this I can take a stab at it and submit a PR.

Phillipus commented 3 years ago

@herve91

Hi Herve, another thing that changed in Archi 4.7.1 is that the Figure classes changed to implement the com.archimatetool.editor.diagram.figures.ITextFigure Java Interface.

Unfortunately, this means that your Figure classes in this plug-in don't inherit from the new Archi ones, so that an error is thrown if a user has this plug-in installed and also uses Archi's Label Expressions. See https://github.com/archimatetool/archi/issues/685

Just a heads up, really. The way to solve this would be to recompile your plug-in against the latest Archi code.

Regards,

Phil

herve91 commented 3 years ago

Hi Phil,

Yes, I know there is an incompatibility of my plugin with version 4.7. I'll give priority to this :)

Best regards Hervé

herve91 commented 3 years ago

Done.

Could you please test the alpha2 release ?

Best regards Hervé

sudr commented 3 years ago

Just did and in my limited testing (entering text into a note element) I wasn't able to reproduce the issue. So it appears that the issue has been fixed.

herve91 commented 3 years ago

Great, I close the case then.

Best regards Hervé