Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » ClassNotFoundException when running ESH tests
ClassNotFoundException when running ESH tests [message #1718113] Sat, 19 December 2015 22:40 Go to next message
Dominic Lerbs is currently offline Dominic LerbsFriend
Messages: 15
Registered: June 2015
Junior Member
When I run the launch file in various test packages, I get ClassNotFoundExceptions.

the binding.hue.test, config.core.test or the core.thing.test package, I get the following exception:

core.thing.test package:
!ENTRY org.eclipse.osgi 4 0 2015-12-19 22:25:34.544
!MESSAGE Could not find bundle: org.eclipse.equinox.console
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
	at org.eclipse.core.runtime.internal.adaptor.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:58)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:333)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:232)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

follwed by a ClassNotFoundException like this for every test in the package:
Class not found org.eclipse.smarthome.core.thing.events.ThingEventFactoryTest
java.lang.ClassNotFoundException: org.eclipse.smarthome.core.thing.events.ThingEventFactoryTest cannot be found by org.eclipse.smarthome.core.thing_0.8.0.qualifier
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)

See here for the complete log.

config.core.test package:
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.smarthome.test [101]
  Unresolved requirement: Import-Package: org.eclipse.smarthome.core.autoupdate

	at org.eclipse.osgi.container.Module.start(Module.java:434)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.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-12-20 00:29:59.627
!MESSAGE Bundle initial@reference:file:../../../../../git/smarthome/bundles/test/org.eclipse.smarthome.test/ was not resolved.
Class not found org.eclipse.smarthome.config.core.test.ConfigurationTest
java.lang.ClassNotFoundException: org.eclipse.smarthome.config.core.test.ConfigurationTest cannot be found by org.eclipse.smarthome.config.core_0.8.0.qualifier
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)


hue.test package:
!ENTRY org.eclipse.equinox.ds 1 0 2015-12-20 00:22:01.487
!MESSAGE Could not bind a reference of component ConfigStatusService. The reference is: Reference[name = ConfigStatusProvider, interface = org.eclipse.smarthome.config.core.status.ConfigStatusProvider, policy = dynamic, cardinality = 0..n, target = null, bind = addConfigStatusProvider, unbind = removeConfigStatusProvider]
Class not found org.eclipse.smarthome.binding.hue.test.HueBridgeHandlerOSGiTest
java.lang.ClassNotFoundException: org.eclipse.smarthome.binding.hue.test.HueBridgeHandlerOSGiTest cannot be found by org.eclipse.smarthome.binding.hue_0.8.0.qualifier
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:423)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:336)

I even created a clean installation with the Eclipse Installer but the error remains the same.

I know that I had used the hue.test launch file just some days ago, so I have no clue why it isn't working anymore.

Also, when I run mvn clean install, the build fails each time at a different component... I don't know if this is related with the first issue though,..

First run:
[INFO] Eclipse SmartHome Model Sitemap .................... FAILURE [ 37.555 s]

Second run:
[INFO] Eclipse SmartHome Model Persistence ................ FAILURE [ 19.259 s]

Third run:
[INFO] Eclipse SmartHome Model Rules Runtime .............. FAILURE [  0.859 s]

I am really confused. How can it be that the same command fails each time at a different location?

Any ideas or suggestion how I could solve or debug these issues?

[Updated on: Sat, 19 December 2015 23:33]

Report message to a moderator

Re: ClassNotFoundException when running ESH tests [message #1718115 is a reply to message #1718113] Sat, 19 December 2015 23:24 Go to previous messageGo to next message
Dominic Lerbs is currently offline Dominic LerbsFriend
Messages: 15
Registered: June 2015
Junior Member
Okay, second issue (mvn clean install) solved by deleting folder ~.m2\repository\p2 as suggested in some ticket on github.
First issue with executing launch file of test cases remains though...

EDIT (as I cannot add another reply here?):
Crazy, as soon as you do what's written in the documentation for testing ("clicking on Add Required Plug-Ins"), it is suddenly working Smile
With this, all my issues are resolved. I will create a PR to update the lanuch files.

[Updated on: Sun, 20 December 2015 10:00]

Report message to a moderator

Re: ClassNotFoundException when running ESH tests [message #1718187 is a reply to message #1718115] Mon, 21 December 2015 07:18 Go to previous messageGo to next message
Andre Fuechsel is currently offline Andre FuechselFriend
Messages: 28
Registered: December 2015
Junior Member

Normally, if you do an "Add Required Plugins" the missing dependencies are resolved using the current target platform in your Eclipse and all open projects in your workspace. As this might be different for each developer, it is always a good idea to use "Add Required Plugins" before executing the launch config. The launch config in the project is merely a starting point for your tests.
Re: ClassNotFoundException when running ESH tests [message #1718199 is a reply to message #1718187] Mon, 21 December 2015 09:03 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
> it is always a good idea to use "Add Required Plugins" before executing the launch config

From my experience, this button is usually a bad idea as it adds far too many things and it often ends up in a big mess.
What is right is that the launch configs are only a starting point - it is not easily possible to keep them up-to-date, so we rather neglect them and whoever wants to run these tests from within the IDE should adjust them for his purposes.
Re: ClassNotFoundException when running ESH tests [message #1718202 is a reply to message #1718199] Mon, 21 December 2015 09:19 Go to previous messageGo to next message
Dominic Lerbs is currently offline Dominic LerbsFriend
Messages: 15
Registered: June 2015
Junior Member
Hi,

thanks for the explanation. I wasn't aware that it is so difficult to have a working/up-to-date launch file. So I assume I'll just use the "Add Required Plugins" button but don't commit the launch file afterwards.
Actually the "Add Required Plugins" worked only for the hue.test package, for the others it didn't resolve the issues (not important for me now as I was only interested in the hue binding).

@Kai: Thanks for deleting my triple post... I assume I couldn't see them initially because they were waiting for moderation? I couldn't even see my edit to the second post. Would be nice to at least get a message after posting what's going on Smile But I guess this is not under your control...
Re: ClassNotFoundException when running ESH tests [message #1718208 is a reply to message #1718202] Mon, 21 December 2015 10:36 Go to previous message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
> I assume I couldn't see them initially because they were waiting for moderation?

No, they were not even in the moderation queue, they simply took long to be processed. I have the same issue from time to time: I am posting something and cannot see my post in the forum. Seems to be a "eventually-consistent" strategy in the forum database Smile
Previous Topic:How can I remove the Thing in Binding?
Next Topic:Additional Channel Categories
Goto Forum:
  


Current Time: Fri Mar 29 15:57:45 GMT 2024

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

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

Back to the top