Building 1.0.0-SNAPSHOT fails with ClassNotFoundException on org.openhab.model.item with Eclipse Juno

858 views
Skip to first unread message

henrik.s...@gmail.com

unread,
Aug 2, 2012, 9:06:22 AM8/2/12
to ope...@googlegroups.com
Hello,

I am new to the openhab project and after having looked into it for a few days I can say that I like it very much. I was about to develop something similar to cover my own home automation needs (and get rid of current numerous Linux bash scripts), but openhab seems to already deliver most of what I need so I will base my home automation project on openhab instead. So thank you for developing this framework!

However, I am having problems building the 1.0.0-SNAPSHOT. I have downloaded the code using "hg clone https://code.google.com/p/openhab/". When I then try to run a "mvn clean install" from the openhab root I get the following error:
[ERROR] Failed to execute goal org.fornax.toolsupport:fornax-oaw-m2-plugin:3.3.0-SNAPSHOT:run-workflow (default) on project org.openhab.model.item: Workflow execution failed. -> [Help 1]

and  above that the following stack trace
[INFO] Building openHAB Model Items 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ org.openhab.model.item ---
[INFO]
[INFO] --- tycho-packaging-plugin:0.15.0:build-qualifier (default-build-qualifier) @ org.openhab.model.item ---
[INFO]
[INFO] --- tycho-packaging-plugin:0.15.0:validate-id (default-validate-id) @ org.openhab.model.item ---
[INFO]
[INFO] --- tycho-packaging-plugin:0.15.0:validate-version (default-validate-version) @ org.openhab.model.item ---
[INFO]
[INFO] --- fornax-oaw-m2-plugin:3.3.0-SNAPSHOT:run-workflow (default) @ org.openhab.model.item ---
[INFO] Fornax Model Workflow Maven2 Plugin V3.3.0-SNAPSHOT
[INFO] java.lang.NoClassDefFoundError: org/eclipse/emf/mwe2/launch/runtime/Mwe2Launcher
[INFO] Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher
[INFO]  at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[INFO]  at java.security.AccessController.doPrivileged(Native Method)
[INFO]  at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[INFO] [INFO]   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[INFO]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[INFO]  at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[INFO] Could not find the main class: org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.  Program will exit.


I found the http://fsteeg.com/2011/07/15/run-mwe2-workflows-for-xtext-2-0-in-a-tycho-build/ and https://bugs.eclipse.org/bugs/show_bug.cgi?id=355947 discussions and modified the D:\openHAB\source\openhab\bundles\model\org.openhab.model.item\META-INF\MANIFEST.MF so the mwe2 line looks like
 org.eclipse.emf.mwe2.launch;resolution:=optional;x-installation:=greedy,

I did the same for the manifest files for org.openhab.model.persistence, org.openhab.model.rule, org.openhab.model.script, and org.openhab.model.sitemap. 

But the problem still remains. 


Any clues on what to do to run a successful 1.0.0-SNAPSHOT build?


I'm on WIndows 7, 64-bit, Oracle JDK 1.6.0_29


Thanks,
Henrik Sjöstrand


Thomas Eichstädt-Engelen

unread,
Aug 2, 2012, 9:28:11 AM8/2/12
to ope...@googlegroups.com
Hi Henrik,

which maven version is installed on your machine?

Regards,

Thomas E.-E.


--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/Bg2X6OXw9_cJ.
To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.

henrik.s...@gmail.com

unread,
Aug 2, 2012, 9:56:49 AM8/2/12
to ope...@googlegroups.com, henrik.s...@gmail.com
Hello,

C:\Users\Henrik>mvn --version
Apache Maven 3.0.4 (r1232337; 2012-01-17 09:44:56+0100)
Maven home: C:\Program Files (x86)\apache-maven
Java version: 1.6.0_29, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_29\jre
Default locale: sv_SE, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

/Henrik

Thomas Eichstädt-Engelen

unread,
Aug 2, 2012, 11:05:06 AM8/2/12
to ope...@googlegroups.com
Hi,

ok! Both Kai and Me did a successful local snapshot build minutes ago so it seems to have something to do with your environment. Could you please remove you .m2 directory to force a new lib-download?

Thanks,

Thomas E.-E.


--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/1ug9wKZQK_MJ.

henrik.s...@gmail.com

unread,
Aug 3, 2012, 5:11:37 PM8/3/12
to ope...@googlegroups.com
Hi,

Success and no success... I tried the same on another Windows 7 machine and it fails with exactly the same error message (also re-downloaded the whole 1.0.0 snapshot fresh). Then I tried on a Linux box with 32-bit Sun JDK 1.7 and that worked fine. I then uninstalled my JDK 1.6 from one of the Windows 7 boxes and installed 32-bit Sun JDK 1.7 instead and tried again. Same problem as before (but a shorter error message: "Error: Could not find or load main class org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher")

So it seems the openhab repository is ok, since building on Linux works, but there definitely is some problem building on Windows. What OS do you and Kai build on? Have you tried a build on Windows recently?

Thanks,

/Henrik Sjostrand


On Thursday, August 2, 2012 5:05:06 PM UTC+2, Thomas E.-E. wrote:
Hi,

ok! Both Kai and Me did a successful local snapshot build minutes ago so it seems to have something to do with your environment. Could you please remove you .m2 directory to force a new lib-download?

Thanks,

Thomas E.-E.

To unsubscribe from this group, send email to openhab+unsubscribe@googlegroups.com.

Kai Kreuzer

unread,
Aug 3, 2012, 5:15:06 PM8/3/12
to ope...@googlegroups.com
Hi Henrik,

Thanks for the update. Thomas and I are both using MacOS, our CI server is running on Linux. My last build on a Windows machine was a couple of months ago (at that time it worked). So thanks for reporting this. If I get my hands on Windows somewhere, I might investigate the problem further; for the moment, you seem to be served :-)

Best regards,
Kai


To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/ToMi_2ft4L8J.

To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.

Thomas Eichstädt-Engelen

unread,
Aug 28, 2012, 6:51:26 AM8/28/12
to ope...@googlegroups.com
Hi,

Markus (another user) complained about the same problems. I reactivated my Win7Prof VirtualBox Image and the build worked like charm, really weird. Since i never used maven in that VM before there was no local maven repo. Could that be the difference?! You could try to remove/rename .m2-dir and restart the build but that's plain guessing ...

My environment:
* Win7Prof
* Java 1.6.0_34
* Maven 3.0.4
* tortoiseHG

Regards,

Thomas E.-E.


To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/ToMi_2ft4L8J.

To post to this group, send email to ope...@googlegroups.com.
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.

Markus

unread,
Aug 28, 2012, 2:58:04 PM8/28/12
to ope...@googlegroups.com
Still same prob with removed m2 dir.
 
My environment:
* Win7Prof 64bit
* Java 1.7.0_03
* Maven 3.0.4
To unsubscribe from this group, send email to openhab+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/openhab?hl=en.

Thomas Eichstädt-Engelen

unread,
Aug 28, 2012, 4:51:26 PM8/28/12
to ope...@googlegroups.com
my Windows is 64bit as well!

Anybody any idea?


To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/VYWMx2664i4J.

Jörg Henne

unread,
Aug 30, 2012, 4:58:43 AM8/30/12
to ope...@googlegroups.com
My build failed in the same way on W7x64, M2 3.0.4. Then I noticed, that the fornax-oaw-m2-plugin is used in a SNAPSHOT version and changed this dependency to a the release version 3.3.0. And voila: everything builds just fine. While this doesn't explain why the build is working fps some people, but not for others, it is not a great idea to rely on SNAPSHOT versions of plugins if you want stable builds.
Was there a specific reason why the release version isn't used or was it just that the release wasn't available when the poms were crafted?

Thomas Eichstädt-Engelen

unread,
Aug 30, 2012, 6:36:36 AM8/30/12
to ope...@googlegroups.com
Hi Jörg,

many thanks for investigating this!

Markus, can you confirm changing from SNAPSHOT to release makes your build work as well?

Regards,

Thomas E.-E.


On Aug 30, 2012, at 10:58 AM, Jörg Henne wrote:

My build failed in the same way on W7x64, M2 3.0.4. Then I noticed, that the fornax-oaw-m2-plugin is used in a SNAPSHOT version and changed this dependency to a the release version 3.3.0. And voila: everything builds just fine. While this doesn't explain why the build is working fps some people, but not for others, it is not a great idea to rely on SNAPSHOT versions of plugins if you want stable builds.
Was there a specific reason why the release version isn't used or was it just that the release wasn't available when the poms were crafted?

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/blhq4NQNkVsJ.

Thomas Eichstädt-Engelen

unread,
Aug 30, 2012, 6:58:51 AM8/30/12
to ope...@googlegroups.com
anyhow, i have updated the version to 3.3.0 release on default branch!


Begin forwarded message:

Jörg Henne

unread,
Aug 30, 2012, 7:18:23 AM8/30/12
to ope...@googlegroups.com, thomas.eichs...@gmx.net
Thanks, Thomas!

Kai Kreuzer

unread,
Aug 30, 2012, 3:15:49 PM8/30/12
to ope...@googlegroups.com
Was there a specific reason why the release version isn't used or was it just that the release wasn't available when the poms were crafted?

Yes, at the time when I set up this build there was no release version available of this plugin, so I had no choice but to use the snapshot.

Regards,
Kai

HenrikS

unread,
Aug 30, 2012, 5:09:13 PM8/30/12
to ope...@googlegroups.com
Hello,

I can confirm as well that this problem is solved. I just did a successful build on the same Win 7 machine as the original problem (1st post in this thread) was found on.

/Henrik

Markus

unread,
Aug 30, 2012, 5:21:32 PM8/30/12
to ope...@googlegroups.com
I'm not sure if I got the same error as before, but after wiping the m2 dir and doing a mvn clean install I got:
 

[INFO] Fornax Model Workflow Maven2 Plugin V3.3.0-SNAPSHOT
[INFO] Fehler: Hauptklasse org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher konnte nicht gefunden oder geladen werden
[ERROR] ExitStatusException occurred while running workflow: Java returned: 1
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] openHAB ........................................... SUCCESS [10.265s]
[INFO] openHAB Bundles ................................... SUCCESS [0.125s]
[INFO] openHAB Core Components ........................... SUCCESS [0.078s]
[INFO] openHAB Core ...................................... SUCCESS [25.911s]
[INFO] openHAB Core Library .............................. SUCCESS [0.687s]
[INFO] openHAB Core Scheduler Service .................... SUCCESS [0.593s]
[INFO] openHAB Configurations ............................ SUCCESS [0.046s]
[INFO] openHAB Configuration Core ........................ SUCCESS [0.406s]
[INFO] openHAB Core Script Engine ........................ SUCCESS [0.499s]
[INFO] openHAB Models .................................... SUCCESS [0.063s]
[INFO] openHAB Model Core ................................ SUCCESS [0.608s]
[INFO] openHAB Model Items ............................... FAILURE [15.584s]
 
...
 
[INFO] openHAB Distribution .............................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7:37.110s
[INFO] Finished at: Thu Aug 30 22:18:35 CEST 2012
[INFO] Final Memory: 106M/254M
[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.fornax.toolsupport:fornax-oaw-m2-plugin:3.3.0-SNAPSHOT:run-workflow (default) on project org.openhab.model.item: Workflow execution failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :org.openhab.model.item

Kai Kreuzer

unread,
Aug 31, 2012, 2:13:50 AM8/31/12
to ope...@googlegroups.com
Have you made sure to do an hg pull and update? Your build should then be a openHAB 1.1.0-SNAPSHOT build. Your log also still refers to the SNAPSHOT version of the plugin.

Regards,
Kai

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To view this discussion on the web visit https://groups.google.com/d/msg/openhab/-/wpKaxhOnImsJ.

Markus

unread,
Aug 31, 2012, 11:56:49 AM8/31/12
to ope...@googlegroups.com
Unfortunately I'm not that familiar with the dev environment at this point, but I'm willing to learn ;-) I did a "hg clone" on a fresh system, thinking that the complete repository is copied to my pc again?

Kai

unread,
Aug 31, 2012, 12:08:27 PM8/31/12
to ope...@googlegroups.com
Unfortunately I'm not that familiar with the dev environment at this point, but I'm willing to learn ;-) I did a "hg clone" on a fresh system, thinking that the complete repository is copied to my pc again?

This sounds absolutely correct.
Could you please check if the file bundles/model/org.openhab.model.item/pom.xml references the fornax plugin in version "3.3.0" and not "3.3.0-SNAPSHOT"?

So I have no idea, how it could still use the snapshot one in your build...

Markus

unread,
Sep 2, 2012, 2:55:31 PM9/2/12
to ope...@googlegroups.com
The problem was my fault, I've used the wrong repository. Everything seems to build fine now. Thanks to everyone involved!

Kirk McCann

unread,
Aug 10, 2013, 8:06:54 PM8/10/13
to ope...@googlegroups.com
How did you resolve the issue?  I also see a parent requirement of 1.3.0-SNAPSHOT when I look at the pom xml file, but the plugin format says 3.3.0 like it should.  I'm trying to build on centos 6.4. 

Thanks,
Kirk
Reply all
Reply to author
Forward
0 new messages