You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Martin Kuba <ma...@ics.muni.cz> on 2007/10/04 09:19:53 UTC
examples 2b and 3 not working
Hi all,
I am working through the Felix tutorial, the examples 1 and 2
are working well, but the example2b and 3 do not start.
It produces the following output:
-> ps
START LEVEL 1
ID State Level Name
[ 0] [Active ] [ 0] System Bundle (1.0.0)
[ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.0)
[ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.0)
[ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.0.0)
[ 4] [Active ] [ 1] Service listener example (1.0.0)
[ 5] [Active ] [ 1] English dictionary (1.0.0)
-> start file:/home/makub/IdeaProjects/felixpok/example2b.jar
org.osgi.framework.BundleException: Activator start error.
at org.apache.felix.framework.Felix._startBundle(Felix.java:1579)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1469)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:348)
at org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:82)
at org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:265)
at org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:167)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.apache.felix.framework.searchpolicy.ContentClassLoader.findClass(ContentClassLoader.java:162)
at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClassFromModule(ContentClassLoader.java:51)
at org.apache.felix.framework.searchpolicy.ContentLoaderImpl.getClass(ContentLoaderImpl.java:121)
at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:374)
at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:152)
at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)
at org.apache.felix.moduleloader.ModuleImpl.getClass(ModuleImpl.java:152)
at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:3411)
at org.apache.felix.framework.Felix._startBundle(Felix.java:1530)
... 6 more
java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
and the same exception I get for example 3. I guess that it is some
class loading issue, but I follow the tutorial precisely.
The manifest for example 2b is cut-and-pasted, so it is:
Bundle-Name: French dictionary
Bundle-Description: A bundle that registers a French dictionary service
Bundle-Vendor: Apache Felix
Bundle-Version: 1.0.0
Bundle-Activator: tutorial.example2b.Activator
Import-Package: org.osgi.framework,
tutorial.example2.service
The last entry Import-Package looks suspicious, because it is not on one line,
but even when I change it to be on one line, the exception still occurs.
I am using felix 1.0.0 and Sun JDK 1.6.0 on Linux.
Anybody knows what may be wrong ?
Martin
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno Martin Kuba
Institute of Computer Science email: makub@ics.muni.cz
Masaryk University http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ mobil: +420-603-533775
--------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: more bugs in the tutorial
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Better late than never...I finally remembered to do this...thanks for
the feedback.
-> richard
Bart Elen wrote:
> When someone is updating the website: there is another typo in the
> example on page:
> http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+OSGi+Bundle+Repository+(OBR)
>
>
> resolver.deploy();
>
> must be replaced by:
>
> resolver.deploy(true);
>
>
> Greetings,
> Bart
>
> Martin Kuba wrote:
>> There are more bugs in the tutorial:
>>
>> - in the example 4 on the line 165 there is an uncaught exception
>> InvalidSyntaxException
>>
>> - in the example 5 on the line 76 the variable name shuold be m_tracker,
>> not tracker
>>
>> - in example 7 the manifest line
>> Bundle-Activator: tutorial.example6.Activator
>> should be
>> Bundle-Activator: tutorial.example7.Activator
>>
>> Martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: more bugs in the tutorial
Posted by Bart Elen <Ba...@cs.kuleuven.be>.
When someone is updating the website: there is another typo in the example on page:
http://cwiki.apache.org/confluence/display/FELIX/Apache+Felix+OSGi+Bundle+Repository+(OBR)
resolver.deploy();
must be replaced by:
resolver.deploy(true);
Greetings,
Bart
Martin Kuba wrote:
> There are more bugs in the tutorial:
>
> - in the example 4 on the line 165 there is an uncaught exception
> InvalidSyntaxException
>
> - in the example 5 on the line 76 the variable name shuold be m_tracker,
> not tracker
>
> - in example 7 the manifest line
> Bundle-Activator: tutorial.example6.Activator
> should be
> Bundle-Activator: tutorial.example7.Activator
>
> Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: more bugs in the tutorial
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Finally corrected these too. Thanks for the feedback Martin.
-> richard
Martin Kuba wrote:
> There are more bugs in the tutorial:
>
> - in the example 4 on the line 165 there is an uncaught exception
> InvalidSyntaxException
>
> - in the example 5 on the line 76 the variable name shuold be m_tracker,
> not tracker
>
> - in example 7 the manifest line
> Bundle-Activator: tutorial.example6.Activator
> should be
> Bundle-Activator: tutorial.example7.Activator
>
> Martin
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
more bugs in the tutorial
Posted by Martin Kuba <ma...@ics.muni.cz>.
There are more bugs in the tutorial:
- in the example 4 on the line 165 there is an uncaught exception
InvalidSyntaxException
- in the example 5 on the line 76 the variable name shuold be m_tracker,
not tracker
- in example 7 the manifest line
Bundle-Activator: tutorial.example6.Activator
should be
Bundle-Activator: tutorial.example7.Activator
Martin
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno Martin Kuba
Institute of Computer Science email: makub@ics.muni.cz
Masaryk University http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ mobil: +420-603-533775
--------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: examples 2b and 3 not working
Posted by Martin Kuba <ma...@ics.muni.cz>.
Karl Pauls wrote:
> Hi Martin,
>
> could you make sure you include a newline at the end of your manifest? So
>
> Bundle-Name: French dictionary
> ...
> Import-Package: org.osgi.framework,
> tutorial.example2.service <br>
> <br>
>
> The thing is that the jar tool will eat your last line if it is not
> followed by a line break. I assume that this might be the case for you
> and if so then your Import-Package would not be there -- hence, the
> NCDFE.
>
> Hope that helps.
>
> regards,
>
> Karl
Yes, that helped !
Thanks a lot.
Martin
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Supercomputing Center Brno Martin Kuba
Institute of Computer Science email: makub@ics.muni.cz
Masaryk University http://www.ics.muni.cz/~makub/
Botanicka 68a, 60200 Brno, CZ mobil: +420-603-533775
--------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: examples 2b and 3 not working
Posted by Karl Pauls <ka...@gmail.com>.
Hi Martin,
could you make sure you include a newline at the end of your manifest? So
Bundle-Name: French dictionary
...
Import-Package: org.osgi.framework,
tutorial.example2.service <br>
<br>
The thing is that the jar tool will eat your last line if it is not
followed by a line break. I assume that this might be the case for you
and if so then your Import-Package would not be there -- hence, the
NCDFE.
Hope that helps.
regards,
Karl
On 10/4/07, Martin Kuba <ma...@ics.muni.cz> wrote:
> Hi all,
>
> I am working through the Felix tutorial, the examples 1 and 2
> are working well, but the example2b and 3 do not start.
> It produces the following output:
>
> -> ps
> START LEVEL 1
> ID State Level Name
> [ 0] [Active ] [ 0] System Bundle (1.0.0)
> [ 1] [Active ] [ 1] Apache Felix Shell Service (1.0.0)
> [ 2] [Active ] [ 1] Apache Felix Shell TUI (1.0.0)
> [ 3] [Active ] [ 1] Apache Felix Bundle Repository (1.0.0)
> [ 4] [Active ] [ 1] Service listener example (1.0.0)
> [ 5] [Active ] [ 1] English dictionary (1.0.0)
> -> start file:/home/makub/IdeaProjects/felixpok/example2b.jar
> org.osgi.framework.BundleException: Activator start error.
> at org.apache.felix.framework.Felix._startBundle(Felix.java:1579)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:1469)
> at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:348)
> at org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:82)
> at org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:265)
> at org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.java:167)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> at org.apache.felix.framework.searchpolicy.ContentClassLoader.findClass(ContentClassLoader.java:162)
> at org.apache.felix.framework.searchpolicy.ContentClassLoader.loadClassFromModule(ContentClassLoader.java:51)
> at org.apache.felix.framework.searchpolicy.ContentLoaderImpl.getClass(ContentLoaderImpl.java:121)
> at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClassOrResource(R4SearchPolicyCore.java:374)
> at org.apache.felix.framework.searchpolicy.R4SearchPolicyCore.findClass(R4SearchPolicyCore.java:152)
> at org.apache.felix.framework.searchpolicy.R4SearchPolicy.findClass(R4SearchPolicy.java:45)
> at org.apache.felix.moduleloader.ModuleImpl.getClass(ModuleImpl.java:152)
> at org.apache.felix.framework.Felix.createBundleActivator(Felix.java:3411)
> at org.apache.felix.framework.Felix._startBundle(Felix.java:1530)
> ... 6 more
> java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
>
> and the same exception I get for example 3. I guess that it is some
> class loading issue, but I follow the tutorial precisely.
>
> The manifest for example 2b is cut-and-pasted, so it is:
>
> Bundle-Name: French dictionary
> Bundle-Description: A bundle that registers a French dictionary service
> Bundle-Vendor: Apache Felix
> Bundle-Version: 1.0.0
> Bundle-Activator: tutorial.example2b.Activator
> Import-Package: org.osgi.framework,
> tutorial.example2.service
>
> The last entry Import-Package looks suspicious, because it is not on one line,
> but even when I change it to be on one line, the exception still occurs.
>
> I am using felix 1.0.0 and Sun JDK 1.6.0 on Linux.
>
> Anybody knows what may be wrong ?
>
> Martin
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Supercomputing Center Brno Martin Kuba
> Institute of Computer Science email: makub@ics.muni.cz
> Masaryk University http://www.ics.muni.cz/~makub/
> Botanicka 68a, 60200 Brno, CZ mobil: +420-603-533775
> --------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
--
Karl Pauls
karlpauls@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org