Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Papyrus Compare problems with RCP based on 2019-12
Papyrus Compare problems with RCP based on 2019-12 [message #1819575] Fri, 17 January 2020 13:43 Go to next message
Oliver Gardiner is currently offline Oliver GardinerFriend
Messages: 50
Registered: May 2014
Location: Oxford, UK
Member
I've recently updated our RCP based on Papyrus to pull in the latest 2019-12 release. The one problem I now have is that Papyrus Compare is failing when I open a compared model. Looking at the workspace log, it looks as though there may be an issue with versions of Guava between EMF Compare (3.3.9) and Papyrus Compare (Nightly 20191104). The log is below:

!ENTRY org.eclipse.emf.compare.ide.ui 4 0 2020-01-17 13:17:14.110
!MESSAGE org.eclipse.core.runtime.CoreException: Plug-in "org.eclipse.papyrus.compare.uml2" was unable to instantiate class "org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusPostProcessor".
!STACK 0
java.lang.RuntimeException: org.eclipse.core.runtime.CoreException: Plug-in "org.eclipse.papyrus.compare.uml2" was unable to instantiate class "org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusPostProcessor".
at org.eclipse.emf.compare.rcp.extension.PluginClassDescriptor.createInstance(PluginClassDescriptor.java:70)
at org.eclipse.emf.compare.rcp.internal.postprocessor.PostProcessorDescriptor.getPostProcessor(PostProcessorDescriptor.java:79)
at org.eclipse.emf.compare.rcp.internal.postprocessor.PostProcessorRegistryImpl.getPostProcessors(PostProcessorRegistryImpl.java:136)
at org.eclipse.emf.compare.EMFCompare.compare(EMFCompare.java:226)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer.compareInputChanged(EMFCompareStructureMergeViewer.java:1599)
at org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.EMFCompareStructureMergeViewer$CompareInputChangedJob.run(EMFCompareStructureMergeViewer.java:224)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.core.runtime.CoreException: Plug-in "org.eclipse.papyrus.compare.uml2" was unable to instantiate class "org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusPostProcessor".
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:212)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:206)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:929)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
at org.eclipse.emf.compare.rcp.extension.PluginClassDescriptor.createInstance(PluginClassDescriptor.java:68)
... 6 more
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind(Lorg/eclipse/emf/compare/DifferenceKind;)Lcom/google/common/base/Predicate;" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/eclipse/papyrus/compare/uml2/internal/postprocessor/PapyrusPostProcessor, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, org/eclipse/emf/compare/utils/EMFComparePredicates, have different Class objects for the type com/google/common/base/Predicate used in the signature
at org.eclipse.papyrus.compare.uml2.internal.postprocessor.PapyrusPostProcessor.<clinit>(PapyrusPostProcessor.java:86)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:204)
... 10 more

As far as I can make out, the Class files for (Guava) Predicate in the call to the EMF "ofKind" method are different, which I assume means that they've been compiled against different versions of Guava.

My RCP build doesn't (any more) directly pull in EMF Compare so it gets pulled in as a dependency of Papyrus Compare - not sure if bumping EMF Compare down to 3.3.8 would fix it (for now) but no idea how I would do this.

Any help very gratefully received!

Thanks,

Oliver
Re: Papyrus Compare problems with RCP based on 2019-12 [message #1819576 is a reply to message #1819575] Fri, 17 January 2020 14:02 Go to previous messageGo to next message
Thomas Wiman is currently offline Thomas WimanFriend
Messages: 83
Registered: June 2012
Location: Stockholm , Sweden
Member

I can confirm that I have the same issue with Eclipse 2019-12 and Papyrus 4.6. I will rollback to Eclipse 2019-06 and Papyrus 4.4.

/Thomas
Re: Papyrus Compare problems with RCP based on 2019-12 [message #1819686 is a reply to message #1819576] Tue, 21 January 2020 12:26 Go to previous messageGo to next message
Philip Langer is currently offline Philip LangerFriend
Messages: 99
Registered: March 2015
Location: Vienna, Austria
Member

Hi Oliver,
hi Thomas,

thanks for the notification!

EMF Compare upgraded its Guava dependency. I remember that we decided to wait with upgrading Papyrus Compare so that we don't break compatibility with the last few Papyrus releases.
Now it looks like the recent two Papyrus versions are also compatible with the newer Guava version, so we could upgrade Papyrus Compare's Guava dependency as well while still supporting at least the last two Papyrus versions.

We'll look into that in the next couple of weeks. Please be aware that this upgrade will likely break compatibility with Papyrus <= 2019-06.

Thanks and best wishes,

Philip


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Papyrus Compare problems with RCP based on 2019-12 [message #1821553 is a reply to message #1819686] Fri, 14 February 2020 16:15 Go to previous messageGo to next message
Oliver Gardiner is currently offline Oliver GardinerFriend
Messages: 50
Registered: May 2014
Location: Oxford, UK
Member
Would it be feasible to simply change the EMF Compare dependency instead? It looks like it's set to pull in any version of EMF Compare between 3.0.0 and 4.0.0. I have made a platform that works by excluding Papyrus Compare from the Tycho build and then manually installed it into the 2019-12 environment by adding and enabling (only) the repositories for Papyrus Compare and Eclipse 2019-09. That way the install doesn't get to see the 3.3.9 version of EMF Compare and pulls in 3.3.8 instead. If you went down that route then presumably you wouldn't break the build for earlier versions?
Re: Papyrus Compare problems with RCP based on 2019-12 [message #1821561 is a reply to message #1821553] Fri, 14 February 2020 18:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Your original problem is

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind(Lorg/eclipse/emf/compare/DifferenceKind;)Lcom/google/common/base/Predicate;"

which demonstrates that com/google/common/base/Predicate is part of the PI and consequently any uber-application that mixes Guava versions, perhaps one from Xtext, another from Papyrus, another from ... is going to be VERY fragile since you may find that the 'wrong' Guava has already loaded the class.

I suggest to raise a bug to the effect that the Guava class be removed from all APIs.

If Guava is only used in trivial fashion such as Iterables.size(), then mixing and matching Guava versions is not a problem.

OCL and QVTd leave the Guava version unspecified leaving it to Xtext to make a selection. Consequently Guava variation has been very little prpblem for OCL;only one breakage when a deprecated method vanished almost without notice. TRivially fixed by adding a local utility method clone.

See https://bugs.eclipse.org/bugs/show_bug.cgi?id=437107 for discussion of the Guava nightmare.

I'm not an expert on RCP, but I suggest that you force a very specific Guava version so that you discover immediately what your incompatibilities are.

Regards

Ed Willink
Re: Papyrus Compare problems with RCP based on 2019-12 [message #1821695 is a reply to message #1821561] Tue, 18 February 2020 18:23 Go to previous messageGo to next message
Oliver Gardiner is currently offline Oliver GardinerFriend
Messages: 50
Registered: May 2014
Location: Oxford, UK
Member
Alas, was premature in thinking that installing Papyrus Compare against EMFCompare 3.3.8 was working in 2019-12 - you can reject changes ok but accepting changes throws an error:

org.eclipse.papyrus.infra.core.services.ServiceNotFoundException: No service registered under 'interface org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor'

Am now running two builds, one for editing (as 2019-12 fixes some very apparent issues) and one for comparing/merging.
Re: Papyrus Compare problems with RCP based on 2019-12 [message #1823162 is a reply to message #1821695] Fri, 20 March 2020 15:00 Go to previous message
Philip Langer is currently offline Philip LangerFriend
Messages: 99
Registered: March 2015
Location: Vienna, Austria
Member

Hi Oliver,

btw, this error below comes from Papyrus and doesn't affect Papyrus Compare. Afaik it also doesn't affect the functionality of Papyrus.

org.eclipse.papyrus.infra.core.services.ServiceNotFoundException: No service registered under 'interface org.eclipse.papyrus.infra.ui.editor.IMultiDiagramEditor'


I hope this helps,

Philip


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:Papyrus Activity Diagram Creation via API
Next Topic:Papyrus SysML Tutorial
Goto Forum:
  


Current Time: Fri Mar 29 07:38:46 GMT 2024

Powered by FUDForum. Page generated in 0.03398 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top