You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by asookazian2 <as...@gmail.com> on 2014/12/04 23:29:45 UTC

Using Spring with Karaf 3.x

We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
which use Spring.  Mainly for dependency injection and possibly some
templates (e.g. JdbcTemplate, etc.) and AOP.

Anyways, looks like there are no Spring (or Spring dm?) examples here:
https://github.com/cschneider/Karaf-Tutorial and there are no Spring
examples in the Apache Karaf Cookbook.

Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
find some examples?

"I stopped using spring on OSGi a long time ago."

http://stackoverflow.com/questions/24595900/invalid-bundle-when-starting-apache-karaf



--
View this message in context: http://karaf.922171.n3.nabble.com/Using-Spring-with-Karaf-3-x-tp4036977.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Using Spring with Karaf 3.x

Posted by Charlie Mordant <cm...@gmail.com>.
Hi,

You can always use spring 'third parties' like Spring-security,
Spring-data, Spring-jms, etc... But without spring namespaces. These
modules are just pojos after all...

I would add some nice framework to use:
* Pax-JDBC for datasource management
* Aries JPA/JTA for transaction and persistence.
* ActiveMQ for Messaging.

Regards,

2014-12-05 9:06 GMT+01:00 Christian Schneider <ch...@die-schneider.net>:

> Like Achim and JB wrote Springsource does not really support OSGi anymore.
> So my intention in avoiding any spring dm examples was to make sure I do
> not lead people
> on a way that then ends abruptly.
>
> Christian
>
>
> On 04.12.2014 23:29, asookazian2 wrote:
>
>> We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
>> which use Spring.  Mainly for dependency injection and possibly some
>> templates (e.g. JdbcTemplate, etc.) and AOP.
>>
>> Anyways, looks like there are no Spring (or Spring dm?) examples here:
>> https://github.com/cschneider/Karaf-Tutorial and there are no Spring
>> examples in the Apache Karaf Cookbook.
>>
>> Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
>> find some examples?
>>
>> "I stopped using spring on OSGi a long time ago."
>>
>> http://stackoverflow.com/questions/24595900/invalid-
>> bundle-when-starting-apache-karaf
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.
>> com/Using-Spring-with-Karaf-3-x-tp4036977.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
> --
> Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> http://www.talend.com
>
>


-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Using Spring with Karaf 3.x

Posted by Christian Schneider <ch...@die-schneider.net>.
Like Achim and JB wrote Springsource does not really support OSGi anymore.
So my intention in avoiding any spring dm examples was to make sure I do 
not lead people
on a way that then ends abruptly.

Christian

On 04.12.2014 23:29, asookazian2 wrote:
> We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
> which use Spring.  Mainly for dependency injection and possibly some
> templates (e.g. JdbcTemplate, etc.) and AOP.
>
> Anyways, looks like there are no Spring (or Spring dm?) examples here:
> https://github.com/cschneider/Karaf-Tutorial and there are no Spring
> examples in the Apache Karaf Cookbook.
>
> Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
> find some examples?
>
> "I stopped using spring on OSGi a long time ago."
>
> http://stackoverflow.com/questions/24595900/invalid-bundle-when-starting-apache-karaf
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Using-Spring-with-Karaf-3-x-tp4036977.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Using Spring with Karaf 3.x

Posted by Achim Nierbeck <bc...@googlemail.com>.
Well afaik spring itself doesn't care any longer for OSGi and from Spring 4
on it's not supported in any way.
It's always been more of a hassle to have it working with OSGi I guess.

That's why there is no real good example for its usage. People usually
switch to blueprint, DS or other frameworks.

TBH. every now and then I have to use Spring for a project and I regret it
every time.



2014-12-04 23:29 GMT+01:00 asookazian2 <as...@gmail.com>:

> We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
> which use Spring.  Mainly for dependency injection and possibly some
> templates (e.g. JdbcTemplate, etc.) and AOP.
>
> Anyways, looks like there are no Spring (or Spring dm?) examples here:
> https://github.com/cschneider/Karaf-Tutorial and there are no Spring
> examples in the Apache Karaf Cookbook.
>
> Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
> find some examples?
>
> "I stopped using spring on OSGi a long time ago."
>
>
> http://stackoverflow.com/questions/24595900/invalid-bundle-when-starting-apache-karaf
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Using-Spring-with-Karaf-3-x-tp4036977.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Using Spring with Karaf 3.x

Posted by Charlie Mordant <cm...@gmail.com>.
Awesome Achim!
As always, you're doing marvelous things :).
Can't wait for Karaf 4 !

Regards, Charlie

2014-12-05 9:41 GMT+01:00 Achim Nierbeck <bc...@googlemail.com>:

> Nice one Charlie,
> with the next version of Pax Web it'll be also possible to use the
> Websocket JSR-356 annotations without a single Servlet.
> Just make sure you have the right Web-ContextPath manifest header in your
> application.
> For anyone interested give the latest Pax Web 4.1 a try together with the
> websocket sample of Pax Web [1].
> FYI I also did a summary of what's next at [2]
>
> regards, Achim
>
> [1] -
> https://github.com/ops4j/org.ops4j.pax.web/tree/master/samples/websocket-jsr356
> [2] - http://notizblog.nierbeck.de/2014/12/pax-web-4-1-whats-next/
>
> 2014-12-05 9:35 GMT+01:00 Charlie Mordant <cm...@gmail.com>:
>
>> As an addition to Christian,
>> I also made a full stack sample with CDI and an other for blueprint:
>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.samples
>> It manipulates REST, JPA, JTA, JMS, Websocket.
>>
>> I also made a little CDI bridge for CXF that let's you expose REST
>> webservices with an @CXFEndpoint annotation.
>>
>>
>>
>> 2014-12-05 9:26 GMT+01:00 Christian Schneider <ch...@die-schneider.net>:
>>
>>>  The problem is that we do not yet have some clear winners in the OSGi
>>> space of enterprise frameworks.
>>> Each of the current approaches has some advantages and shortcomings.
>>>
>>> Dependency injection:
>>>
>>> For DI the most mature for enterprise is currently blueprint. The major
>>> deciding factor there is that it supports jpa and jta which is needed in
>>> almost any enterprise application. Blueprint also has good support for CXF
>>> (SOAP and REST) and Camel. I personally would prefer the CDI approach but
>>> it is not yet fully mature in OSGi.
>>>
>>> Achim did a nice example that shows how to use CDI on karaf
>>> See https://github.com/ANierbeck/karaf-enterprise-sample
>>> The only downside is that he had to use blueprint for the jpa part but
>>> that just reflects the state of CDI support.
>>>
>>> I am also working on an enterprise example here:
>>> https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-cdi
>>>
>>> It also uses CDI annotations in the java code. I use a aries maven
>>> plugin to generate blueprint from the annotations. So as a developer you
>>> can work a lot like in CDI but have the stable blueprint below. The
>>> downside here is that the maven plugin only supports a very small subset of
>>> CDI. Still you can already do a lot with it.
>>>
>>> So maybe the ideal way here would be to combine the two approaches. Use
>>> CDI annotations for all layers. Use the maven plugin for the persistence
>>> layer and mayebe also for rest services (backed by blueprint) and real CDI
>>> for the other layers.
>>>
>>> Security:
>>>
>>> For security I would go for plain JAAS for the most part. There is a
>>> JAAS Feature in CXF that allows a really simple way to enable basic auth in
>>> CXF services. It establishes a JAAS security context. Then there is the
>>> blueprint authz extension that allows to use JEE security annotations like
>>> @RolesAllowed in your business code. Unfortunately there is not much
>>> documentation about it. I will have to write some reference and examples
>>> for it.
>>> In any case my advice for security is to just use JAAS and rather avoid
>>> the bigger frameworks. They all kind of tie you to their own APIs.
>>>
>>> Rest:
>>> For REST services CXF is the natural choice as it is very well supported
>>> in karaf. Unfortunately there is no CDI integration available but there is
>>> good support for blueprint.
>>>
>>> Christian
>>>
>>>
>>>
>>> On 05.12.2014 08:26, Kim Hansen wrote:
>>>
>>> Hi!
>>>
>>> I'm fairly new to Karaf and it would be really awesome if someone really
>>> deep into Karaf and/or OSGi could suggest what frameworks and APIs to use
>>> with Karaf 4 to create applications with the following technologies (and
>>> not use Spring at all):
>>>
>>> - Dependency Injection (Blueprint or J2EE)
>>> - Security (LDAP, Shiro, OAuth, OpenID, ...)
>>> - REST (Jetty, Geronimo, ...)
>>> - ...
>>> Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb...@nanthrax.net>:
>>>
>>>> Hi,
>>>>
>>>> Spring clearly announced that they don't support OSGi anymore.
>>>>
>>>> Even if Spring is supported by Karaf (which is a good point to support
>>>> non OSGi applications using Spring), I would not recommend to start a
>>>> project using Spring.
>>>> Starting with native OSGi stuff is better (like Blueprint which is
>>>> actually close to Spring, SCR/DS, etc).
>>>>
>>>> Regards
>>>> JB
>>>>
>>>
>>> --
>>> Christian Schneiderhttp://www.liquid-reality.de
>>>
>>> Open Source Architecthttp://www.talend.com
>>>
>>>
>>
>>
>> --
>> Charlie Mordant
>>
>> Full OSGI/EE stack made with Karaf:
>> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>


-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Using Spring with Karaf 3.x

Posted by Achim Nierbeck <bc...@googlemail.com>.
Nice one Charlie,
with the next version of Pax Web it'll be also possible to use the
Websocket JSR-356 annotations without a single Servlet.
Just make sure you have the right Web-ContextPath manifest header in your
application.
For anyone interested give the latest Pax Web 4.1 a try together with the
websocket sample of Pax Web [1].
FYI I also did a summary of what's next at [2]

regards, Achim

[1] -
https://github.com/ops4j/org.ops4j.pax.web/tree/master/samples/websocket-jsr356
[2] - http://notizblog.nierbeck.de/2014/12/pax-web-4-1-whats-next/

2014-12-05 9:35 GMT+01:00 Charlie Mordant <cm...@gmail.com>:

> As an addition to Christian,
> I also made a full stack sample with CDI and an other for blueprint:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.samples
> It manipulates REST, JPA, JTA, JMS, Websocket.
>
> I also made a little CDI bridge for CXF that let's you expose REST
> webservices with an @CXFEndpoint annotation.
>
>
>
> 2014-12-05 9:26 GMT+01:00 Christian Schneider <ch...@die-schneider.net>:
>
>>  The problem is that we do not yet have some clear winners in the OSGi
>> space of enterprise frameworks.
>> Each of the current approaches has some advantages and shortcomings.
>>
>> Dependency injection:
>>
>> For DI the most mature for enterprise is currently blueprint. The major
>> deciding factor there is that it supports jpa and jta which is needed in
>> almost any enterprise application. Blueprint also has good support for CXF
>> (SOAP and REST) and Camel. I personally would prefer the CDI approach but
>> it is not yet fully mature in OSGi.
>>
>> Achim did a nice example that shows how to use CDI on karaf
>> See https://github.com/ANierbeck/karaf-enterprise-sample
>> The only downside is that he had to use blueprint for the jpa part but
>> that just reflects the state of CDI support.
>>
>> I am also working on an enterprise example here:
>> https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-cdi
>>
>> It also uses CDI annotations in the java code. I use a aries maven plugin
>> to generate blueprint from the annotations. So as a developer you can work
>> a lot like in CDI but have the stable blueprint below. The downside here is
>> that the maven plugin only supports a very small subset of CDI. Still you
>> can already do a lot with it.
>>
>> So maybe the ideal way here would be to combine the two approaches. Use
>> CDI annotations for all layers. Use the maven plugin for the persistence
>> layer and mayebe also for rest services (backed by blueprint) and real CDI
>> for the other layers.
>>
>> Security:
>>
>> For security I would go for plain JAAS for the most part. There is a JAAS
>> Feature in CXF that allows a really simple way to enable basic auth in CXF
>> services. It establishes a JAAS security context. Then there is the
>> blueprint authz extension that allows to use JEE security annotations like
>> @RolesAllowed in your business code. Unfortunately there is not much
>> documentation about it. I will have to write some reference and examples
>> for it.
>> In any case my advice for security is to just use JAAS and rather avoid
>> the bigger frameworks. They all kind of tie you to their own APIs.
>>
>> Rest:
>> For REST services CXF is the natural choice as it is very well supported
>> in karaf. Unfortunately there is no CDI integration available but there is
>> good support for blueprint.
>>
>> Christian
>>
>>
>>
>> On 05.12.2014 08:26, Kim Hansen wrote:
>>
>> Hi!
>>
>> I'm fairly new to Karaf and it would be really awesome if someone really
>> deep into Karaf and/or OSGi could suggest what frameworks and APIs to use
>> with Karaf 4 to create applications with the following technologies (and
>> not use Spring at all):
>>
>> - Dependency Injection (Blueprint or J2EE)
>> - Security (LDAP, Shiro, OAuth, OpenID, ...)
>> - REST (Jetty, Geronimo, ...)
>> - ...
>> Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb...@nanthrax.net>:
>>
>>> Hi,
>>>
>>> Spring clearly announced that they don't support OSGi anymore.
>>>
>>> Even if Spring is supported by Karaf (which is a good point to support
>>> non OSGi applications using Spring), I would not recommend to start a
>>> project using Spring.
>>> Starting with native OSGi stuff is better (like Blueprint which is
>>> actually close to Spring, SCR/DS, etc).
>>>
>>> Regards
>>> JB
>>>
>>
>> --
>> Christian Schneiderhttp://www.liquid-reality.de
>>
>> Open Source Architecthttp://www.talend.com
>>
>>
>
>
> --
> Charlie Mordant
>
> Full OSGI/EE stack made with Karaf:
> https://github.com/OsgiliathEnterprise/net.osgiliath.parent
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Using Spring with Karaf 3.x

Posted by Charlie Mordant <cm...@gmail.com>.
As an addition to Christian,
I also made a full stack sample with CDI and an other for blueprint:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent/tree/master/net.osgiliath.samples
It manipulates REST, JPA, JTA, JMS, Websocket.

I also made a little CDI bridge for CXF that let's you expose REST
webservices with an @CXFEndpoint annotation.



2014-12-05 9:26 GMT+01:00 Christian Schneider <ch...@die-schneider.net>:

>  The problem is that we do not yet have some clear winners in the OSGi
> space of enterprise frameworks.
> Each of the current approaches has some advantages and shortcomings.
>
> Dependency injection:
>
> For DI the most mature for enterprise is currently blueprint. The major
> deciding factor there is that it supports jpa and jta which is needed in
> almost any enterprise application. Blueprint also has good support for CXF
> (SOAP and REST) and Camel. I personally would prefer the CDI approach but
> it is not yet fully mature in OSGi.
>
> Achim did a nice example that shows how to use CDI on karaf
> See https://github.com/ANierbeck/karaf-enterprise-sample
> The only downside is that he had to use blueprint for the jpa part but
> that just reflects the state of CDI support.
>
> I am also working on an enterprise example here:
> https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-cdi
>
> It also uses CDI annotations in the java code. I use a aries maven plugin
> to generate blueprint from the annotations. So as a developer you can work
> a lot like in CDI but have the stable blueprint below. The downside here is
> that the maven plugin only supports a very small subset of CDI. Still you
> can already do a lot with it.
>
> So maybe the ideal way here would be to combine the two approaches. Use
> CDI annotations for all layers. Use the maven plugin for the persistence
> layer and mayebe also for rest services (backed by blueprint) and real CDI
> for the other layers.
>
> Security:
>
> For security I would go for plain JAAS for the most part. There is a JAAS
> Feature in CXF that allows a really simple way to enable basic auth in CXF
> services. It establishes a JAAS security context. Then there is the
> blueprint authz extension that allows to use JEE security annotations like
> @RolesAllowed in your business code. Unfortunately there is not much
> documentation about it. I will have to write some reference and examples
> for it.
> In any case my advice for security is to just use JAAS and rather avoid
> the bigger frameworks. They all kind of tie you to their own APIs.
>
> Rest:
> For REST services CXF is the natural choice as it is very well supported
> in karaf. Unfortunately there is no CDI integration available but there is
> good support for blueprint.
>
> Christian
>
>
>
> On 05.12.2014 08:26, Kim Hansen wrote:
>
> Hi!
>
> I'm fairly new to Karaf and it would be really awesome if someone really
> deep into Karaf and/or OSGi could suggest what frameworks and APIs to use
> with Karaf 4 to create applications with the following technologies (and
> not use Spring at all):
>
> - Dependency Injection (Blueprint or J2EE)
> - Security (LDAP, Shiro, OAuth, OpenID, ...)
> - REST (Jetty, Geronimo, ...)
> - ...
> Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb...@nanthrax.net>:
>
>> Hi,
>>
>> Spring clearly announced that they don't support OSGi anymore.
>>
>> Even if Spring is supported by Karaf (which is a good point to support
>> non OSGi applications using Spring), I would not recommend to start a
>> project using Spring.
>> Starting with native OSGi stuff is better (like Blueprint which is
>> actually close to Spring, SCR/DS, etc).
>>
>> Regards
>> JB
>>
>
> --
> Christian Schneiderhttp://www.liquid-reality.de
>
> Open Source Architecthttp://www.talend.com
>
>


-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Using Spring with Karaf 3.x

Posted by Christian Schneider <ch...@die-schneider.net>.
The problem is that we do not yet have some clear winners in the OSGi 
space of enterprise frameworks.
Each of the current approaches has some advantages and shortcomings.

Dependency injection:

For DI the most mature for enterprise is currently blueprint. The major 
deciding factor there is that it supports jpa and jta which is needed in 
almost any enterprise application. Blueprint also has good support for 
CXF (SOAP and REST) and Camel. I personally would prefer the CDI 
approach but it is not yet fully mature in OSGi.

Achim did a nice example that shows how to use CDI on karaf
See https://github.com/ANierbeck/karaf-enterprise-sample
The only downside is that he had to use blueprint for the jpa part but 
that just reflects the state of CDI support.

I am also working on an enterprise example here:
https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-cdi

It also uses CDI annotations in the java code. I use a aries maven 
plugin to generate blueprint from the annotations. So as a developer you 
can work a lot like in CDI but have the stable blueprint below. The 
downside here is that the maven plugin only supports a very small subset 
of CDI. Still you can already do a lot with it.

So maybe the ideal way here would be to combine the two approaches. Use 
CDI annotations for all layers. Use the maven plugin for the persistence 
layer and mayebe also for rest services (backed by blueprint) and real 
CDI for the other layers.

Security:

For security I would go for plain JAAS for the most part. There is a 
JAAS Feature in CXF that allows a really simple way to enable basic auth 
in CXF services. It establishes a JAAS security context. Then there is 
the blueprint authz extension that allows to use JEE security 
annotations like @RolesAllowed in your business code. Unfortunately 
there is not much documentation about it. I will have to write some 
reference and examples for it.
In any case my advice for security is to just use JAAS and rather avoid 
the bigger frameworks. They all kind of tie you to their own APIs.

Rest:
For REST services CXF is the natural choice as it is very well supported 
in karaf. Unfortunately there is no CDI integration available but there 
is good support for blueprint.

Christian



On 05.12.2014 08:26, Kim Hansen wrote:
>
> Hi!
>
> I'm fairly new to Karaf and it would be really awesome if someone 
> really deep into Karaf and/or OSGi could suggest what frameworks and 
> APIs to use with Karaf 4 to create applications with the following 
> technologies (and not use Spring at all):
>
> - Dependency Injection (Blueprint or J2EE)
> - Security (LDAP, Shiro, OAuth, OpenID, ...)
> - REST (Jetty, Geronimo, ...)
> - ...
>
> Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb@nanthrax.net 
> <ma...@nanthrax.net>>:
>
>     Hi,
>
>     Spring clearly announced that they don't support OSGi anymore.
>
>     Even if Spring is supported by Karaf (which is a good point to
>     support non OSGi applications using Spring), I would not recommend
>     to start a project using Spring.
>     Starting with native OSGi stuff is better (like Blueprint which is
>     actually close to Spring, SCR/DS, etc).
>
>     Regards
>     JB
>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Using Spring with Karaf 3.x

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi Kim,

I second JB on this though I think there are bit more possibilities :-)
and as usual "it depends" on your use-case :D



2014-12-05 8:32 GMT+01:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi Kim,
>
> - Dependency Injection: Blueprint or CDI
>
+1

> - Service: Blueprint or DS
>
+1

> - Security: Karaf security framework + Syncope + CXF STS
>
+1, standard JAAS will work for you if you use a WAB (Web Application
Bundle / aka WAR + OSGi-Manifest)

> - REST: CXF-RS
>
+1, any Restframework that uses a Servlet can be used.

it's also possible to let CDI (Pax CDI in that case) do the injection of
OSGi services into Servlets.

Regards, Achim




> ...
>
> is it what you mean ?  ;)
>
> If so, it's plan in the developer guide improvements (we have a Jira about
> that).
>
> Regards
> JB
>
> On 12/05/2014 08:26 AM, Kim Hansen wrote:
>
>> Hi!
>>
>> I'm fairly new to Karaf and it would be really awesome if someone really
>> deep into Karaf and/or OSGi could suggest what frameworks and APIs to
>> use with Karaf 4 to create applications with the following technologies
>> (and not use Spring at all):
>>
>> - Dependency Injection (Blueprint or J2EE)
>> - Security (LDAP, Shiro, OAuth, OpenID, ...)
>> - REST (Jetty, Geronimo, ...)
>> - ...
>>
>> Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb@nanthrax.net
>> <ma...@nanthrax.net>>:
>>
>>     Hi,
>>
>>     Spring clearly announced that they don't support OSGi anymore.
>>
>>     Even if Spring is supported by Karaf (which is a good point to
>>     support non OSGi applications using Spring), I would not recommend
>>     to start a project using Spring.
>>     Starting with native OSGi stuff is better (like Blueprint which is
>>     actually close to Spring, SCR/DS, etc).
>>
>>     Regards
>>     JB
>>
>>     On 12/04/2014 11:29 PM, asookazian2 wrote:
>>
>>         We have some legacy J2EE apps that we've ported (finally) to
>>         Karaf 3.0.x
>>         which use Spring.  Mainly for dependency injection and possibly
>> some
>>         templates (e.g. JdbcTemplate, etc.) and AOP.
>>
>>         Anyways, looks like there are no Spring (or Spring dm?) examples
>>         here:
>>         https://github.com/cschneider/__Karaf-Tutorial
>>         <https://github.com/cschneider/Karaf-Tutorial> and there are no
>>         Spring
>>         examples in the Apache Karaf Cookbook.
>>
>>         Is Spring usage with OSGi/Karaf recommended or not?  If yes,
>>         where can I
>>         find some examples?
>>
>>         "I stopped using spring on OSGi a long time ago."
>>
>>         http://stackoverflow.com/__questions/24595900/invalid-__
>> bundle-when-starting-apache-__karaf
>>         <http://stackoverflow.com/questions/24595900/invalid-
>> bundle-when-starting-apache-karaf>
>>
>>
>>
>>         --
>>         View this message in context:
>>         http://karaf.922171.n3.nabble.__com/Using-Spring-with-Karaf-
>> 3-__x-tp4036977.html
>>         <http://karaf.922171.n3.nabble.com/Using-Spring-with-
>> Karaf-3-x-tp4036977.html>
>>         Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>>
>>     --
>>     Jean-Baptiste Onofré
>>     jbonofre@apache.org <ma...@apache.org>
>>     http://blog.nanthrax.net
>>     Talend - http://www.talend.com
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: Using Spring with Karaf 3.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Kim,

- Dependency Injection: Blueprint or CDI
- Service: Blueprint or DS
- Security: Karaf security framework + Syncope + CXF STS
- REST: CXF-RS
...

is it what you mean ?  ;)

If so, it's plan in the developer guide improvements (we have a Jira 
about that).

Regards
JB

On 12/05/2014 08:26 AM, Kim Hansen wrote:
> Hi!
>
> I'm fairly new to Karaf and it would be really awesome if someone really
> deep into Karaf and/or OSGi could suggest what frameworks and APIs to
> use with Karaf 4 to create applications with the following technologies
> (and not use Spring at all):
>
> - Dependency Injection (Blueprint or J2EE)
> - Security (LDAP, Shiro, OAuth, OpenID, ...)
> - REST (Jetty, Geronimo, ...)
> - ...
>
> Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb@nanthrax.net
> <ma...@nanthrax.net>>:
>
>     Hi,
>
>     Spring clearly announced that they don't support OSGi anymore.
>
>     Even if Spring is supported by Karaf (which is a good point to
>     support non OSGi applications using Spring), I would not recommend
>     to start a project using Spring.
>     Starting with native OSGi stuff is better (like Blueprint which is
>     actually close to Spring, SCR/DS, etc).
>
>     Regards
>     JB
>
>     On 12/04/2014 11:29 PM, asookazian2 wrote:
>
>         We have some legacy J2EE apps that we've ported (finally) to
>         Karaf 3.0.x
>         which use Spring.  Mainly for dependency injection and possibly some
>         templates (e.g. JdbcTemplate, etc.) and AOP.
>
>         Anyways, looks like there are no Spring (or Spring dm?) examples
>         here:
>         https://github.com/cschneider/__Karaf-Tutorial
>         <https://github.com/cschneider/Karaf-Tutorial> and there are no
>         Spring
>         examples in the Apache Karaf Cookbook.
>
>         Is Spring usage with OSGi/Karaf recommended or not?  If yes,
>         where can I
>         find some examples?
>
>         "I stopped using spring on OSGi a long time ago."
>
>         http://stackoverflow.com/__questions/24595900/invalid-__bundle-when-starting-apache-__karaf
>         <http://stackoverflow.com/questions/24595900/invalid-bundle-when-starting-apache-karaf>
>
>
>
>         --
>         View this message in context:
>         http://karaf.922171.n3.nabble.__com/Using-Spring-with-Karaf-3-__x-tp4036977.html
>         <http://karaf.922171.n3.nabble.com/Using-Spring-with-Karaf-3-x-tp4036977.html>
>         Sent from the Karaf - User mailing list archive at Nabble.com.
>
>
>     --
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Using Spring with Karaf 3.x

Posted by Kim Hansen <ki...@gmail.com>.
Hi!

I'm fairly new to Karaf and it would be really awesome if someone really
deep into Karaf and/or OSGi could suggest what frameworks and APIs to use
with Karaf 4 to create applications with the following technologies (and
not use Spring at all):

- Dependency Injection (Blueprint or J2EE)
- Security (LDAP, Shiro, OAuth, OpenID, ...)
- REST (Jetty, Geronimo, ...)
- ...
Den 05/12/2014 00.11 skrev "Jean-Baptiste Onofré" <jb...@nanthrax.net>:

> Hi,
>
> Spring clearly announced that they don't support OSGi anymore.
>
> Even if Spring is supported by Karaf (which is a good point to support non
> OSGi applications using Spring), I would not recommend to start a project
> using Spring.
> Starting with native OSGi stuff is better (like Blueprint which is
> actually close to Spring, SCR/DS, etc).
>
> Regards
> JB
>
> On 12/04/2014 11:29 PM, asookazian2 wrote:
>
>> We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
>> which use Spring.  Mainly for dependency injection and possibly some
>> templates (e.g. JdbcTemplate, etc.) and AOP.
>>
>> Anyways, looks like there are no Spring (or Spring dm?) examples here:
>> https://github.com/cschneider/Karaf-Tutorial and there are no Spring
>> examples in the Apache Karaf Cookbook.
>>
>> Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
>> find some examples?
>>
>> "I stopped using spring on OSGi a long time ago."
>>
>> http://stackoverflow.com/questions/24595900/invalid-
>> bundle-when-starting-apache-karaf
>>
>>
>>
>> --
>> View this message in context: http://karaf.922171.n3.nabble.
>> com/Using-Spring-with-Karaf-3-x-tp4036977.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Using Spring with Karaf 3.x

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

Spring clearly announced that they don't support OSGi anymore.

Even if Spring is supported by Karaf (which is a good point to support 
non OSGi applications using Spring), I would not recommend to start a 
project using Spring.
Starting with native OSGi stuff is better (like Blueprint which is 
actually close to Spring, SCR/DS, etc).

Regards
JB

On 12/04/2014 11:29 PM, asookazian2 wrote:
> We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
> which use Spring.  Mainly for dependency injection and possibly some
> templates (e.g. JdbcTemplate, etc.) and AOP.
>
> Anyways, looks like there are no Spring (or Spring dm?) examples here:
> https://github.com/cschneider/Karaf-Tutorial and there are no Spring
> examples in the Apache Karaf Cookbook.
>
> Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
> find some examples?
>
> "I stopped using spring on OSGi a long time ago."
>
> http://stackoverflow.com/questions/24595900/invalid-bundle-when-starting-apache-karaf
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Using-Spring-with-Karaf-3-x-tp4036977.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Using Spring with Karaf 3.x

Posted by Steve <de...@gmail.com>.
I come from a Spring-centric background and found Blueprint to be
similar enough from a dependency-injection standpoint that I was able
to get up and running extremely quickly.  Additionally, its support
for services is quite nifty and does a great job of abstracting (or
"softening") some of the service dynamism that can sometimes be
problematic (especially for new developers).  While there are several
good options, as others have noted, you really can't go wrong with
Blueprint.

-Steve

On Thu, Dec 4, 2014 at 5:29 PM, asookazian2 <as...@gmail.com> wrote:
> We have some legacy J2EE apps that we've ported (finally) to Karaf 3.0.x
> which use Spring.  Mainly for dependency injection and possibly some
> templates (e.g. JdbcTemplate, etc.) and AOP.
>
> Anyways, looks like there are no Spring (or Spring dm?) examples here:
> https://github.com/cschneider/Karaf-Tutorial and there are no Spring
> examples in the Apache Karaf Cookbook.
>
> Is Spring usage with OSGi/Karaf recommended or not?  If yes, where can I
> find some examples?
>
> "I stopped using spring on OSGi a long time ago."
>
> http://stackoverflow.com/questions/24595900/invalid-bundle-when-starting-apache-karaf
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Using-Spring-with-Karaf-3-x-tp4036977.html
> Sent from the Karaf - User mailing list archive at Nabble.com.