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

Thanks for looking!

Well, at first I tried using the junit stuff exported directly from
org.knoppflerfish.bundle.junit (without any other junit bundle installed, of
course).

Since I was getting the CNFE, I took out all the JUnit stuff from the KF
bundle (including the export declaration) and added the Eclipse JUnit bundle
to my launch configuration, but got the same results.

More info follows (using Eclipse junit instead of KF junit)...

***********
"bundle" command on my bundle:

initial@reference:file:../dir/my-lookup-it/ [10]
  Id=10, Status=RESOLVED    Data
Root=K:\workspaces\workspace.main\.metadata\.plugins\org.eclipse.pde.core\my
-autocomplete\org.eclipse.osgi\bundles\10\data
  No registered services.
  No services in use.
  No exported packages
  Imported packages
    org.osgi.framework; version="1.3.0"<System Bundle [0]>
    org.osgi.util.tracker; version="1.3.2"<System Bundle [0]>
    net.leangen.expedition.charset;
version="1.0.0"<initial@reference:file:../dev/trunk/platform/util/charset/si
/ [2]>
    net.leangen.expedition.osgi;
version="1.0.0"<initial@reference:file:../dev/trunk/platform/osgi/api/ [4]>
    net.leangen.expedition.util.testing;
version="1.0.0"<initial@reference:file:../dev/trunk/platform/util/testing/ap
i/ [5]>
    com.company.lookup;
version="1.0.0"<initial@reference:file:../dev/trunk/offerings/lsd/lookup/si/
[11]>
    org.osgi.service.cm;
version="1.2.0"<initial@reference:file:plugins/org.eclipse.osgi.services_3.1
.100.v20060601.jar/ [13]>
    junit.framework;
version="3.8.1"<initial@reference:file:plugins/org.junit_3.8.1/ [14]>
    org.apache.commons.logging;
version="1.0.4"<initial@reference:file:J:/ops4j/projects/pax/logging/jcl/
[17]>
  No fragment bundles
  Named class space
    my_lookup_it; bundle-version="1.0.0"[provided]
  No required bundles


"ss" results:

id State       Bundle
0 ACTIVE      system.bundle_3.2.1.R32x_v20060919
1 ACTIVE      expedition_charset_impl_1.0.0
2 ACTIVE      expedition_charset_si_1.0.0
3 ACTIVE      expedition_exception_api_1.0.0
4 ACTIVE      expedition_osgi_api_1.0.0
5 ACTIVE      expedition_testing_api_1.0.0
6 ACTIVE      expedition_ui_application_api_1.0.0
7 ACTIVE      json_1.0.0
8 ACTIVE      my_autocomplete_1.0.0
9 ACTIVE      my_lookup_impl_1.0.0
10 RESOLVED    my_lookup_it_1.0.0
11 ACTIVE      my_lookup_si_1.0.0
12 ACTIVE      org.eclipse.equinox.servlet.api_1.0.0.v20060601
13 ACTIVE      org.eclipse.osgi.services_3.1.100.v20060601
14 ACTIVE      org.junit_3.8.1
15 ACTIVE      org.knopflerfish.bundle.junit_2.0.0
16 ACTIVE      org.ops4j.pax.logging.api_0.9.5.SNAPSHOT
17 ACTIVE      org.ops4j.pax.logging.jcl_0.9.5.SNAPSHOT
18 ACTIVE      org.ops4j.pax.logging.log4j_0.9.5.SNAPSHOT
19 ACTIVE      org.ops4j.pax.logging.service_0.9.5.SNAPSHOT
20 ACTIVE      org.ops4j.pax.wicket.service_1.0.0
21 ACTIVE      org.ungoverned.osgi.bundle.http_1.1.2


-----Original Message-----
From: equinox-dev-bounces@xxxxxxxxxxx
[mailto:equinox-dev-bounces@xxxxxxxxxxx]On Behalf Of Thomas Watson
Sent: 3 May 2007 22:53
To: Equinox development mailing list
Subject: Re: [equinox-dev] Problems with JUnit and CNFE



I don't see anything obviously wrong with your manifest files.  What other
bundles do you have installed?  Is it possible you got wired to the wrong
exporter of junit?  Try running with -console and then run the "bundle"
command against your bundle to see what packages it got wired to.  If you
run the "ss" command you will get a short summary of all the bundles you
have installed.

Tom



"David Leangen" <osgi@xxxxxxxxxxx>
Sent by: equinox-dev-bounces@xxxxxxxxxxx
05/02/2007 08:46 PM Please respond to
Equinox development mailing list <equinox-dev@xxxxxxxxxxx>

To<equinox-dev@xxxxxxxxxxx>
cc
Subject[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)

_______________________________________________
equinox-dev mailing list
equinox-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/equinox-dev