Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » Exported Product does not run ObjectTeams(How to enable ObjectTeams in an exported product (eclipse neon))
icon5.gif  Exported Product does not run ObjectTeams [message #1747265] Fri, 11 November 2016 12:46 Go to next message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
Hi,

after having solved my previous problem (project-specific settings for O/T were missing), I'm now stuck at getting O/T enabled in my exported product (eclipse neon, not yet SR1).
All required plug-ins are exported and the code for activating teams does not throw exceptions (except for one weird case).
However, it turns out that my roles are not executed. Starting the product from inside eclipse, I have to set the "enable O/T equinox" setting explicitly in the "Run Configurations" dialog.
Is there anything I have to enable for product export in eclipse neon?
IIRC in eclipse 3.* this worked out of the box.
Re: Exported Product does not run ObjectTeams [message #1747285 is a reply to message #1747265] Fri, 11 November 2016 16:36 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
In Neon your product's .ini file should mention either of:
-Dot.weaving=otre

or
-Dot.weaving=otdre


(Which one you use must match to how you compile your code).

This setting is needed for sure. I'd have to look into the code, however, to see what happens if you specify neither.

"Normally" this setting is added when you install a recent version of OT/Equinox, but obviously, that trick doesn't help for a product.

Stephan
Re: Exported Product does not run ObjectTeams [message #1747310 is a reply to message #1747285] Fri, 11 November 2016 22:16 Go to previous messageGo to next message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
Hi Stephan,

thanks a lot for your help!
I tried that by adding "-Dot.equinox=true" and "-Dot.weaving=otdre" to the vmargs section, but to no avail.
Eclipse starts up the RCP application with the following three O/T-related definitons:

-Dot.equinox=1
"-javaagent:<path-to-eclipse>\plugins\org.eclipse.objectteams.otequinox_2.5.0.201606070956\otequinoxAgent.jar"
-Dot.weaving=OTDRE

However, adding these lines also has no effect.

[Updated on: Fri, 11 November 2016 22:50]

Report message to a moderator

Re: Exported Product does not run ObjectTeams [message #1747311 is a reply to message #1747310] Fri, 11 November 2016 22:56 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
Ah, there's one more trick that otequinox performs when being installed: it set's it's own start level to 1.
Here's an extract from our p2.inf:
    org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:1); \
    org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true);


The result of this can be observed in eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info as s.t. like
org.eclipse.objectteams.otequinox,2.5.0.201606070956,file:/mybundlepool/plugins/org.eclipse.objectteams.otequinox_2.5.0.201606070956,1,true


I think a product can specify start levels for specific plug-ins, right?

Stephan


Re: Exported Product does not run ObjectTeams [message #1747421 is a reply to message #1747311] Mon, 14 November 2016 14:52 Go to previous messageGo to next message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
Stephan,
yes, one can set this in the product definition. However, this still didn't do the trick Sad
I compared the simpleconfigurator's "config.ini" files and made sure that all plugins are the same version and have the same startup run level, but still to no avail. I also updated eclipse to neon SR1, but that still doesn't help.
Re: Exported Product does not run ObjectTeams [message #1747433 is a reply to message #1747421] Mon, 14 November 2016 15:55 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
Hmmm, do you see the following message in the console?

OT/Equinox: ot.weaving=OTDRE


If yes, and still no team activation, you can add more logging using -Dotequinox.debug=OK

If the above message doesn't appear, we'd need to figure out why/how starting of the otequinox bundle fails. Are you able to drop to an OSGi shell from your product?
Re: Exported Product does not run ObjectTeams [message #1747450 is a reply to message #1747433] Mon, 14 November 2016 22:19 Go to previous messageGo to next message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
I don't see that entry Sad the debug option reveals many of the following:

!SESSION 2016-11-14 17:05:35.347 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_111
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments:  -os win32 -ws win32 -arch x86_64

!ENTRY org.eclipse.objectteams.otequinox 1 0 2016-11-14 17:05:36.687
!MESSAGE OT/Equinox: Adding OTRE import to org.eclipse.equinox.util

!ENTRY org.eclipse.objectteams.otequinox 0 0 2016-11-14 17:05:36.688
!MESSAGE OT/Equinox: About to transform Thread class org.eclipse.equinox.internal.util.impl.tpt.timer.TimerImpl

!ENTRY org.eclipse.objectteams.otequinox 1 0 2016-11-14 17:05:36.690
!MESSAGE OT/Equinox: Transformation performed on Thread class org.eclipse.equinox.internal.util.impl.tpt.timer.TimerImpl

!ENTRY org.eclipse.objectteams.otequinox 0 0 2016-11-14 17:05:36.695
!MESSAGE OT/Equinox: About to transform Thread class org.eclipse.equinox.internal.util.impl.tpt.timer.TimerQueueNode
...



Just for reference: Running from inside eclipse with debugging option enabled, log entries like these show up before the !SESSION entry:

OT/Equinox: ot.weaving=OTDRE
OT/Equinox: agentURL=bundleentry://115.fwk1016550616/otequinoxAgent.jar
OT/Equinox: Adding OTRE import to org.eclipse.equinox.registry
OT/Equinox: About to transform Thread class org.eclipse.core.internal.registry.RegistryProperties$1
OT/Equinox: Transformation performed on Thread class org.eclipse.core.internal.registry.RegistryProperties$1
OT/Equinox: registered:
	base plugin de.jexam.client.core
	adapted by aspect pluging de.jexam.client.tud.examoffice
		 team de.jexam.client.tud.examoffice.MatrikelPinTeam(NONE) super null
OT/Equinox: Scanned team class de.jexam.client.tud.examoffice.MatrikelPinTeam, found 1 base classes
...


I'll try to find some time to get an OSGi shell running in the product -- what can I do then?

[Updated on: Tue, 15 November 2016 12:23]

Report message to a moderator

Re: Exported Product does not run ObjectTeams [message #1747557 is a reply to message #1747450] Tue, 15 November 2016 22:32 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
Not seeing "OT/Equinox: ot.weaving=OTDRE" (in the console! It's a plain silly System.err.println(..)) would indicate that the otequinox bundle is not started. For this case it would be interesting to know, what the OSGi console says about this bundle. Is it resolved? Is it shown as started? If not started can it be started manually?

Mh, does your product use org.eclipse.equinox.simpleconfigurator at all? (I don't know if it's possible to run equinox without it).

Not seeing "OT/Equinox: registered:..." messages could also indicate that the extension registry is somehow dysfunctional. But if otequinox isn't even started that might be red herring.

If none of this helps, maybe enabling tracing for equinox would tell us more, see debug options like org.eclipse.osgi/debug/startlevel.
For the general mechanism see, e.g., http://www.vogella.com/tutorials/EclipsePerformance/article.html#using-the-build-in-tracing-facilities-of-eclipse

Stephan
Re: Exported Product does not run ObjectTeams [message #1748122 is a reply to message #1747557] Fri, 18 November 2016 16:49 Go to previous messageGo to next message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
Wonderful, I've got some better error message (at least I hope so...):
I ran the app from the console (with "-console -debug -consoleLog" program args) and the following comes up:

Start VM: -enableassertions
-Dfile.encoding=UTF-8
-Dot.equinox=1
-Dot.weaving=OTDRE
-Djava.class.path=***\plugins\org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
-os win32
-ws win32
-arch x86_64
-showsplash
-launcher ***.exe
-name JExam Client
--launcher.library ***\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444\eclipse_1617.dll
-startup ***\plugins\org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
--launcher.overrideVmargs
-console
-debug
-consoleLog
-vm C:\Program Files\Java\jre1.8.0_111\bin\server\jvm.dll
-vmargs
-enableassertions
-Dfile.encoding=UTF-8
-Dot.equinox=1
-Dot.weaving=OTDRE
-Djava.class.path=***\plugins\org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar
Install location:
    file:/***
Configuration file:
    file:/***/configuration/config.ini loaded
Configuration location:
    file:/*/configuration/
Framework located:
    file:/*/plugins/org.eclipse.osgi_3.11.1.v20160708-1632.jar
Framework classpath:
    file:/*/plugins/org.eclipse.osgi_3.11.1.v20160708-1632.jar
Splash location:
    *\configuration\org.eclipse.equinox.launcher\de.jexam.platform_5.1.0\splash.bmp
Debug options:
    file:/*/.options not found
Time to load bundles: 26
OT/Equinox: ot.weaving=OTDRE


So OT is activated Smile For each of my teams the following error is printed:

java.lang.UnsupportedClassVersionError: OTDRE: Class *****Team was compiled for incompatible weaving target OTRE


So I wonder if the export is somehow broken, i.e. the project specific settings are ignored then?

Just for completeness -- the plugins' states right after the app windows opens are:
org.eclipse.objectteams.eclipse.monitor (2.5.0.201606070956) "OT/Equinox Runtime Monitor" [Starting]
org.eclipse.objectteams.otequinox (2.5.1.201609131451) "Object Teams Equinox Integration" [Active]
org.eclipse.objectteams.otequinox.branding (2.5.0.201606070956) "OT/Equinox Branding Integration" [Active]
org.eclipse.objectteams.otre (2.5.0.201606070956) "Object Teams Runtime (BCEL Weaver)" [Resolved]
org.eclipse.objectteams.otredyn (1.2.0.201606070956) "Object Teams Dynamic Runtime Environment" [Resolved]
org.eclipse.objectteams.runtime (2.5.0.201606070956) "Object Teams Runtime" [Resolved]

[Updated on: Fri, 18 November 2016 16:52]

Report message to a moderator

Re: Exported Product does not run ObjectTeams [message #1748175 is a reply to message #1748122] Sun, 20 November 2016 11:19 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
Till Kolditz wrote on Fri, 18 November 2016 17:49

So I wonder if the export is somehow broken, i.e. the project specific settings are ignored then?


How do you export your product? Via export wizard? Using Maven/tycho?

You may want to add this line to "build.properties" in all projects using OT/J:
javacProjectSettings=true


Similarly (additionally?) the tycho-compiler-plugin accepts
<useProjectSettings>true</useProjectSettings>


HTH,
Stephan
Re: Exported Product does not run ObjectTeams [message #1748182 is a reply to message #1748175] Sun, 20 November 2016 21:10 Go to previous messageGo to next message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
Thanks a million!!!! I'm exporting via the export wizard and that additional line in the build.properties really did the trick!
Re: Exported Product does not run ObjectTeams [message #1748224 is a reply to message #1748182] Mon, 21 November 2016 11:33 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1636
Registered: July 2009
Senior Member
That's good news! Thanks for confirming.

Now I just need to find a place where this info should be documented for the future...

Stephan
Re: Exported Product does not run ObjectTeams [message #1748229 is a reply to message #1748224] Mon, 21 November 2016 12:21 Go to previous message
Till Kolditz is currently offline Till KolditzFriend
Messages: 9
Registered: August 2016
Junior Member
Maybe OTD could inform or even enforce that setting to be made?
Do I guess correctly, that it's basically the flag which is set when enabling "project specific settings" for the base Java compiler?
Previous Topic:Lifting and Roles - Graph Product Line example
Next Topic:transient roles as a design option for performance?
Goto Forum:
  


Current Time: Tue Oct 23 06:58:01 GMT 2018

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

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

Back to the top