Problems when DS are referencing org.eclipse.core.resources [message #1758789] |
Mon, 03 April 2017 07:23  |
Eclipse User |
|
|
|
Hey guys,
sometimes we have declarative services where we want to reference classes of org.eclipse.core.resources (e.g. IProject) in the service interface.
If we do this, this leads to the following exception in our application:
!ENTRY com.logicals.ptk 2 0 2017-04-03 08:48:59.652
!MESSAGE [SCR] Exception occurred while getting method 'register' of class com.logicals.ptk.logging.PlatformToolkitLoggerRegistry
Details:
Problematic reference = Reference[name = PlatformToolkitLoggerFactory, interface = com.logicals.ptk.logging.PlatformToolkitLoggerFactory, policy = dynamic, cardinality = 1..n, target = null, bind = register, unbind = unregister]
of service component = com.logicals.ptk.RegisterPTKLoggerRegistry
component implementation class = com.logicals.ptk.logging.PlatformToolkitLoggerRegistry
located in bundle with symbolic name = com.logicals.ptk
bundle location = reference:file:plugins/com.logicals.ptk_1.98.0.201704022143.jar
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/core/resources/IProject
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethod(Class.java:2128)
at org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentReference.java:104)
at org.eclipse.equinox.internal.ds.model.ComponentReference.bind(ComponentReference.java:331)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bindReference(ServiceComponentProp.java:444)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.bind(ServiceComponentProp.java:218)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:343)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.buildNewlySatisfied(Resolver.java:473)
at org.eclipse.equinox.internal.ds.Resolver.enableComponents(Resolver.java:217)
at org.eclipse.equinox.internal.ds.SCRManager.performWork(SCRManager.java:816)
at org.eclipse.equinox.internal.ds.SCRManager$QueuedJob.dispatch(SCRManager.java:783)
at org.eclipse.equinox.internal.ds.WorkThread.run(WorkThread.java:89)
Is there a way to tell our application that org.eclipse.core.resources has to be loaded, before the declarative services are loaded and registered?
Thanks for any help! =)
|
|
|
|
Re: Problems when DS are referencing org.eclipse.core.resources [message #1768160 is a reply to message #1759427] |
Fri, 14 July 2017 08:47   |
Eclipse User |
|
|
|
Hi Brian,
yes there is an error in the log:
Caused by: java.lang.IllegalStateException: The instance data location has not been specified yet.
at org.eclipse.core.internal.runtime.DataArea.assertLocationInitialized(DataArea.java:54)
at org.eclipse.core.internal.runtime.DataArea.getStateLocation(DataArea.java:124)
at org.eclipse.core.internal.runtime.InternalPlatform.getStateLocation(InternalPlatform.java:539)
at org.eclipse.core.runtime.Plugin.getStateLocation(Plugin.java:289)
at org.eclipse.core.internal.resources.LocalMetaArea.<init>(LocalMetaArea.java:59)
at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:459)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779)
at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772)
... 101 more
Can we do something about that? At the time we are always avoiding to use IResource and IProject and so on in our Declarative Services, but I think this is not the solution, right?
I think there has to be some other solution.
Thank you for your help. =)
|
|
|
|
Powered by
FUDForum. Page generated in 0.03515 seconds