The “mistake” here isn’t really a mistake, it is simply a misunderstanding of 
what the output of the enRoute application archetype is. 

The application created by enRoute is a stand-alone jar that is designed to be 
run using java -jar. It is not an OSGi bundle, but instead a Java application 
containing a basic launcher, an OSGi framework and the bundles resolved in your 
bndrun file. 

As the application is not a bundle it does not have OSGi metadata. Therefore 
when you install this Jar file into Karaf it is treated by Felix as an OSGi R3 
bundle (extremely old, don’t bother researching) with no imports, exports, or 
behaviour of any kind. It will sit there inert, unable to do anything. 

If you want to package your application to run in Karaf then you will need to 
follow  instructions from Karaf to create an application using one of their 
proprietary packaging mechanisms. This would effectively be an alternative to 
the enRoute application archetype with a different kind of output. You can 
still use the bundles you’ve written using the enRoute archetypes, but you’ll 
have to make sure that Karaf provides the necessary runtime features to support 
you, such as a DS 1.4 implementation. 

I hope this helps to clear things up.

Best Regards,

Tim

Sent from my iPhone

> On 3 Jun 2018, at 18:09, Kevin Boyle via osgi-dev <osgi-dev@mail.osgi.org> 
> wrote:
> 
> 
> Microservices
> 
> Microservices
> OSGi Alliance
> This tutorial is Maven and command-line based; the reader may follow this 
> verbatim or use their favorite Java IDE.
> 
> 
> I followed the instructions and was able to get the example working using the 
> 
> java -jar rest-app/target/rest-app.jar
> 
> However when I installed in karaf, it didnt work and I didnt see anything 
> start in the logs
> I used 
> 
> install file: 
> file:/Users/kevintboyle/dev/osgi_enroute/microservice/rest-app/target/rest-app.jar
>  
> 
> Karaf installed and assigned a karaf-id to the process
> 
> 269 | Active   |  80 |                                    | 
> file:/Users/kevintboyle/dev/osgi_enroute/microservice/rest-app/target/rest-app.jar
> 
> 
> however when I go to the url nothing appears.
> 
> What am I doing wrong?
> 
> K
> 
> 
> _______________________________________________
> OSGi Developer Mail List
> osgi-dev@mail.osgi.org
> https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to