I would not recommend using spark-rest in OSGi - its best for a single JVM only.
It has a bunch of static code that dont go well in osgi.

Use one of the others like servlet or jetty

On Tue, Sep 26, 2017 at 3:47 PM, Jared Whiklo <[email protected]> wrote:
> Hi all,
>
> I'm fairly new to Camel and very new to OSGI, but I was attempting to
> migrate a WAR deployable webapp to be a Karaf deployable feature.
>
> It seems to go well until I tried it on my staging server in which there
> are existing bundles deployed.
>
> I have narrowed it down to the spark-rest configuration. The new feature
> and one of the old both have lines like...
>
> restConfiguration().component("spark-rest").host("localhost").port(restPortNum);
>
> Here [1] and here [2].
>
> This causes one of the camel contexts to refuse to start up. If I
> comment out one of the rest endpoint configuration lines and rest routes
> then they both load.
>
> It seems to me that they should be able to both operate using different
> ports or even the same port with different paths.
>
> But I am clearly missing something simple...can anyone clue me in to it?
>
> cheers,
> jared
>
> [1]
> https://github.com/whikloj/islandora-1x-derivative-toolkit/blob/master/islandora-1x-gatekeeper/src/main/java/ca/umanitoba/dam/islandora/derivatives/gatekeeper/ImageRoutes.java#L82
> [2]
> https://github.com/uml-digitalinitiatives/islandora-1x-solr-indexer/blob/osgi-package/src/main/java/ca/umanitoba/dam/islandora/fc3indexer/FedoraSolrIndexer.java#L64
> --
> Jared Whiklo
> [email protected]
> --------------------------------------------------
> Oh, they have the Internet on computers now. -- Homer Simpson



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Reply via email to