Home » Modeling » TMF (Xtext) » Running Xtext on Karaf Felix
|
Re: Running Xtext on Karaf Felix [message #1706029 is a reply to message #1705984] |
Fri, 21 August 2015 08:42 |
|
Hi,
I heard that some guy successfully get xtext running with felix (there should be a bug report in eclipse bugzilla).
The problem that you has is described here:
https://developer.jboss.org/thread/246632
Long story short, you can not use org.eclipse.osgi bundle. We use package import ''org.osgi.framework" where possible, so the needed classes should be provided by felix. If you see some require dependency to org.eclipse.osgi please open a bug report.
+Dennis Huebner
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Re: Running Xtext on Karaf Felix [message #1706051 is a reply to message #1706029] |
Fri, 21 August 2015 12:11 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
On 2015-08-21 08:42:10 +0000, Dennis Huebner said:
> Hi,
> I heard that some guy successfully get xtext running with felix (there
> should be a bug report in eclipse bugzilla).
>
> The problem that you has is described here:
> https://developer.jboss.org/thread/246632
>
> Long story short, you can not use org.eclipse.osgi bundle. We use
> package import ''org.osgi.framework" where possible, so the needed
> classes should be provided by felix. If you see some require dependency
> to org.eclipse.osgi please open a bug report.
That's what I expected, too. That at some point it would pick up Felix'
classes, and hence resolve.
I found a bug discussion about Xtext and Concierge, which is another
OSGi framework (within Eclipse):
https://bugs.eclipse.org/bugs/show_bug.cgi?id=434490. There it is
stated that there is a dependency on org.eclipse.equinox.common and
that this bundle can run on Concierge, but as far as I could tell, it
was this bundle that caused the problem on Felix. It has the following
package imports: org.eclipse.equinox.log,
org.eclipse.osgi.framework.log, org.eclipse.osgi.service.datalocation,
org.eclipse.osgi.service.debug, org.eclipse.osgi.service.localization,
org.eclipse.osgi.service.urlconversion,org.eclipse.osgi.util,org.osgi.framework,org.osgi.service.log,
org.osgi.service.packageadmin and
org.osgi.service.url,org.osgi.util.tracker.
I would expect some of these to be provided by felix (those beginning
with org.osgi), but others, e.g. org.eclipse.osgi.framework.log, seems
to require Eclipse specific bundles and this ends up with the mentioned
conflict.
Hallvard
--
Hallvard Trætteberg (hal@xxxxxxxx.no)
Associate Professor, IS group, Dept. of Computer and Information
Science at the
Norwegian Univ. of Science and Technology
|
|
|
Re: Running Xtext on Karaf Felix [message #1706152 is a reply to message #1706051] |
Mon, 24 August 2015 08:39 |
|
Hi Hallvard,
I see what you mean. Yes, we depend on org.eclipse.equinox.common because of one used class org.eclipse.core.runtime.OperationCanceledException
As you already mentioned equinox.common depends only on org.eclipse.osgi where the problematic class org.eclipse.osgi.internal.framework.SystemBundleActivator is located.
I'm not sure how to solve the problem on our side.
I was thinking about a test setup for our test server where we can test that xtext can be used in other OSGI frameworks. Do you have an example project/setup so I can try it out?
+Dennis Huebner
Get professional support from the Xtext committers at www.typefox.io
|
|
|
Re: Running Xtext on Karaf Felix [message #1710911 is a reply to message #1705984] |
Sat, 10 October 2015 19:50 |
|
Hello,
are there any news / a resolution?
> Yes, we depend on org.eclipse.equinox.common because of one used class org.eclipse.core.runtime.OperationCanceledException
If the one exception is the only reason to depend on org.eclipse.equinox.common (that themselves depends on org.eclipse.osgi) why not using another / a self-made exception?
[Updated on: Tue, 27 October 2015 08:24] Report message to a moderator
|
|
|
Re: Running Xtext on Karaf Felix [message #1714155 is a reply to message #1706152] |
Tue, 10 November 2015 10:23 |
Hallvard Traetteberg Messages: 673 Registered: July 2009 Location: Trondheim, Norway |
Senior Member |
|
|
Hi,
I've recently revisited this issue, as I needed to demonstrate that
(the runtime part of) an application built on Eclipse could be moved
onto Karaf and deployed in the cloud. As mentioned, the issue was that
Xtext requires the org.eclipse.equinox.common bundle, and this bundle
cannot be moved to Karaf, since it depends on (an)other
Equinox-specific bundle(s).
My solution was to make a "fake" org.eclipse.equinox.common bundle
containing only the classes that Xtext actually uses. Through trial and
error, I found that two classes are needed (not one as stated below),
org.eclipse.core.runtime.OperationCanceledException and
org.eclipse.core.runtime.IProgressMonitor. I copied these into the fake
bundle and deployed it with Xtext, and it worked! By worked, I mean
that I could load DSL instances, which is what I need. I take care to
call the generated StandaloneSetup.doSetup() first, so the DSL file
extension is recognized and the correct ResourceFactory is used.
Note that my fake org.eclipse.equinox.common bundle was built outside
Eclipse with maven, or else Eclipse would think it was a replacement
for its internal one and lots of things would break. I also needed to
take care to not run "maven install", but only "maven package", since
install makes the bundle available locally and will trick Tycho into
using it instead of the real one.
Could Xtext have made it easier? The best would be if the dependency
was optional, i.e. Xtext could detect the presence without trying to
load the classes, and then only use them only if they are available.
Perhaps Xtext could provide two "glue" bundles (fragments), one for use
with Equinox and one for other frameworks? I think it also would be
better if the dependency was to a specific package, so I needn't name
the bundle the same as the original, e.g. provide a "compatibility"
bundle.
I'll gladly help you try it out, now that I have at least one
"solution" working.
Hallvard
On 2015-08-24 08:39:28 +0000, Dennis Huebner said:
> Hi Hallvard,
> I see what you mean. Yes, we depend on org.eclipse.equinox.common
> because of one used class
> org.eclipse.core.runtime.OperationCanceledException
>
> As you already mentioned equinox.common depends only on
> org.eclipse.osgi where the problematic class
> org.eclipse.osgi.internal.framework.SystemBundleActivator is located.
>
> I'm not sure how to solve the problem on our side.
>
> I was thinking about a test setup for our test server where we can test
> that xtext can be used in other OSGI frameworks. Do you have an
> example project/setup so I can try it out?
--
Hallvard Trætteberg (hal@xxxxxxxx.no)
Associate Professor, IS group, Dept. of Computer and Information
Science at the
Norwegian Univ. of Science and Technology
|
|
| | | |
Goto Forum:
Current Time: Tue Mar 19 10:39:24 GMT 2024
Powered by FUDForum. Page generated in 0.02885 seconds
|