You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Marcin Bazydlo <ma...@cs.put.poznan.pl> on 2012/07/19 14:11:54 UTC
How to run embedding example
Hi!
Despite looking through mailing list archives and Internet I cannot
solve very simple thing - running embedded felix example from
http://felix.apache.org/site/apache-felix-application-demonstration.html
or http://svn.apache.org/repos/asf/felix/trunk/examples/servicebased.host.
I followed exactly the steps from documentation
(http://felix.apache.org/site/apache-felix-application-demonstration.html).
I have compiled and build the project. I can even run it from the felix
shell started externally (java -jar bin/felix.jar -b
/home/gondar/workspace/java/felix-example/).
Simply I cannot run it in the embedded mode.
I get following error:
gondar@feather:~/workspace/java/felix-example$ java -jar
servicebased.host-1.0.0.jar file:/servicebased.circle-1.0.0.jar
file:/servicebased.square-1.0.0.jar file:/servicebased.triangle-1.0.0.jar
Welcome to My Launcher
======================
Exception in thread "main" java.lang.NoClassDefFoundError:
org/osgi/framework/launch/FrameworkFactory
at
org.apache.felix.example.servicebased.host.launch.Application.createFramework(Application.java:103)
at
org.apache.felix.example.servicebased.host.launch.Application.main(Application.java:79)
Caused by: java.lang.ClassNotFoundException:
org.osgi.framework.launch.FrameworkFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 2 more
gondar@feather:~/workspace/java/felix-example$
Any idea what is true reason for this error, and how can I solve it?
I see it cannot find framework class, but I have no idea how to provide
it to the program?
Best regards,
m.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: How to run embedding example
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Yes. I just fixed this in trunk, so "svn up" and you should be fine now.
-> richard
On 7/19/12 12:50 , Chetan Mehrotra wrote:
> Hi Marcin,
>
> Looks there is some issue with the pom.xml of the servicebased.host
> project. It has a dependency entry of Felix Source Try changing
>
> <dependency>
> <groupId>org.apache.felix</groupId>
> <artifactId>org.apache.felix.main</artifactId>
> <version>4.0.2</version>
> <type>zip</type>
> <classifier>source-release</classifier>
> </dependency>
>
> to
>
> <dependency>
> <groupId>org.apache.felix</groupId>
> <artifactId>org.apache.felix.main</artifactId>
> <version>4.0.2</version>
> </dependency>
>
> In the <felix root>/examples/servicebased.host/pom.xml and use the
> resultant jar in Launch command
>
> Chetan Mehrotra
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org
Re: How to run embedding example
Posted by Chetan Mehrotra <ch...@gmail.com>.
Hi Marcin,
Looks there is some issue with the pom.xml of the servicebased.host
project. It has a dependency entry of Felix Source Try changing
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
<version>4.0.2</version>
<type>zip</type>
<classifier>source-release</classifier>
</dependency>
to
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
<version>4.0.2</version>
</dependency>
In the <felix root>/examples/servicebased.host/pom.xml and use the
resultant jar in Launch command
Chetan Mehrotra