Squash TM - Development

zuhri
Messages : 9
Inscription : jeu. oct. 02, 2014 3:38 am

Squash TM - Development

Message par zuhri »

Hi,

I followed this tutorial (http://goo.gl/AvEURu) and I'm a bit lost with the instructions:

(1) From the instructions:
[color=#0000bb]you can import :
[ol]
[li][color=#0000bb]The root module[/color][/li]
[li][color=#0000bb]tm/tm.web[/color][/li]
[li][color=#0000bb]tm/tm.service[/color][/color][/li]

[/ol][b]Q[/b]: Which one is the [color=#0000bb]root module?[/color] [i][u]tm [/u][/i]or [i][u]squashtest-tm[/u][/i]? So far I've only accessed tm/tm.web and tm/tm.service, and if you go down a bit further, you'll find the instructions saying:[color=#0000bb][i] "projects you've imported in Eclipse : core.service, core.web, tm.service and tm.web" [/i][/color]; I can't find core.service and core.web; are they needed? These are the folders that I downloaded:
[attachment=230]Eclipse1.png[/attachment]

(2) JDK path:
-vm
/bin/javaw.exe

[b]Q[/b]: Should this be something like this?: C:/Program Files (x86)/Java/jdk1.8.0/bin/javaw.exe
(mind the above is not an EE SDK; more of a normal Java SDK.

(3) [b]Q[/b]: Where can I find: [color=#0000bb]org.springframework.osgi.web.extender[/color]; I think this is one of the imports from squashtest-tm but I'm not sure which one.

(4)
org.springframework.osgi.web.extender : 5
[color=#0000bb]the rest : 4[/color]

[b]Q[/b]: Do we have to set [u][b]all of[/b][/u] the rest to 4 or can we just leave it blank?

(5) From the instructions it says: [color=#0000bb]"Tick/untick the boxes to activate/deactivate the bundles you need. In particular, check that no bundle is activated twice - none should be ticked in both the 'Workspace' and 'Platform' section at the same time"[/color]. To run Squash, which bundle should I tick? Also, how do you mean by "[color=#0000bb]none should be ticked in both the 'Workspace and 'Platform' section[/color]"?
Pièces jointes
Eclipse1.png
Eclipse1.png (2.23 Kio) Consulté 3179 fois
Avatar de l’utilisateur
gregfqt
Messages : 41
Inscription : lun. nov. 14, 2011 3:22 pm

Squash TM - Development

Message par gregfqt »

Hi,

[quote="zd" post=3657]
[/ol]Q: Which one is the [color=#0000bb]root module?[/color] [u]tm [/u]or [u]squashtest-tm[/u]?
[/quote]

That would be "squashtest-tm"


[quote="zd" post=3657]
So far I've only accessed tm/tm.web and tm/tm.service, and if you go down a bit further, you'll find the instructions saying:[color=#0000bb] "projects you've imported in Eclipse : core.service, core.web, tm.service and tm.web" [/color]; I can't find core.service and core.web; are they needed?
[/quote]

The doco was outdated, "core.web" and "core.service" no longer exist, you can ignore them.


[quote="zd" post=3657]
(2) JDK path:
-vm
/bin/javaw.exe

Q: Should this be something like this?: C:/Program Files (x86)/Java/jdk1.8.0/bin/javaw.exe
(mind the above is not an EE SDK; more of a normal Java SDK.
[/quote]

That's right but I'm afraid you won't be able to start the app with java 8. There's a bug in the embedded jsp compiler (3rd party library) which does not support java 8 yet.


[quote]
(3) Q: Where can I find: [color=#0000bb]org.springframework.osgi.web.extender[/color];
[/quote]

This is no longer needed.


[quote]
(4)
org.springframework.osgi.web.extender : 5
[color=#0000bb]the rest : 4[/color]

Q: Do we have to set [u]all of[/u] the rest to 4 or can we just leave it blank?
[/quote]

Leave it blank, provided your "default start level" is higher than 3


[quote]
(5) From the instructions it says: [color=#0000bb]"Tick/untick the boxes to activate/deactivate the bundles you need. In particular, check that no bundle is activated twice - none should be ticked in both the 'Workspace' and 'Platform' section at the same time"[/color]. To run Squash, which bundle should I tick? Also, how do you mean by "[color=#0000bb]none should be ticked in both the 'Workspace and 'Platform' section[/color]"?[/quote]
[/quote]

When you open your OSGi run config, the bundles are separated into 2 sections : workspace and target platform.
The bundles which are ticked in the workspace section will be resolved... from the workspace.
On the other hand, the ones in the target platform section will be resolved from the binaries (the jars) in provision/eclipse-provision/bundles

When a bundle is resolved from the binaries, any modification in the source code will not be available in the binaries until you "re-provision" the platform by running maven on the "provision" module. This should only be done when eclipse is turned off, otherwise you will end up with corrupted jars.

If you check a bundle in both sections, the osgi container will try to start it twice. The app may start, yet you do not know if you're runniong the code from your workspace or from the binary.

Grégory
zuhri
Messages : 9
Inscription : jeu. oct. 02, 2014 3:38 am

Squash TM - Development

Message par zuhri »

(6) I also realised that my tm.service folder contains no errors but my tm.web has some errors in them e.g. "Plugin execution not covered by lifecycle configurations: net.jangaroo:smartspirit". There are also errors on the src folder (>main>webapp>jsp, tags and web.xml), test folder and WEB-INF folder inside the tm.web
I notice as well that though my tm.service does appear on the workspace list (under the Run Cofig. module), the tm.web does not.
zuhri
Messages : 9
Inscription : jeu. oct. 02, 2014 3:38 am

Squash TM - Development

Message par zuhri »

OK, so here are my steps:

(1) I used Eclipse JEE Luna 64 and here's my javaw.exe's path:


(2) Here's the explorer before I added the squashtest-tm folder:
[attachment=232]ECLIPSE2.png[/attachment]

(3) Here's my Groovy version:
[attachment=233]ECLIPSE3.png[/attachment]

After this, I closed Eclipse and ran "mvn clean install -DskipTests" on Squashtest-tm3 folder and provision folder, and they were all built fine.

Then I opened Eclipse and imported one-by-one:
(1) tm/tm-service
(2) tm/tm-web
(3) squashtest-tm3

tm/tm-service seems fine but tm/tm-web has these errors:
[attachment=234]ECLIPSE4.png[/attachment]

[attachment=235]ECLIPSE5.png[/attachment]

After importing squashtest-tm3:

[attachment=236]ECLIPSE6.png[/attachment]

Here's how I removed aspectj from tm-service:

[attachment=237]ECLIPSE7.png[/attachment]

After this I closed eclipse and did a mvn - install inside the provision folder; the build was fine.

Opened Eclipse back and proceeded with the Equinox configuration:

[attachment=238]ECLIPSE9.png[/attachment]

Pièces jointes
ECLIPSE9.png
ECLIPSE9.png (14.25 Kio) Consulté 3179 fois
ECLIPSE7.png
ECLIPSE7.png (31.24 Kio) Consulté 3179 fois
ECLIPSE6.png
ECLIPSE6.png (18.67 Kio) Consulté 3179 fois
ECLIPSE5.png
ECLIPSE5.png (110.61 Kio) Consulté 3179 fois
ECLIPSE4.png
ECLIPSE4.png (138.87 Kio) Consulté 3179 fois
ECLIPSE3.png
ECLIPSE3.png (66.88 Kio) Consulté 3179 fois
ECLIPSE2.png
ECLIPSE2.png (15.06 Kio) Consulté 3179 fois
zuhri
Messages : 9
Inscription : jeu. oct. 02, 2014 3:38 am

Squash TM - Development

Message par zuhri »

[attachment=239]ECLIPSE9_2015-02-18.png[/attachment]

No tm/tm-web:

[attachment=240]ECLIPSE10.png[/attachment]

[attachment=242]ECLIPSE12.png[/attachment]

And here's after validation:

[attachment=241]ECLIPSE11.png[/attachment]

I ran, I'd get:

osgi> log4j:WARN No appenders could be found for logger (org.squashtest.csp.core.log4j.Activator).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
!SESSION 2015-02-18 23:07:19.249 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -dev file:C:/Users/Home - III/workspace/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.squashtest.tm.plugin.report.std 4 0 2015-02-18 23:07:42.949
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.squashtest.tm.plugin.report.std_1.12.0.M1-SNAPSHOT [181]" could not be resolved. Reason: Missing Constraint: Import-Package: org.squashtest.tm.service.project; version="[1.12.0,2.0.0)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.squashtest.tm.plugin.testautomation.jenkins 4 0 2015-02-18 23:07:43.245
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.squashtest.tm.plugin.testautomation.jenkins_1.12.0.M1-SNAPSHOT [209]" could not be resolved. Reason: Missing Constraint: Import-Package: org.squashtest.tm.service.testautomation; version="[1.12.0,2.0.0)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.squashtest.csp.core.log4j 4 0 2015-02-18 23:07:43.245
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Exception in org.squashtest.csp.core.log4j.Activator.start() of bundle org.squashtest.csp.core.log4j.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.io.FileNotFoundException: C:\Users\Home - III\workspace\\provision\target\config\services\log4j.properties (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at java.io.FileReader.(Unknown Source)
at org.squashtest.csp.core.log4j.Activator.start(Activator.java:57)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
... 12 more
Root exception:
java.io.FileNotFoundException: C:\Users\Home - III\workspace\\provision\target\config\services\log4j.properties (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at java.io.FileReader.(Unknown Source)
at org.squashtest.csp.core.log4j.Activator.start(Activator.java:57)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.squashtest.tm.web 4 0 2015-02-18 23:07:44.641
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.squashtest.tm.web_1.12.0.M1-SNAPSHOT [218]" could not be resolved. Reason: Missing Constraint: Import-Package: org.squashtest.tm.service.advancedsearch; version="[1.12.0,2.0.0)"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.squashtest.tm.service 4 0 2015-02-18 23:07:44.656
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The bundle "org.squashtest.tm.service_1.12.0.M1-SNAPSHOT [288]" could not be resolved. Reason: Missing Constraint: Import-Package: org.squashtest.tm.service.advancedsearch; version="0.0.0"
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1311)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:323)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2015-02-18 23:07:45.281
!MESSAGE Bundle initial@reference:file:plugin.report.std-1.12.0.M1-SNAPSHOT.jar/ was not resolved.

!ENTRY org.eclipse.osgi 4 0 2015-02-18 23:07:45.281
!MESSAGE Bundle initial@reference:file:plugin.testautomation.jenkins-1.12.0.M1-SNAPSHOT.jar/ was not resolved.

!ENTRY org.eclipse.osgi 4 0 2015-02-18 23:07:45.281
!MESSAGE Bundle org.squashtest.csp.core.log4j_1.12.0.M1-SNAPSHOT [217] is not active.

!ENTRY org.eclipse.osgi 4 0 2015-02-18 23:07:45.281
!MESSAGE Bundle initial@reference:file:tm.web-1.12.0.M1-SNAPSHOT.war/ was not resolved.

!ENTRY org.eclipse.osgi 4 0 2015-02-18 23:07:45.281
!MESSAGE Bundle initial@reference:file:../../../../tm/tm.service/target/classes/ was not resolved.
Pièces jointes
ECLIPSE12.png
ECLIPSE12.png (25.51 Kio) Consulté 3179 fois
ECLIPSE11.png
ECLIPSE11.png (10.04 Kio) Consulté 3179 fois
ECLIPSE10.png
ECLIPSE10.png (29.62 Kio) Consulté 3179 fois
ECLIPSE9_2015-02-18.png
ECLIPSE9_2015-02-18.png (14.25 Kio) Consulté 3179 fois
zuhri
Messages : 9
Inscription : jeu. oct. 02, 2014 3:38 am

Squash TM - Development

Message par zuhri »

[quote="zd" post=3669]OK, so here are my steps:

(1) I used Eclipse JEE Luna 64 and here's my javaw.exe's path:

[/quote]


[attachment=243]ECLIPSE1.png[/attachment]
Pièces jointes
ECLIPSE1.png
ECLIPSE1.png (69.42 Kio) Consulté 3179 fois
Avatar de l’utilisateur
gregfqt
Messages : 41
Inscription : lun. nov. 14, 2011 3:22 pm

Squash TM - Development

Message par gregfqt »

1. I would not recommend importing / keeping opened the modules you don't work on because, based on our experience, eclipse + maven + osgi integration is not _that_ good

2. You have to disable aspectj nature because here abgain, based on our experience, it breaks groovy integration. The downside is that sometimes, as eclipse has no knowledge of the aspects, they won't be weaved. In that case, run mvn clean install

3. When workspace bundles are marked "out of sync" in the run configuration, you may try to refresh the projects. When they still are marked out of sync, it usually means there is an "org.eclipse.pde.*.prefs" file in the project's ".settings" folder which is messing around. Please remove it / them as stated here.[url=https://bitbucket.org/nx/squashtest-tm/ ... -workspace]here[/url]

4. What are your validation errors ? They may be caused by the "out of sync" bundles and this would explain why the app won't start

5. The maven plugins unknown to m2e should be of no consequences. Their goal is to process web assets and the app sould properly work in eclipse provided you ran maven and did not modify them afterwards.
zuhri
Messages : 9
Inscription : jeu. oct. 02, 2014 3:38 am

Squash TM - Development

Message par zuhri »

[quote="gregfqt" post=3708]1. I would not recommend importing / keeping opened the modules you don't work on because, based on our experience, eclipse + maven + osgi integration is not _that_ good [/quote]

Actually I'm confused with this one; other than tm/tm.web and tm/tm.service, what other necessary modules do I need to add from the root folder for Squash to run? Do I actually need to add the root folder?

I also don't really know if I actually need to add the root folder really; if I added the root folder first (i.e. squashtest-tm), wouldn't that actually duplicate tm/tm.web and tm/tm.service folders if you add these two afterwards? I attached a screen capture for this:

[attachment=249]dup.png[/attachment]


And, if I added the root folder first in Eclipse and later the two folders, Eclipse will warn me that the two folders are already inside the root folder; so what I did was I added the two folders first, then I added the root folder.

I tried running Squash with only tm.service and tm.web first and it gave me errors, as you'll see below. (Running using the root module together with tm.service and tm.web can be found below as well)


[quote="gregfqt" post=3708]
2. You have to disable aspectj nature because here abgain, based on our experience, it breaks groovy integration. [/quote]

I captured a screen capture for this one (it's on the prior post); would the steps be enough? I just right click on the tm.service folder and selected Remove AspectJ Capability.


[quote="gregfqt" post=3708]
The downside is that sometimes, as eclipse has no knowledge of the aspects, they won't be weaved. In that case, run mvn clean install [/quote]

How do you mean? AspectJ is not detected? How could I know if it's not detected? Should I run the command you mentioned on the root folder and then remove the AspectJ Capability like I mentioned before?


[quote="gregfqt" post=3708]
3. When workspace bundles are marked "out of sync" in the run configuration, you may try to refresh the projects. When they still are marked out of sync, it usually means there is an "org.eclipse.pde.*.prefs" file in the project's ".settings" folder which is messing around. Please remove it / them as stated here.[url=https://bitbucket.org/nx/squashtest-tm/ ... -workspace]here[/url] [/quote]

These are the .pde files:

[attachment=247]pdefile.png[/attachment]

I deleted them, restarted Eclipse, clicked on refresh but nothing happened (i.e. I still get some error symbols on each folder)


[quote="gregfqt" post=3708]
4. What are your validation errors ? They may be caused by the "out of sync" bundles and this would explain why the app won't start [/quote]

If I only use tm.service and tm.web, then I won't get any validation errors. If I used the root folder, tm.service and tm.web, I'll get this error:


[attachment=250]validationerror.png[/attachment]



[quote="gregfqt" post=3708]
5. The maven plugins unknown to m2e should be of no consequences. Their goal is to process web assets and the app sould properly work in eclipse provided you ran maven and did not modify them afterwards.[/quote]

Assuming that I only used tm.service and tm.web and run them, this happened:

[i]osgi> log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
!SESSION 2015-02-26 08:35:48.016 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.7.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -dev file:C:/Users/Z/workspace7/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.squashtest.csp.core.log4j 4 0 2015-02-26 08:36:00.029
!MESSAGE FrameworkEvent ERROR
!STACK 0[/i]

.
.
.

[i]Root exception:
java.io.FileNotFoundException: C:\Users\Z\workspace7\\provision\target\config\services\log4j.properties (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at java.io.FileReader.(Unknown Source)
at org.squashtest.csp.core.log4j.Activator.start(Activator.java:57)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

[b]!ENTRY org.eclipse.osgi 4 0 2015-02-26 08:36:00.793
!MESSAGE Bundle org.squashtest.csp.core.log4j_1.12.0.M1-SNAPSHOT [100] is not active.[/b][/i]

___________________________________________________

Now, lets say I added the root folder and try running it again (if I added the root folder, some new .pde files are generated so I deleted them and restarted Eclipse as well:

[attachment=248]pdefile2.png[/attachment]

For the validation error:

[attachment=250]validationerror.png[/attachment]

Here's the bundles configurations (the rest I left it blank):

[attachment=251]bundles.png[/attachment]

And the output after running:

[i]osgi> log4j:WARN No appenders could be found for logger (org.eclipse.jetty.util.log).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
!SESSION 2015-02-26 09:07:09.797
eclipse.buildId=unknown
java.version=1.7.0_60
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -dev file:C:/Users/Z/workspace7/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.squashtest.csp.core.log4j 4 0 2015-02-26 09:07:18.130
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The activator org.squashtest.csp.core.log4j.Activator for bundle org.squashtest.csp.core.log4j is invalid
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.ClassNotFoundException: org.squashtest.csp.core.log4j.Activator
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:164)
... 12 more
Root exception:
java.lang.ClassNotFoundException: org.squashtest.csp.core.log4j.Activator
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:164)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1131)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)

!ENTRY org.eclipse.osgi 4 0 2015-02-26 09:07:18.141
!MESSAGE Bundle org.squashtest.csp.core.log4j_1.12.0.M1-SNAPSHOT [170] is not active.

!ENTRY org.eclipse.osgi 2 0 2015-02-26 09:07:18.312
!MESSAGE One or more bundles are not resolved because the following root constraints are not resolved:
!SUBENTRY 1 org.eclipse.osgi 2 0 2015-02-26 09:07:18.312
!MESSAGE Bundle initial@reference:file:../../../../core/core.jetty.boot.felix42.fragment/ was not resolved.
!SUBENTRY 2 org.squashtest.tm.core.jetty.boot.felix42.fragment 2 0 2015-02-26 09:07:18.313
!MESSAGE Missing imported package org.eclipse.jetty.osgi.boot.utils.internal_0.0.0.

!ENTRY org.eclipse.osgi 2 0 2015-02-26 09:07:18.315
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2015-02-26 09:07:18.315
!MESSAGE Bundle org.squashtest.tm.core.jetty.boot.felix42.fragment_1.12.0.M1-SNAPSHOT [166] was not resolved.
!SUBENTRY 2 org.squashtest.tm.core.jetty.boot.felix42.fragment 2 0 2015-02-26 09:07:18.315
!MESSAGE Missing imported package org.eclipse.jetty.osgi.boot.utils.internal_0.0.0.
[/i]

Hope you'll get back to me : /
Pièces jointes
bundles.png
bundles.png (16.96 Kio) Consulté 3179 fois
validationerror.png
validationerror.png (222.76 Kio) Consulté 3179 fois
dup.png
dup.png (13.27 Kio) Consulté 3179 fois
pdefile2.png
pdefile2.png (201.82 Kio) Consulté 3179 fois
pdefile.png
pdefile.png (63.1 Kio) Consulté 3179 fois
Avatar de l’utilisateur
gregfqt
Messages : 41
Inscription : lun. nov. 14, 2011 3:22 pm

Squash TM - Development

Message par gregfqt »

[quote="zd" post=3721]
1. I would not recommend importing / keeping opened the modules you don't work on because, based on our experience, eclipse + maven + osgi integration is not _that_ good

Actually I'm confused with this one; other than tm/tm.web and tm/tm.service, what other necessary modules do I need to add from the root folder for Squash to run? Do I actually need to add the root folder?
[/quote]

I hope this will be clearer :

If you just want to [i]start [/i]the app within eclipse, you do not need to actually open any project/module.

What you need to do is :
* build the whole project (mvn clean install -DskipTests)
* build the "provision" module [b]with eclipse is turned off[/b]
* in eclipse, configure a "target platform" which points to "provision/target/..."
* then configure an osgi framework "run configuration". Uncheck everything in the "workspace" section, check everything in the "target platform" section.

When you hit "run", the app should start, using the jars you previously deployed in the "provision/target/..." directory

When the app starts this way, you can try to run the "tm.web" module from your workspace instead of the binaries by opening your run configuration, checking "tm.web" in the workspace section and unchecking the one in "target platform"



[quote="zd" post=3721]
I also don't really know if I actually need to add the root folder really; if I added the root folder first (i.e. squashtest-tm), wouldn't that actually duplicate tm/tm.web and tm/tm.service folders if you add these two afterwards? I attached a screen capture for this:

And, if I added the root folder first in Eclipse and later the two folders, Eclipse will warn me that the two folders are already inside the root folder; so what I did was I added the two folders first, then I added the root folder.
[/quote]

No, you do not need to add the root folder. It may be convenient to access some files without having to import all the submodules into eclipse (which would slow it). You may close the "root folder project" and ignore it for the moment.

[quote="zd" post=3721]
I tried running Squash with only tm.service and tm.web first and it gave me errors, as you'll see below. (Running using the root module together with tm.service and tm.web can be found below as well)


[quote="zd" post=3721]
2. You have to disable aspectj nature because here abgain, based on our experience, it breaks groovy integration.

I captured a screen capture for this one (it's on the prior post); would the steps be enough? I just right click on the tm.service folder and selected Remove AspectJ Capability.
[/quote]

Yes, you did the right thing.


[quote="zd" post=3721]
The downside is that sometimes, as eclipse has no knowledge of the aspects, they won't be weaved. In that case, run mvn clean install

How do you mean? AspectJ is not detected? How could I know if it's not detected? Should I run the command you mentioned on the root folder and then remove the AspectJ Capability like I mentioned before?
[/quote]

When running the app, you may get ClassNotFoundException or NoClassDefFoundError for classes which names end with "Aspect" if I remember correctly. This usually happens when you modify "tm.domain" or "tm.service". It means eclipse compiler (which has no knowledge of aspectj) performed a plain compilation where aspects should have been weaved.

In that case, run "mvn clean install -DskipTests" from the CLI or eclipse on these modules and "tm.web". You also neet to refresh the projects, otherwise eclipse wil ignore some files have changed.


[quote="zd" post=3721]
3. When workspace bundles are marked "out of sync" in the run configuration, you may try to refresh the projects. When they still are marked out of sync, it usually means there is an "org.eclipse.pde.*.prefs" file in the project's ".settings" folder which is messing around. Please remove it / them as stated here.[url=https://bitbucket.org/nx/squashtest-tm/ ... -workspace]here[/url]

These are the .pde files:


I deleted them, restarted Eclipse, clicked on refresh but nothing happened (i.e. I still get some error symbols on each folder)
[/quote]

From what I can see in your screen captures, there are no longer "out of sync" errors in the "workspace" section of your run configuration. What kind of errors do you have ?

[quote="zd" post=3721]
4. What are your validation errors ? They may be caused by the "out of sync" bundles and this would explain why the app won't start

If I only use tm.service and tm.web, then I won't get any validation errors. If I used the root folder, tm.service and tm.web, I'll get this error:

[/quote]

The "boot.felix42.fragment" project should not be opened when running inside eclipse. The only bundle with "felix" in its name you should have in your run configuration is "org.apache.felix.configadmin"

[quote="zd" post=3721]
Assuming that I only used tm.service and tm.web and run them, this happened:

[...]


Root exception:
java.io.FileNotFoundException: C:\Users\Z\workspace7\[b][/b]\provision\target\config\services\log4j.properties (The filename, directory name, or volume label syntax is incorrect)
[/quote]

You should review the VM args of your run configuration, there is a "" token which should be replaced by the name of the root folder of your project.

I cannot give you any more direction while this and the "felix42" problems are there.
Répondre

Revenir à « Installation & Base de données / Installation & Database »