[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Problems with JUnit and CNFE

Hello!

I'm trying to use a JUnit plugin I found in the KF bundle repository to run
JUnit tests from within the osgi framework. I am able to install the plugin
and get it in an ACTIVE state from within Eclipse.

However, no matter what I try, I keep getting CNFE for junit.framework
classes from within my consuming bundle.


Is there anything "special" I need to consider in the Eclipse environment? I
can't seem to figure out why I can't import the classes, though I've tried
many approaches.


Thanks for any hints!
(More info below)

******************
Manifest for my bundle:

Bundle headers:
 Bundle-Activator = com.company.Activator
 Bundle-ClassPath = .
 Bundle-Localization = plugin
 Bundle-ManifestVersion = 2
 Bundle-Name = test_bundle
 Bundle-SymbolicName = test_bundle
 Bundle-Version = 1.0.0
 Import-Package =
junit.framework;version="3.8.1",org.apache.commons.logging;provider=paxloggi
ng;version="[1.0.4,1.1.0)",org.osgi.framework;version="[1.3.0,2.0.0)",org.os
gi.service.cm;version="[1.2.0,2.0.0)",org.osgi.util.tracker;version="[1.3.0,
2.0.0]"
 Manifest-Version = 1.0

Manifest for the JUnit bundle:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.2
Created-By: 1.4.2_10-b03 (Sun Microsystems Inc.)
Bundle-ManifestVersion: 2
Bundle-Name: JUnit
Bundle-SymbolicName: org.knopflerfish.bundle.junit
Bundle-Version: 2.0.0
Bundle-UUID: org.knopflerfish:junit:2.0.0
Bundle-Category: service
Bundle-Description: JUnit support
Bundle-Vendor: JUnit/Knopflerfish
Bundle-APIVendor: JUnit
Bundle-DocURL: https://www.knopflerfish.org/svn/knopflerfish.org/trunk
 /osgi/bundles_opt/junit/readme.txt
Bundle-ContactAddress: http://www.knopflerfish.org
Bundle-SubversionURL: https://www.knopflerfish.org/svn/knopflerfish.or
 g/trunk/osgi/bundles_opt/junit/
Bundle-Activator: org.knopflerfish.bundle.junit.Activator
Bundle-Classpath: .,junit.jar
DynamicImport-Package: org.knopflerfish.service.console,javax.servlet,
 javax.servlet.http,org.osgi.service.http
Export-Package: org.knopflerfish.service.junit;specification-version=1
 .0.0,junit.framework;specification-version=3.8.1
Import-Package: org.osgi.framework,org.osgi.util.tracker,org.knopflerf
 ish.service.junit;specification-version=1.0.0,junit.framework;specifi
 cation-version=3.8.1
Build-Date: Wed June 28 2006, 13:35:36
Built-From: /home/jan/work/build/knopflerfish.org/osgi/bundles_opt/jun
 it/junit


Nested Exception:
java.lang.NoClassDefFoundError: junit/framework/TestCase
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(Default
ClassLoader.java:160)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathMa
nager.java:498)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(Classpath
Manager.java:468)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(Clas
spathManager.java:427)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(Classpat
hManager.java:410)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(Defa
ultClassLoader.java:188)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleL
oader.java:334)
	at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(Singl
eSourcePackage.java:37)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader
.java:374)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader
.java:347)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultCl
assLoader.java:83)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(Default
ClassLoader.java:160)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathMa
nager.java:498)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(Classpath
Manager.java:468)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(Clas
spathManager.java:427)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(Classpat
hManager.java:410)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(Defa
ultClassLoader.java:188)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleL
oader.java:334)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader
.java:386)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader
.java:347)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultCl
assLoader.java:83)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
	at
com.company.MyServiceTracker.startOrStopService(MyServiceTracker.java:85)
	at com.company.MyServiceTracker.addingService(MyServiceTracker.java:70)
	at
org.osgi.util.tracker.ServiceTracker$Tracked.trackAdding(ServiceTracker.java
:1014)
	at
org.osgi.util.tracker.ServiceTracker$Tracked.trackInitialServices(ServiceTra
cker.java:875)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:282)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:221)
	at com.company.Activator.onStart(Activator.java:29)
	at
net.leangen.expedition.osgi.AbstractActivator.start(AbstractActivator.java:5
8)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleConte
xtImpl.java:991)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(Bu
ndleContextImpl.java:985)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleConte
xtImpl.java:966)
	at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.j
ava:317)
	at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle
.java:256)
	at
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(Fra
meworkCommandProvider.java:239)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute
(FrameworkCommandInterpreter.java:145)
	at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(Framewor
kConsole.java:293)
	at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkC
onsole.java:278)
	at
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConso
le.java:213)
	at java.lang.Thread.run(Thread.java:595)