Hello, in the last days I tried to build a Java App that embedds Felix and gets build by Maven2. When starting the app outside eclipse in console, I got the error:
ERROR: Unable to start system bundle. (java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set) java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set ... I then found out that: on Site: http://static.springsource.org/osgi/docs/1.2.0-rc1/reference/html/spring-osgi-faq.html#incomplete-osgi-jar -> When doing integration testing I receive java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set... Remove the official OSGi jars (osgi.jar or osgi-r4-core.jar) from the classpath and use only the actual OSGi platform (Equinox/Knopflerfish/Felix) jars. The former provides only the public classes without an actual implementation and thus cannot be used during runtime, only during the compilation stage. Then Karls advice helped me very much. I learned that when ever you want to embedd felix, just look at org.apache.felix.main Project, its the best sample to start Felix embedded, because main is the starter for framework. Meanwhile I found a solution: 1. take org.apache.felix.framework as maven dependency 2. Embedd felix jar using maven-bunde-plugin ( <Embed-Dependency>*;artifactId=org.apache.felix.framework;inline=true</Embed-Dependency> in instructions Tag ) 3. to minimize Framework dependencies the Felix Starting-class one should use Packages like: org.osgi.framework.BundleActivator org.osgi.framework.launch.Framework org.osgi.framework.launch.FrameworkFactory and not Felix' special Packages Then the Felix embedded tutorial does work proper with maven2. I just wanted to tell, because before it took some days for me getting felix and osgi to work with maven. Perhaps someone will save time now. regards Matthias 2010/5/14 Karl Pauls <[email protected]> > > Just have a look at our main launcher (trunk/main). It does pretty > much what you are trying to do. > > regards, > > Karl > > On Fri, May 14, 2010 at 12:38 AM, Elliot Huntington > <[email protected]> wrote: > > Hello Felix Users, > > > > I've been following the examples at > > http://felix.apache.org/site/apache-felix-framework-launching-and-embedding.html. > > I've found the caveat listed at the end very important. ;) > > > > I'm brand new to Felix/OSGi so I'm having trouble accomplishing my > > goal. Basically, all I want to do is create a simple maven project > > that will produce an executable jar file that when clicked will launch > > Felix and any bundles that it finds. > > > > For example given this directory stucture: > > > > /app > > |- my_felix_app.jar > > |- /bundles > > |--|- bundle1.jar > > |--|- bundle2.jar > > > > I want to be able to run the my_felix_app.jar and have that launch > > Felix and run the code in the 2 bundles. > > > > Does anyone have a bare bones application that does something like > > this already they could share with me? > > > > Thanks, > > Elliot > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > > > -- > Karl Pauls > [email protected] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

