You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Charles Moulliard <cm...@gmail.com> on 2011/02/10 14:33:34 UTC

Apache Karaf & WAR + JSF

Hi,

I have deployed a WAR project on Karaf which is JSF technology based
but get this issue :

14:05:19,408 | WARN  | FelixStartLevel  | war
    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
java.lang.IllegalStateException: Application was not properly
initialized at startup, could not find Factory:
javax.faces.context.FacesContextFactory
	at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
	at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]

The lib directory of the WAR contains well the jar of jsf api -->
jsf-api-2.0.4-b09

Remark : the same WAR deployed on Tomcat works fine

Is it something that you already experienced ?

Regards,

Charles Moulliard

Sr. Principal Solution Architect - FuseSource
Apache Committer

Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard

Re: Apache Karaf & WAR + JSF

Posted by Guillaume Nodet <gn...@gmail.com>.
Does the war also contain a JSF implementation ?

On Thu, Feb 10, 2011 at 14:33, Charles Moulliard <cm...@gmail.com> wrote:
> Hi,
>
> I have deployed a WAR project on Karaf which is JSF technology based
> but get this issue :
>
> 14:05:19,408 | WARN  | FelixStartLevel  | war
>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
> java.lang.IllegalStateException: Application was not properly
> initialized at startup, could not find Factory:
> javax.faces.context.FacesContextFactory
>        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>        at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>
> The lib directory of the WAR contains well the jar of jsf api -->
> jsf-api-2.0.4-b09
>
> Remark : the same WAR deployed on Tomcat works fine
>
> Is it something that you already experienced ?
>
> Regards,
>
> Charles Moulliard
>
> Sr. Principal Solution Architect - FuseSource
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

RE: newbie question: hibernate-core bundle (with deps)

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Oh well... a "good" thing is that no one will use hibernate to actually "persist" anything here.
It's JUST that this legacy thing has a few classes that I need to use (Address, Country...) that actually implement some Hibernate interfaces (or extend some Hibernate classes) -do not ask me why :)

So I need to have those objects here (therefore I need some hibernate jar) but they won't actually be used for any ORM purposes.

So if you say that those do not work as in "you might have trouble when persisting/reading from DB", I'm quite happy I won't actually use that.

-m

Ps: by the by, I'm kind of using it right now. It was just a hassle to have to go find all it's deps (dom4j, javassist and so on...). 
could I somehow have done it by just adding spring ebr repo in karaf (some sort of "addurl" trick)?


-----Original Message-----
From: Achim Nierbeck [mailto:bcanhome@googlemail.com] 
Sent: venerdì 11 febbraio 2011 12:42
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: newbie question: hibernate-core bundle (with deps)

Hi Marco,

to be honest, from what I experienced the spring-hibernate jars don't
really work :(

what I have done before is to wrap up a bundle containing all the
required hibernate jars and exporting all needed classes.

The DAO-Classes needed a special handling. We did a aop wrapping
around setting the Thread.contextClassloader to the bundle
classloader. With that it did run more smoothly :)
I think there is a blog of Peter Kriens about this.

Another thing would be to use OpenJPA as provider, that should work
out better :)

Regards, Achim

2011/2/11 Marco Firrincieli <Ma...@lbigroup.it>:
> Hi all,
>
> i've only started "now" working on making a legacy application deployable on karaf.
> Right now I'm fighting de-coupling a few things, and I've come to find a strong dependency with hibernate.
>
> Googling around couldn't really come up with the correct "way to do", so that's why I'm asking.
>
> I found out that spring sort or releases the bundle for hibernate (com.springsource.org.hibernate) but when I deploy it on karaf, it still says I miss so many other stuff.
>
> Any "easy" way to have it all without looking for every little dependencies here and there?
>
> Thanks
>
> -m
>


Re: spring injected bean cannot be found

Posted by Guillaume Nodet <gn...@gmail.com>.
On Tue, Feb 15, 2011 at 17:19, Andreas Pieber <an...@gmail.com> wrote:
> Hey Marco,
>
> 1) please feel free to start a new thread for a new question :)
>
> 2) I'm sure that there has to be a notation in the log. I'm not exactly sure
> what you're doing here but I assume the following:
>
> bundleA
>
> imports InterfaceX;
>
> // this thing get autoinjected
> private InterfaceX x;
>
> bundleB
>
> public class ImplX implements InterfaceX {...
>
> The problem is that the maven-bundle-plugin only scans your imports, not your
> spring files --> he could not find ImplX (required by spring to instanciate the
> class) --> You have to add the import manually in your pom files.

Recent maven bundle plugins do actually scan the spring / blueprint files.
Though it can only detect direct references and namespaces won't work.

>
> kind regards,
> andreas
>
> On Tue, Feb 15, 2011 at 05:20:41PM +0100, Marco Firrincieli wrote:
>>    One of my bundles (call it bundleA) instantiate a new Stuff() and this
>>    Stuff is another bundle (bundleB) (already up and running) and has a
>>    Spring autowired bean.
>>
>>
>>    Result: nullpointerexception the (supposedly) injected bean.
>>
>>
>>    Any idea? Should add something in bundleB's manifest?
>>
>>
>>
>>    Can't find much googling about this.
>>
>>
>>    Thanks
>>
>>
>>    -m
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: spring injected bean cannot be found

Posted by Andreas Pieber <an...@gmail.com>.
Hey Marco,

1) please feel free to start a new thread for a new question :)

2) I'm sure that there has to be a notation in the log. I'm not exactly sure
what you're doing here but I assume the following:

bundleA

imports InterfaceX;

// this thing get autoinjected
private InterfaceX x;

bundleB

public class ImplX implements InterfaceX {...

The problem is that the maven-bundle-plugin only scans your imports, not your
spring files --> he could not find ImplX (required by spring to instanciate the
class) --> You have to add the import manually in your pom files.

kind regards,
andreas

On Tue, Feb 15, 2011 at 05:20:41PM +0100, Marco Firrincieli wrote:
>    One of my bundles (call it bundleA) instantiate a new Stuff() and this
>    Stuff is another bundle (bundleB) (already up and running) and has a
>    Spring autowired bean.
> 
> 
>    Result: nullpointerexception the (supposedly) injected bean.
> 
> 
>    Any idea? Should add something in bundleB's manifest?
> 
> 
> 
>    Can't find much googling about this.
> 
> 
>    Thanks
> 
> 
>    -m

Re: spring injected bean cannot be found

Posted by Andreas Pieber <an...@gmail.com>.
Hey Marco,

Spring or blueprint both basically proxy the stuff done by
ServiceTracker (but making the injection much more beautiful IMHO).
Though if you have used neither spring nor blueprint by now for the
bundles I would recommend you to take a look at the Aries Blueprint
implementation which is coming with Karaf. I'm sure you'll like it :)

kind regards,
andreas

On Wed, Feb 16, 2011 at 9:47 PM, Marco Firrincieli
<Ma...@lbigroup.it> wrote:
> i had to use this ServiceTracker thing. it works but i did not really like it.
>
> i'm guessing my bundle should've been a spring-integration module of some kind (only really used spring for webapps).
>
> i'm wondering if it's worth giving a try or just leaving it as it is (servicetracker).
>
> ________________________________________
> From: Andreas Pieber [anpieber@gmail.com]
> Sent: 15 February 2011 19:13
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
>
> Either you create a spring-bundle or you simply user e.g. ServiceTracker to
> retrieve the service in the activator
>
> kind regards,
> andreas
>
> On Tue, Feb 15, 2011 at 07:17:22PM +0100, Marco Firrincieli wrote:
>> Alright.
>>
>> Just one more thing. My activator (inside bundleA) is not a spring project.
>>
>> so where do I put this <osgi:reference thingie?
>>
>>
>>
>> -----Original Message-----
>> From: Andreas Pieber [mailto:anpieber@gmail.com]
>> Sent: martedì 15 febbraio 2011 18:42
>> To: user@karaf.apache.org; Marco Firrincieli
>> Subject: Re: spring injected bean cannot be found
>>
>> On Tue, Feb 15, 2011 at 06:39:19PM +0100, Marco Firrincieli wrote:
>> > Alright thanks so much, andreas.
>> >
>> > I'm trying to add this spring-dm "stuff" on my spring.xml file for bundleB.
>> >
>> > I'll probably need some spring-dm stuff on karaf too (trying to understand if I have it as "features"  already or not).
>>
>> there is already a feature for this available with karaf: spring-dm
>>
>> >
>> > That <osgi:service you put in comes from spring-osgi namespace (which I'll to add) right?
>>
>> ai, but best consult the spring-dm docs for the details. It's quite simple to export/import services using spring
>>
>> kind regards,
>> andreas
>>
>> >
>> >
>> > -----Original Message-----
>> > From: Andreas Pieber [mailto:anpieber@gmail.com]
>> > Sent: martedì 15 febbraio 2011 18:10
>> > To: user@karaf.apache.org; Marco Firrincieli
>> > Subject: Re: spring injected bean cannot be found
>> >
>> > Yeah, as said: don't use new, but rather use spring-dm to export
>> > BundleBClass as a service (you have to add an interface therefore) and
>> > import it into bundleAClass
>> >
>> > this looks then something like:
>> >
>> > bundleBspring
>> >
>> > <bean id="a" class="XXX" />
>> > <osgi:service interface="..." ref="a" />
>> >
>> > bundleAspring
>> >
>> > <bean id="b" class="YYY" >
>> > <!-- via props or autowiring; as u like--> </> <osgi:reference
>> > interace="..." id="xyz" />
>> >
>> > kind regards,
>> > andreas
>> >
>> > On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
>> > > I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
>> > >
>> > > I don't need to actually get the autowired bean from bundleB. I need
>> > > bundleB to do something for me (bundleA). (in the example I need
>> > > BundleBClass.sayHello())
>> > >
>> > > Gotta find a (quick) workaround to do this.
>> > >
>> > > -----Original Message-----
>> > > From: Andreas Pieber [mailto:anpieber@gmail.com]
>> > > Sent: martedì 15 febbraio 2011 17:42
>> > > To: user@karaf.apache.org; Marco Firrincieli
>> > > Subject: Re: spring injected bean cannot be found
>> > >
>> > > ah ok, this can't work this way... in bundlaA only the spring files
>> > > in bundleA count; if you define the autowiring things in
>> > > bundleA-spring-file it will work; BUT bundleA-spring-files have no
>> > > idea of bundleb-spring-files... I hope it is clear what I'm pointing
>> > > at... Typically you don't want to do a new XXX in bundleA but rather
>> > > import a service from bundleB
>> > >
>> > > @thread: no it isn't you also have to remove the In-Reply-To: field
>> > > in the header; simply hitting reply and changing the subject does
>> > > not really create a new thread :)
>> > >
>> > > kind regards,
>> > > andreas
>> > >
>> > > On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
>> > > > Here it comes:
>> > > >
>> > > > (I’ve tried to simplify here... hope it works)
>> > > >
>> > > > Here’s my karaf list command output (notice all I need is in an Active state).
>> > > >
>> > > > [51] [Active] [] [] [75] my.legacy.something.just-a-jar
>> > > > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans
>> > > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB
>> > > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleA
>> > > > (1.0.0.SNAPSHOT)
>> > > >
>> > > > at some point in bundleA i have:
>> > > >
>> > > > package my.package.bundleA
>> > > >
>> > > > import some.class.in.bundleB.BundleBClass;
>> > > >
>> > > > public class MyClass {
>> > > >         void doStuff() {
>> > > >                 new BundleBClass().sayHello();
>> > > >         }
>> > > > }
>> > > >
>> > > >
>> > > > Whereas in bundleB
>> > > >
>> > > > package some.class.in.bundleB;
>> > > >
>> > > > public class BundleBClass {
>> > > >
>> > > >         @Autowired
>> > > >         private Sayer sayer;
>> > > >
>> > > >         void sayHello() {
>> > > >                 this.sayer.say("hello");
>> > > >         }
>> > > > }
>> > > >
>> > > > And of course bundleB exports its BundleBClass
>> > > >
>> > > >
>> > > > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > Ps: @Andreas, is this not a new thread?
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
>> > > > Sent: martedì 15 febbraio 2011 17:21
>> > > > To: user@karaf.apache.org; Marco Firrincieli
>> > > > Subject: Re: spring injected bean cannot be found
>> > > >
>> > > > Do you use blueprint for that or pure OSGi services ?
>> > > > Could we have the spring file and the complete stack trace ?
>> > > >
>> > > > Regards
>> > > > JB
>> > > > ________________________________________
>> > > > From: Marco Firrincieli <Ma...@lbigroup.it>
>> > > > Date: Tue, 15 Feb 2011 17:20:41 +0100
>> > > > To: user@karaf.apache.org<us...@karaf.apache.org>
>> > > > ReplyTo: user@karaf.apache.org
>> > > > Subject: spring injected bean cannot be found
>> > > >
>> > > > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
>> > > >
>> > > > Result: nullpointerexception the (supposedly) injected bean.
>> > > >
>> > > > Any idea? Should add something in bundleB’s manifest?
>> > > >
>> > > >
>> > > > Can’t find much googling about this.
>> > > >
>> > > > Thanks
>> > > >
>> > > > -m
>
>

RE: spring injected bean cannot be found

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
i had to use this ServiceTracker thing. it works but i did not really like it.

i'm guessing my bundle should've been a spring-integration module of some kind (only really used spring for webapps).

i'm wondering if it's worth giving a try or just leaving it as it is (servicetracker).

________________________________________
From: Andreas Pieber [anpieber@gmail.com]
Sent: 15 February 2011 19:13
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: spring injected bean cannot be found

Either you create a spring-bundle or you simply user e.g. ServiceTracker to
retrieve the service in the activator

kind regards,
andreas

On Tue, Feb 15, 2011 at 07:17:22PM +0100, Marco Firrincieli wrote:
> Alright.
>
> Just one more thing. My activator (inside bundleA) is not a spring project.
>
> so where do I put this <osgi:reference thingie?
>
>
>
> -----Original Message-----
> From: Andreas Pieber [mailto:anpieber@gmail.com]
> Sent: martedì 15 febbraio 2011 18:42
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
>
> On Tue, Feb 15, 2011 at 06:39:19PM +0100, Marco Firrincieli wrote:
> > Alright thanks so much, andreas.
> >
> > I'm trying to add this spring-dm "stuff" on my spring.xml file for bundleB.
> >
> > I'll probably need some spring-dm stuff on karaf too (trying to understand if I have it as "features"  already or not).
>
> there is already a feature for this available with karaf: spring-dm
>
> >
> > That <osgi:service you put in comes from spring-osgi namespace (which I'll to add) right?
>
> ai, but best consult the spring-dm docs for the details. It's quite simple to export/import services using spring
>
> kind regards,
> andreas
>
> >
> >
> > -----Original Message-----
> > From: Andreas Pieber [mailto:anpieber@gmail.com]
> > Sent: martedì 15 febbraio 2011 18:10
> > To: user@karaf.apache.org; Marco Firrincieli
> > Subject: Re: spring injected bean cannot be found
> >
> > Yeah, as said: don't use new, but rather use spring-dm to export
> > BundleBClass as a service (you have to add an interface therefore) and
> > import it into bundleAClass
> >
> > this looks then something like:
> >
> > bundleBspring
> >
> > <bean id="a" class="XXX" />
> > <osgi:service interface="..." ref="a" />
> >
> > bundleAspring
> >
> > <bean id="b" class="YYY" >
> > <!-- via props or autowiring; as u like--> </> <osgi:reference
> > interace="..." id="xyz" />
> >
> > kind regards,
> > andreas
> >
> > On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
> > > I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
> > >
> > > I don't need to actually get the autowired bean from bundleB. I need
> > > bundleB to do something for me (bundleA). (in the example I need
> > > BundleBClass.sayHello())
> > >
> > > Gotta find a (quick) workaround to do this.
> > >
> > > -----Original Message-----
> > > From: Andreas Pieber [mailto:anpieber@gmail.com]
> > > Sent: martedì 15 febbraio 2011 17:42
> > > To: user@karaf.apache.org; Marco Firrincieli
> > > Subject: Re: spring injected bean cannot be found
> > >
> > > ah ok, this can't work this way... in bundlaA only the spring files
> > > in bundleA count; if you define the autowiring things in
> > > bundleA-spring-file it will work; BUT bundleA-spring-files have no
> > > idea of bundleb-spring-files... I hope it is clear what I'm pointing
> > > at... Typically you don't want to do a new XXX in bundleA but rather
> > > import a service from bundleB
> > >
> > > @thread: no it isn't you also have to remove the In-Reply-To: field
> > > in the header; simply hitting reply and changing the subject does
> > > not really create a new thread :)
> > >
> > > kind regards,
> > > andreas
> > >
> > > On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> > > > Here it comes:
> > > >
> > > > (I’ve tried to simplify here... hope it works)
> > > >
> > > > Here’s my karaf list command output (notice all I need is in an Active state).
> > > >
> > > > [51] [Active] [] [] [75] my.legacy.something.just-a-jar
> > > > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans
> > > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB
> > > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleA
> > > > (1.0.0.SNAPSHOT)
> > > >
> > > > at some point in bundleA i have:
> > > >
> > > > package my.package.bundleA
> > > >
> > > > import some.class.in.bundleB.BundleBClass;
> > > >
> > > > public class MyClass {
> > > >         void doStuff() {
> > > >                 new BundleBClass().sayHello();
> > > >         }
> > > > }
> > > >
> > > >
> > > > Whereas in bundleB
> > > >
> > > > package some.class.in.bundleB;
> > > >
> > > > public class BundleBClass {
> > > >
> > > >         @Autowired
> > > >         private Sayer sayer;
> > > >
> > > >         void sayHello() {
> > > >                 this.sayer.say("hello");
> > > >         }
> > > > }
> > > >
> > > > And of course bundleB exports its BundleBClass
> > > >
> > > >
> > > > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> > > >
> > > >
> > > >
> > > >
> > > > Ps: @Andreas, is this not a new thread?
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> > > > Sent: martedì 15 febbraio 2011 17:21
> > > > To: user@karaf.apache.org; Marco Firrincieli
> > > > Subject: Re: spring injected bean cannot be found
> > > >
> > > > Do you use blueprint for that or pure OSGi services ?
> > > > Could we have the spring file and the complete stack trace ?
> > > >
> > > > Regards
> > > > JB
> > > > ________________________________________
> > > > From: Marco Firrincieli <Ma...@lbigroup.it>
> > > > Date: Tue, 15 Feb 2011 17:20:41 +0100
> > > > To: user@karaf.apache.org<us...@karaf.apache.org>
> > > > ReplyTo: user@karaf.apache.org
> > > > Subject: spring injected bean cannot be found
> > > >
> > > > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> > > >
> > > > Result: nullpointerexception the (supposedly) injected bean.
> > > >
> > > > Any idea? Should add something in bundleB’s manifest?
> > > >
> > > >
> > > > Can’t find much googling about this.
> > > >
> > > > Thanks
> > > >
> > > > -m


Re: spring injected bean cannot be found

Posted by Andreas Pieber <an...@gmail.com>.
Either you create a spring-bundle or you simply user e.g. ServiceTracker to
retrieve the service in the activator

kind regards,
andreas

On Tue, Feb 15, 2011 at 07:17:22PM +0100, Marco Firrincieli wrote:
> Alright.
> 
> Just one more thing. My activator (inside bundleA) is not a spring project.
> 
> so where do I put this <osgi:reference thingie?
> 
> 
> 
> -----Original Message-----
> From: Andreas Pieber [mailto:anpieber@gmail.com] 
> Sent: martedì 15 febbraio 2011 18:42
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> On Tue, Feb 15, 2011 at 06:39:19PM +0100, Marco Firrincieli wrote:
> > Alright thanks so much, andreas.
> > 
> > I'm trying to add this spring-dm "stuff" on my spring.xml file for bundleB.
> > 
> > I'll probably need some spring-dm stuff on karaf too (trying to understand if I have it as "features"  already or not).
> 
> there is already a feature for this available with karaf: spring-dm
> 
> > 
> > That <osgi:service you put in comes from spring-osgi namespace (which I'll to add) right?
> 
> ai, but best consult the spring-dm docs for the details. It's quite simple to export/import services using spring
> 
> kind regards,
> andreas
> 
> > 
> > 
> > -----Original Message-----
> > From: Andreas Pieber [mailto:anpieber@gmail.com]
> > Sent: martedì 15 febbraio 2011 18:10
> > To: user@karaf.apache.org; Marco Firrincieli
> > Subject: Re: spring injected bean cannot be found
> > 
> > Yeah, as said: don't use new, but rather use spring-dm to export 
> > BundleBClass as a service (you have to add an interface therefore) and 
> > import it into bundleAClass
> > 
> > this looks then something like:
> > 
> > bundleBspring
> > 
> > <bean id="a" class="XXX" />
> > <osgi:service interface="..." ref="a" />
> > 
> > bundleAspring
> > 
> > <bean id="b" class="YYY" >
> > <!-- via props or autowiring; as u like--> </> <osgi:reference 
> > interace="..." id="xyz" />
> > 
> > kind regards,
> > andreas
> > 
> > On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
> > > I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
> > > 
> > > I don't need to actually get the autowired bean from bundleB. I need 
> > > bundleB to do something for me (bundleA). (in the example I need
> > > BundleBClass.sayHello())
> > > 
> > > Gotta find a (quick) workaround to do this.
> > > 
> > > -----Original Message-----
> > > From: Andreas Pieber [mailto:anpieber@gmail.com]
> > > Sent: martedì 15 febbraio 2011 17:42
> > > To: user@karaf.apache.org; Marco Firrincieli
> > > Subject: Re: spring injected bean cannot be found
> > > 
> > > ah ok, this can't work this way... in bundlaA only the spring files 
> > > in bundleA count; if you define the autowiring things in 
> > > bundleA-spring-file it will work; BUT bundleA-spring-files have no 
> > > idea of bundleb-spring-files... I hope it is clear what I'm pointing 
> > > at... Typically you don't want to do a new XXX in bundleA but rather 
> > > import a service from bundleB
> > > 
> > > @thread: no it isn't you also have to remove the In-Reply-To: field 
> > > in the header; simply hitting reply and changing the subject does 
> > > not really create a new thread :)
> > > 
> > > kind regards,
> > > andreas
> > > 
> > > On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> > > > Here it comes:
> > > > 
> > > > (I’ve tried to simplify here... hope it works)
> > > > 
> > > > Here’s my karaf list command output (notice all I need is in an Active state).
> > > > 
> > > > [51] [Active] [] [] [75] my.legacy.something.just-a-jar
> > > > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans
> > > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB 
> > > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleA 
> > > > (1.0.0.SNAPSHOT)
> > > > 
> > > > at some point in bundleA i have:
> > > > 
> > > > package my.package.bundleA
> > > > 
> > > > import some.class.in.bundleB.BundleBClass;
> > > > 
> > > > public class MyClass {
> > > > 	void doStuff() {
> > > > 		new BundleBClass().sayHello();
> > > > 	}
> > > > }
> > > > 
> > > > 
> > > > Whereas in bundleB
> > > > 
> > > > package some.class.in.bundleB;
> > > > 
> > > > public class BundleBClass {
> > > > 
> > > > 	@Autowired
> > > > 	private Sayer sayer;
> > > > 	
> > > > 	void sayHello() {
> > > > 		this.sayer.say("hello");
> > > > 	}
> > > > }
> > > > 
> > > > And of course bundleB exports its BundleBClass
> > > > 
> > > > 
> > > > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Ps: @Andreas, is this not a new thread?
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> > > > Sent: martedì 15 febbraio 2011 17:21
> > > > To: user@karaf.apache.org; Marco Firrincieli
> > > > Subject: Re: spring injected bean cannot be found
> > > > 
> > > > Do you use blueprint for that or pure OSGi services ?
> > > > Could we have the spring file and the complete stack trace ?
> > > > 
> > > > Regards
> > > > JB
> > > > ________________________________________
> > > > From: Marco Firrincieli <Ma...@lbigroup.it>
> > > > Date: Tue, 15 Feb 2011 17:20:41 +0100
> > > > To: user@karaf.apache.org<us...@karaf.apache.org>
> > > > ReplyTo: user@karaf.apache.org
> > > > Subject: spring injected bean cannot be found
> > > > 
> > > > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> > > > 
> > > > Result: nullpointerexception the (supposedly) injected bean.
> > > > 
> > > > Any idea? Should add something in bundleB’s manifest?
> > > > 
> > > > 
> > > > Can’t find much googling about this.
> > > > 
> > > > Thanks
> > > > 
> > > > -m

RE: spring injected bean cannot be found

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Alright.

Just one more thing. My activator (inside bundleA) is not a spring project.

so where do I put this <osgi:reference thingie?



-----Original Message-----
From: Andreas Pieber [mailto:anpieber@gmail.com] 
Sent: martedì 15 febbraio 2011 18:42
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: spring injected bean cannot be found

On Tue, Feb 15, 2011 at 06:39:19PM +0100, Marco Firrincieli wrote:
> Alright thanks so much, andreas.
> 
> I'm trying to add this spring-dm "stuff" on my spring.xml file for bundleB.
> 
> I'll probably need some spring-dm stuff on karaf too (trying to understand if I have it as "features"  already or not).

there is already a feature for this available with karaf: spring-dm

> 
> That <osgi:service you put in comes from spring-osgi namespace (which I'll to add) right?

ai, but best consult the spring-dm docs for the details. It's quite simple to export/import services using spring

kind regards,
andreas

> 
> 
> -----Original Message-----
> From: Andreas Pieber [mailto:anpieber@gmail.com]
> Sent: martedì 15 febbraio 2011 18:10
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> Yeah, as said: don't use new, but rather use spring-dm to export 
> BundleBClass as a service (you have to add an interface therefore) and 
> import it into bundleAClass
> 
> this looks then something like:
> 
> bundleBspring
> 
> <bean id="a" class="XXX" />
> <osgi:service interface="..." ref="a" />
> 
> bundleAspring
> 
> <bean id="b" class="YYY" >
> <!-- via props or autowiring; as u like--> </> <osgi:reference 
> interace="..." id="xyz" />
> 
> kind regards,
> andreas
> 
> On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
> > I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
> > 
> > I don't need to actually get the autowired bean from bundleB. I need 
> > bundleB to do something for me (bundleA). (in the example I need
> > BundleBClass.sayHello())
> > 
> > Gotta find a (quick) workaround to do this.
> > 
> > -----Original Message-----
> > From: Andreas Pieber [mailto:anpieber@gmail.com]
> > Sent: martedì 15 febbraio 2011 17:42
> > To: user@karaf.apache.org; Marco Firrincieli
> > Subject: Re: spring injected bean cannot be found
> > 
> > ah ok, this can't work this way... in bundlaA only the spring files 
> > in bundleA count; if you define the autowiring things in 
> > bundleA-spring-file it will work; BUT bundleA-spring-files have no 
> > idea of bundleb-spring-files... I hope it is clear what I'm pointing 
> > at... Typically you don't want to do a new XXX in bundleA but rather 
> > import a service from bundleB
> > 
> > @thread: no it isn't you also have to remove the In-Reply-To: field 
> > in the header; simply hitting reply and changing the subject does 
> > not really create a new thread :)
> > 
> > kind regards,
> > andreas
> > 
> > On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> > > Here it comes:
> > > 
> > > (I’ve tried to simplify here... hope it works)
> > > 
> > > Here’s my karaf list command output (notice all I need is in an Active state).
> > > 
> > > [51] [Active] [] [] [75] my.legacy.something.just-a-jar
> > > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans
> > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB 
> > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleA 
> > > (1.0.0.SNAPSHOT)
> > > 
> > > at some point in bundleA i have:
> > > 
> > > package my.package.bundleA
> > > 
> > > import some.class.in.bundleB.BundleBClass;
> > > 
> > > public class MyClass {
> > > 	void doStuff() {
> > > 		new BundleBClass().sayHello();
> > > 	}
> > > }
> > > 
> > > 
> > > Whereas in bundleB
> > > 
> > > package some.class.in.bundleB;
> > > 
> > > public class BundleBClass {
> > > 
> > > 	@Autowired
> > > 	private Sayer sayer;
> > > 	
> > > 	void sayHello() {
> > > 		this.sayer.say("hello");
> > > 	}
> > > }
> > > 
> > > And of course bundleB exports its BundleBClass
> > > 
> > > 
> > > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> > > 
> > > 
> > > 
> > > 
> > > Ps: @Andreas, is this not a new thread?
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> > > Sent: martedì 15 febbraio 2011 17:21
> > > To: user@karaf.apache.org; Marco Firrincieli
> > > Subject: Re: spring injected bean cannot be found
> > > 
> > > Do you use blueprint for that or pure OSGi services ?
> > > Could we have the spring file and the complete stack trace ?
> > > 
> > > Regards
> > > JB
> > > ________________________________________
> > > From: Marco Firrincieli <Ma...@lbigroup.it>
> > > Date: Tue, 15 Feb 2011 17:20:41 +0100
> > > To: user@karaf.apache.org<us...@karaf.apache.org>
> > > ReplyTo: user@karaf.apache.org
> > > Subject: spring injected bean cannot be found
> > > 
> > > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> > > 
> > > Result: nullpointerexception the (supposedly) injected bean.
> > > 
> > > Any idea? Should add something in bundleB’s manifest?
> > > 
> > > 
> > > Can’t find much googling about this.
> > > 
> > > Thanks
> > > 
> > > -m

Re: spring injected bean cannot be found

Posted by Andreas Pieber <an...@gmail.com>.
On Tue, Feb 15, 2011 at 06:39:19PM +0100, Marco Firrincieli wrote:
> Alright thanks so much, andreas.
> 
> I'm trying to add this spring-dm "stuff" on my spring.xml file for bundleB.
> 
> I'll probably need some spring-dm stuff on karaf too (trying to understand if I have it as "features"  already or not).

there is already a feature for this available with karaf: spring-dm

> 
> That <osgi:service you put in comes from spring-osgi namespace (which I'll to add) right?

ai, but best consult the spring-dm docs for the details. It's quite simple to
export/import services using spring

kind regards,
andreas

> 
> 
> -----Original Message-----
> From: Andreas Pieber [mailto:anpieber@gmail.com] 
> Sent: martedì 15 febbraio 2011 18:10
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> Yeah, as said: don't use new, but rather use spring-dm to export BundleBClass as a service (you have to add an interface therefore) and import it into bundleAClass
> 
> this looks then something like:
> 
> bundleBspring
> 
> <bean id="a" class="XXX" />
> <osgi:service interface="..." ref="a" />
> 
> bundleAspring
> 
> <bean id="b" class="YYY" >
> <!-- via props or autowiring; as u like--> </> <osgi:reference interace="..." id="xyz" />
> 
> kind regards,
> andreas
> 
> On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
> > I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
> > 
> > I don't need to actually get the autowired bean from bundleB. I need 
> > bundleB to do something for me (bundleA). (in the example I need 
> > BundleBClass.sayHello())
> > 
> > Gotta find a (quick) workaround to do this.
> > 
> > -----Original Message-----
> > From: Andreas Pieber [mailto:anpieber@gmail.com]
> > Sent: martedì 15 febbraio 2011 17:42
> > To: user@karaf.apache.org; Marco Firrincieli
> > Subject: Re: spring injected bean cannot be found
> > 
> > ah ok, this can't work this way... in bundlaA only the spring files in 
> > bundleA count; if you define the autowiring things in 
> > bundleA-spring-file it will work; BUT bundleA-spring-files have no 
> > idea of bundleb-spring-files... I hope it is clear what I'm pointing 
> > at... Typically you don't want to do a new XXX in bundleA but rather 
> > import a service from bundleB
> > 
> > @thread: no it isn't you also have to remove the In-Reply-To: field in 
> > the header; simply hitting reply and changing the subject does not 
> > really create a new thread :)
> > 
> > kind regards,
> > andreas
> > 
> > On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> > > Here it comes:
> > > 
> > > (I’ve tried to simplify here... hope it works)
> > > 
> > > Here’s my karaf list command output (notice all I need is in an Active state).
> > > 
> > > [51] [Active] [] [] [75] my.legacy.something.just-a-jar
> > > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans
> > > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB (1.0.0.SNAPSHOT) 
> > > [142] [Active] [] [] [70] bundleA (1.0.0.SNAPSHOT)
> > > 
> > > at some point in bundleA i have:
> > > 
> > > package my.package.bundleA
> > > 
> > > import some.class.in.bundleB.BundleBClass;
> > > 
> > > public class MyClass {
> > > 	void doStuff() {
> > > 		new BundleBClass().sayHello();
> > > 	}
> > > }
> > > 
> > > 
> > > Whereas in bundleB
> > > 
> > > package some.class.in.bundleB;
> > > 
> > > public class BundleBClass {
> > > 
> > > 	@Autowired
> > > 	private Sayer sayer;
> > > 	
> > > 	void sayHello() {
> > > 		this.sayer.say("hello");
> > > 	}
> > > }
> > > 
> > > And of course bundleB exports its BundleBClass
> > > 
> > > 
> > > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> > > 
> > > 
> > > 
> > > 
> > > Ps: @Andreas, is this not a new thread?
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> > > Sent: martedì 15 febbraio 2011 17:21
> > > To: user@karaf.apache.org; Marco Firrincieli
> > > Subject: Re: spring injected bean cannot be found
> > > 
> > > Do you use blueprint for that or pure OSGi services ?
> > > Could we have the spring file and the complete stack trace ?
> > > 
> > > Regards
> > > JB
> > > ________________________________________
> > > From: Marco Firrincieli <Ma...@lbigroup.it>
> > > Date: Tue, 15 Feb 2011 17:20:41 +0100
> > > To: user@karaf.apache.org<us...@karaf.apache.org>
> > > ReplyTo: user@karaf.apache.org
> > > Subject: spring injected bean cannot be found
> > > 
> > > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> > > 
> > > Result: nullpointerexception the (supposedly) injected bean.
> > > 
> > > Any idea? Should add something in bundleB’s manifest?
> > > 
> > > 
> > > Can’t find much googling about this.
> > > 
> > > Thanks
> > > 
> > > -m

RE: spring injected bean cannot be found

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Alright thanks so much, andreas.

I'm trying to add this spring-dm "stuff" on my spring.xml file for bundleB.

I'll probably need some spring-dm stuff on karaf too (trying to understand if I have it as "features"  already or not).

That <osgi:service you put in comes from spring-osgi namespace (which I'll to add) right?


-----Original Message-----
From: Andreas Pieber [mailto:anpieber@gmail.com] 
Sent: martedì 15 febbraio 2011 18:10
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: spring injected bean cannot be found

Yeah, as said: don't use new, but rather use spring-dm to export BundleBClass as a service (you have to add an interface therefore) and import it into bundleAClass

this looks then something like:

bundleBspring

<bean id="a" class="XXX" />
<osgi:service interface="..." ref="a" />

bundleAspring

<bean id="b" class="YYY" >
<!-- via props or autowiring; as u like--> </> <osgi:reference interace="..." id="xyz" />

kind regards,
andreas

On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
> I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
> 
> I don't need to actually get the autowired bean from bundleB. I need 
> bundleB to do something for me (bundleA). (in the example I need 
> BundleBClass.sayHello())
> 
> Gotta find a (quick) workaround to do this.
> 
> -----Original Message-----
> From: Andreas Pieber [mailto:anpieber@gmail.com]
> Sent: martedì 15 febbraio 2011 17:42
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> ah ok, this can't work this way... in bundlaA only the spring files in 
> bundleA count; if you define the autowiring things in 
> bundleA-spring-file it will work; BUT bundleA-spring-files have no 
> idea of bundleb-spring-files... I hope it is clear what I'm pointing 
> at... Typically you don't want to do a new XXX in bundleA but rather 
> import a service from bundleB
> 
> @thread: no it isn't you also have to remove the In-Reply-To: field in 
> the header; simply hitting reply and changing the subject does not 
> really create a new thread :)
> 
> kind regards,
> andreas
> 
> On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> > Here it comes:
> > 
> > (I’ve tried to simplify here... hope it works)
> > 
> > Here’s my karaf list command output (notice all I need is in an Active state).
> > 
> > [51] [Active] [] [] [75] my.legacy.something.just-a-jar
> > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans
> > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB (1.0.0.SNAPSHOT) 
> > [142] [Active] [] [] [70] bundleA (1.0.0.SNAPSHOT)
> > 
> > at some point in bundleA i have:
> > 
> > package my.package.bundleA
> > 
> > import some.class.in.bundleB.BundleBClass;
> > 
> > public class MyClass {
> > 	void doStuff() {
> > 		new BundleBClass().sayHello();
> > 	}
> > }
> > 
> > 
> > Whereas in bundleB
> > 
> > package some.class.in.bundleB;
> > 
> > public class BundleBClass {
> > 
> > 	@Autowired
> > 	private Sayer sayer;
> > 	
> > 	void sayHello() {
> > 		this.sayer.say("hello");
> > 	}
> > }
> > 
> > And of course bundleB exports its BundleBClass
> > 
> > 
> > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> > 
> > 
> > 
> > 
> > Ps: @Andreas, is this not a new thread?
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> > Sent: martedì 15 febbraio 2011 17:21
> > To: user@karaf.apache.org; Marco Firrincieli
> > Subject: Re: spring injected bean cannot be found
> > 
> > Do you use blueprint for that or pure OSGi services ?
> > Could we have the spring file and the complete stack trace ?
> > 
> > Regards
> > JB
> > ________________________________________
> > From: Marco Firrincieli <Ma...@lbigroup.it>
> > Date: Tue, 15 Feb 2011 17:20:41 +0100
> > To: user@karaf.apache.org<us...@karaf.apache.org>
> > ReplyTo: user@karaf.apache.org
> > Subject: spring injected bean cannot be found
> > 
> > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> > 
> > Result: nullpointerexception the (supposedly) injected bean.
> > 
> > Any idea? Should add something in bundleB’s manifest?
> > 
> > 
> > Can’t find much googling about this.
> > 
> > Thanks
> > 
> > -m

Re: spring injected bean cannot be found

Posted by Andreas Pieber <an...@gmail.com>.
Yeah, as said: don't use new, but rather use spring-dm to export BundleBClass as
a service (you have to add an interface therefore) and import it into
bundleAClass

this looks then something like:

bundleBspring

<bean id="a" class="XXX" />
<osgi:service interface="..." ref="a" />

bundleAspring

<bean id="b" class="YYY" >
<!-- via props or autowiring; as u like-->
</>
<osgi:reference interace="..." id="xyz" />

kind regards,
andreas

On Tue, Feb 15, 2011 at 06:08:59PM +0100, Marco Firrincieli wrote:
> I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).
> 
> I don't need to actually get the autowired bean from bundleB. I need bundleB to do something for me (bundleA). (in the example I need BundleBClass.sayHello())
> 
> Gotta find a (quick) workaround to do this.
> 
> -----Original Message-----
> From: Andreas Pieber [mailto:anpieber@gmail.com] 
> Sent: martedì 15 febbraio 2011 17:42
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> ah ok, this can't work this way... in bundlaA only the spring files in bundleA count; if you define the autowiring things in bundleA-spring-file it will work; BUT bundleA-spring-files have no idea of bundleb-spring-files... I hope it is clear what I'm pointing at... Typically you don't want to do a new XXX in bundleA but rather import a service from bundleB
> 
> @thread: no it isn't you also have to remove the In-Reply-To: field in the header; simply hitting reply and changing the subject does not really create a new thread :)
> 
> kind regards,
> andreas
> 
> On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> > Here it comes:
> > 
> > (I’ve tried to simplify here... hope it works)
> > 
> > Here’s my karaf list command output (notice all I need is in an Active state).
> > 
> > [51] [Active] [] [] [75] my.legacy.something.just-a-jar 
> > (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans 
> > (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB (1.0.0.SNAPSHOT) 
> > [142] [Active] [] [] [70] bundleA (1.0.0.SNAPSHOT)
> > 
> > at some point in bundleA i have:
> > 
> > package my.package.bundleA
> > 
> > import some.class.in.bundleB.BundleBClass;
> > 
> > public class MyClass {
> > 	void doStuff() {
> > 		new BundleBClass().sayHello();
> > 	}
> > }
> > 
> > 
> > Whereas in bundleB
> > 
> > package some.class.in.bundleB;
> > 
> > public class BundleBClass {
> > 
> > 	@Autowired
> > 	private Sayer sayer;
> > 	
> > 	void sayHello() {
> > 		this.sayer.say("hello");
> > 	}
> > }
> > 
> > And of course bundleB exports its BundleBClass
> > 
> > 
> > I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> > 
> > 
> > 
> > 
> > Ps: @Andreas, is this not a new thread?
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> > Sent: martedì 15 febbraio 2011 17:21
> > To: user@karaf.apache.org; Marco Firrincieli
> > Subject: Re: spring injected bean cannot be found
> > 
> > Do you use blueprint for that or pure OSGi services ?
> > Could we have the spring file and the complete stack trace ?
> > 
> > Regards
> > JB
> > ________________________________________
> > From: Marco Firrincieli <Ma...@lbigroup.it>
> > Date: Tue, 15 Feb 2011 17:20:41 +0100
> > To: user@karaf.apache.org<us...@karaf.apache.org>
> > ReplyTo: user@karaf.apache.org
> > Subject: spring injected bean cannot be found
> > 
> > One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> > 
> > Result: nullpointerexception the (supposedly) injected bean.
> > 
> > Any idea? Should add something in bundleB’s manifest?
> > 
> > 
> > Can’t find much googling about this.
> > 
> > Thanks
> > 
> > -m

RE: spring injected bean cannot be found

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
I figured there must be a way to get a service from bundleB and IF that service needs something (something he owns!) then I thought it could be perfectly able to get it from its own spring context (that is 'wiring" it to itself).

I don't need to actually get the autowired bean from bundleB. I need bundleB to do something for me (bundleA). (in the example I need BundleBClass.sayHello())

Gotta find a (quick) workaround to do this.

-----Original Message-----
From: Andreas Pieber [mailto:anpieber@gmail.com] 
Sent: martedì 15 febbraio 2011 17:42
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: spring injected bean cannot be found

ah ok, this can't work this way... in bundlaA only the spring files in bundleA count; if you define the autowiring things in bundleA-spring-file it will work; BUT bundleA-spring-files have no idea of bundleb-spring-files... I hope it is clear what I'm pointing at... Typically you don't want to do a new XXX in bundleA but rather import a service from bundleB

@thread: no it isn't you also have to remove the In-Reply-To: field in the header; simply hitting reply and changing the subject does not really create a new thread :)

kind regards,
andreas

On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> Here it comes:
> 
> (I’ve tried to simplify here... hope it works)
> 
> Here’s my karaf list command output (notice all I need is in an Active state).
> 
> [51] [Active] [] [] [75] my.legacy.something.just-a-jar 
> (1.0.0.SNAPSHOT) [105] [Active] [] [] [70] some.domain.beans 
> (1.0.0.SNAPSHOT) [142] [Active] [] [] [70] bundleB (1.0.0.SNAPSHOT) 
> [142] [Active] [] [] [70] bundleA (1.0.0.SNAPSHOT)
> 
> at some point in bundleA i have:
> 
> package my.package.bundleA
> 
> import some.class.in.bundleB.BundleBClass;
> 
> public class MyClass {
> 	void doStuff() {
> 		new BundleBClass().sayHello();
> 	}
> }
> 
> 
> Whereas in bundleB
> 
> package some.class.in.bundleB;
> 
> public class BundleBClass {
> 
> 	@Autowired
> 	private Sayer sayer;
> 	
> 	void sayHello() {
> 		this.sayer.say("hello");
> 	}
> }
> 
> And of course bundleB exports its BundleBClass
> 
> 
> I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> 
> 
> 
> 
> Ps: @Andreas, is this not a new thread?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> From: jb@nanthrax.net [mailto:jb@nanthrax.net]
> Sent: martedì 15 febbraio 2011 17:21
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> Do you use blueprint for that or pure OSGi services ?
> Could we have the spring file and the complete stack trace ?
> 
> Regards
> JB
> ________________________________________
> From: Marco Firrincieli <Ma...@lbigroup.it>
> Date: Tue, 15 Feb 2011 17:20:41 +0100
> To: user@karaf.apache.org<us...@karaf.apache.org>
> ReplyTo: user@karaf.apache.org
> Subject: spring injected bean cannot be found
> 
> One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> 
> Result: nullpointerexception the (supposedly) injected bean.
> 
> Any idea? Should add something in bundleB’s manifest?
> 
> 
> Can’t find much googling about this.
> 
> Thanks
> 
> -m

Re: spring injected bean cannot be found

Posted by Andreas Pieber <an...@gmail.com>.
ah ok, this can't work this way... in bundlaA only the spring files in bundleA
count; if you define the autowiring things in bundleA-spring-file it will work;
BUT bundleA-spring-files have no idea of bundleb-spring-files... I hope it is
clear what I'm pointing at... Typically you don't want to do a new XXX in
bundleA but rather import a service from bundleB

@thread: no it isn't you also have to remove the In-Reply-To: field in the
header; simply hitting reply and changing the subject does not really create a
new thread :)

kind regards,
andreas

On Tue, Feb 15, 2011 at 05:41:33PM +0100, Marco Firrincieli wrote:
> Here it comes:
> 
> (I’ve tried to simplify here... hope it works)
> 
> Here’s my karaf list command output (notice all I need is in an Active state).
> 
> [51] [Active] [] [] [75] my.legacy.something.just-a-jar (1.0.0.SNAPSHOT)
> [105] [Active] [] [] [70] some.domain.beans (1.0.0.SNAPSHOT)
> [142] [Active] [] [] [70] bundleB (1.0.0.SNAPSHOT)
> [142] [Active] [] [] [70] bundleA (1.0.0.SNAPSHOT)
> 
> at some point in bundleA i have:
> 
> package my.package.bundleA
> 
> import some.class.in.bundleB.BundleBClass;
> 
> public class MyClass {
> 	void doStuff() {
> 		new BundleBClass().sayHello();
> 	}
> }
> 
> 
> Whereas in bundleB
> 
> package some.class.in.bundleB;
> 
> public class BundleBClass {
> 
> 	@Autowired
> 	private Sayer sayer;
> 	
> 	void sayHello() {
> 		this.sayer.say("hello");
> 	}
> }
> 
> And of course bundleB exports its BundleBClass
> 
> 
> I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.
> 
> 
> 
> 
> Ps: @Andreas, is this not a new thread?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> From: jb@nanthrax.net [mailto:jb@nanthrax.net] 
> Sent: martedì 15 febbraio 2011 17:21
> To: user@karaf.apache.org; Marco Firrincieli
> Subject: Re: spring injected bean cannot be found
> 
> Do you use blueprint for that or pure OSGi services ?
> Could we have the spring file and the complete stack trace ?
> 
> Regards
> JB
> ________________________________________
> From: Marco Firrincieli <Ma...@lbigroup.it> 
> Date: Tue, 15 Feb 2011 17:20:41 +0100
> To: user@karaf.apache.org<us...@karaf.apache.org>
> ReplyTo: user@karaf.apache.org 
> Subject: spring injected bean cannot be found
> 
> One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.
> 
> Result: nullpointerexception the (supposedly) injected bean.
> 
> Any idea? Should add something in bundleB’s manifest?
> 
> 
> Can’t find much googling about this.
> 
> Thanks
> 
> -m

RE: spring injected bean cannot be found

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Here it comes:

(I’ve tried to simplify here... hope it works)

Here’s my karaf list command output (notice all I need is in an Active state).

[51] [Active] [] [] [75] my.legacy.something.just-a-jar (1.0.0.SNAPSHOT)
[105] [Active] [] [] [70] some.domain.beans (1.0.0.SNAPSHOT)
[142] [Active] [] [] [70] bundleB (1.0.0.SNAPSHOT)
[142] [Active] [] [] [70] bundleA (1.0.0.SNAPSHOT)

at some point in bundleA i have:

package my.package.bundleA

import some.class.in.bundleB.BundleBClass;

public class MyClass {
	void doStuff() {
		new BundleBClass().sayHello();
	}
}


Whereas in bundleB

package some.class.in.bundleB;

public class BundleBClass {

	@Autowired
	private Sayer sayer;
	
	void sayHello() {
		this.sayer.say("hello");
	}
}

And of course bundleB exports its BundleBClass


I’ve got a wonderful nullpointer in sayHello method because "sayer" is null. The autowired doesn’t seem to work.




Ps: @Andreas, is this not a new thread?













From: jb@nanthrax.net [mailto:jb@nanthrax.net] 
Sent: martedì 15 febbraio 2011 17:21
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: spring injected bean cannot be found

Do you use blueprint for that or pure OSGi services ?
Could we have the spring file and the complete stack trace ?

Regards
JB
________________________________________
From: Marco Firrincieli <Ma...@lbigroup.it> 
Date: Tue, 15 Feb 2011 17:20:41 +0100
To: user@karaf.apache.org<us...@karaf.apache.org>
ReplyTo: user@karaf.apache.org 
Subject: spring injected bean cannot be found

One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.

Result: nullpointerexception the (supposedly) injected bean.

Any idea? Should add something in bundleB’s manifest?


Can’t find much googling about this.

Thanks

-m

Re: spring injected bean cannot be found

Posted by jb...@nanthrax.net.
Do you use blueprint for that or pure OSGi services ?
Could we have the spring file and the complete stack trace ?

Regards
JB
-----Original Message-----
From: Marco Firrincieli <Ma...@lbigroup.it>
Date: Tue, 15 Feb 2011 17:20:41 
To: user@karaf.apache.org<us...@karaf.apache.org>
Reply-To: user@karaf.apache.org
Subject: spring injected bean cannot be found

One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.

Result: nullpointerexception the (supposedly) injected bean.

Any idea? Should add something in bundleB’s manifest?


Can’t find much googling about this.

Thanks

-m

spring injected bean cannot be found

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
One of my bundles (call it bundleA) instantiate a new Stuff() and this Stuff is another bundle (bundleB) (already up and running) and has a Spring autowired bean.

Result: nullpointerexception the (supposedly) injected bean.

Any idea? Should add something in bundleB’s manifest?


Can’t find much googling about this.

Thanks

-m

RE: newbie question: karaf always running

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Thanks a lot

From: Andreas Pieber [mailto:anpieber@gmail.com]
Sent: martedì 15 febbraio 2011 13:10
To: user@karaf.apache.org; Marco Firrincieli
Subject: Re: newbie question: karaf always running


simply use the start script instead of karaf

kind regards
Andreas
On Feb 15, 2011 1:00 PM, "Marco Firrincieli" <Ma...@lbigroup.it>> wrote:
> Seems like everytime i type "karaf" I start it AND run the console. Then "logout" actually shuts everything down.
>
> How can I have it ALWAYS running and get in and out of the console?
>

Re: newbie question: karaf always running

Posted by Andreas Pieber <an...@gmail.com>.
simply use the start script instead of karaf

kind regards
Andreas
On Feb 15, 2011 1:00 PM, "Marco Firrincieli" <Ma...@lbigroup.it>
wrote:
> Seems like everytime i type "karaf" I start it AND run the console. Then
"logout" actually shuts everything down.
>
> How can I have it ALWAYS running and get in and out of the console?
>

newbie question: karaf always running

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Seems like everytime i type "karaf" I start it AND run the console. Then "logout" actually shuts everything down.

How can I have it ALWAYS running and get in and out of the console?


Re: newbie question: hibernate-core bundle (with deps)

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

to be honest, from what I experienced the spring-hibernate jars don't
really work :(

what I have done before is to wrap up a bundle containing all the
required hibernate jars and exporting all needed classes.

The DAO-Classes needed a special handling. We did a aop wrapping
around setting the Thread.contextClassloader to the bundle
classloader. With that it did run more smoothly :)
I think there is a blog of Peter Kriens about this.

Another thing would be to use OpenJPA as provider, that should work
out better :)

Regards, Achim

2011/2/11 Marco Firrincieli <Ma...@lbigroup.it>:
> Hi all,
>
> i've only started "now" working on making a legacy application deployable on karaf.
> Right now I'm fighting de-coupling a few things, and I've come to find a strong dependency with hibernate.
>
> Googling around couldn't really come up with the correct "way to do", so that's why I'm asking.
>
> I found out that spring sort or releases the bundle for hibernate (com.springsource.org.hibernate) but when I deploy it on karaf, it still says I miss so many other stuff.
>
> Any "easy" way to have it all without looking for every little dependencies here and there?
>
> Thanks
>
> -m
>

newbie question: hibernate-core bundle (with deps)

Posted by Marco Firrincieli <Ma...@lbigroup.it>.
Hi all,

i've only started "now" working on making a legacy application deployable on karaf.
Right now I'm fighting de-coupling a few things, and I've come to find a strong dependency with hibernate.

Googling around couldn't really come up with the correct "way to do", so that's why I'm asking.

I found out that spring sort or releases the bundle for hibernate (com.springsource.org.hibernate) but when I deploy it on karaf, it still says I miss so many other stuff.

Any "easy" way to have it all without looking for every little dependencies here and there?

Thanks

-m

Re: Apache Karaf & WAR + JSF

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

basically I just used the example from
https://issues.apache.org/jira/browse/MYFACES-2290
as starting point.
I didn't pay attention on the manifest header while testing. I was
glad I had a "running" test to
verify the jsf feature. It was probably needed because of some
classloader issues that where still
open with a previous version of myfaces.

But you are right I probably should have paid more attention to it and
it would be better to use import-package.

Regards, Achim



2011/2/14 Charles Moulliard <cm...@gmail.com>:
> Hi Achim,
>
> In your example, you do not import javax.faces but use requires bundles
>
> Bundle-ClassPath =
> .,WEB-INF/classes,WEB-INF/classes/META-INF/myfaces_core.tld,WEB-INF/classes/META-INF/myfaces_html.tld
>
> Import-Package =
>        javax.servlet;version=2.5.0,
>        javax.servlet.http;version=2.5.0,
>        javax.servlet.resources;version=2.1.0,
>        javax.servlet.jsp;version=2.1.0,
>        javax.servlet.jsp.jstl.core;version=1.1.2,
>        javax.servlet.jsp.jstl.fmt;version=1.1.2,
>        javax.servlet.jsp.jstl.tlv;version=1.1.2,
>        org.apache.taglibs.standard.resources;version=1.1.2,
>        org.apache.taglibs.standard.tag.common.core;version=1.1.2,
>        org.apache.taglibs.standard.tag.rt.core;version=1.1.2,
>        org.apache.taglibs.standard.tei;version=1.1.2,
>        org.apache.taglibs.standard.tlv;version=1.1.2
> Require-Bundle =
>        org.apache.myfaces.core.api,
>        org.apache.myfaces.core.impl
>
> Why don't you import javax.faces classes ?
>
> Here is the MANIFEST file generated for my example
>
> prime-showcase (1979)
> ---------------------
> Archiver-Version = Plexus Archiver
> Tool = Bnd-0.0.313
> Hudson-Project = Examples - Showcase
> Implementation-Version = 1.0.0-SNAPSHOT
> Build-Jdk = 1.6.0_13
> Generated-By-Ops4j-Pax-From =
> wrap:jardir:/Users/charlesmoulliard/Apache/karaf/assembly/target/apache-karaf-2.1.99-SNAPSHOT/deploy/prime-showcase$Bundle-SymbolicName=prime-showcase&Bundle-Version=0.0.0
> Created-By = 1.6.0_22 (Apple Inc.)
> Implementation-Title = prime-showcase
> Manifest-Version = 1.0
> Bnd-LastModified = 1297674544776
> Originally-Created-By = Apache Maven
> Hudson-Version = 1.336
> Built-By = tomcat6
> Extension-Name = prime-showcase
> Hudson-Build-Number = 248
>
> Bundle-Name = prime-showcase
> Bundle-SymbolicName = prime-showcase
> Bundle-Version = 0.0.0
> Bundle-ManifestVersion = 2
>
> Private-Package =
>        .
> Import-Package =
>        WEB-INF;resolution:=optional,
>        WEB-INF.classes.org.primefaces.examples;resolution:=optional,
>        WEB-INF.classes.org.primefaces.examples.domain;resolution:=optional,
>        WEB-INF.classes.org.primefaces.examples.filter;resolution:=optional,
>        WEB-INF.classes.org.primefaces.examples.service;resolution:=optional,
>        WEB-INF.classes.org.primefaces.examples.touch;resolution:=optional,
>        WEB-INF.classes.org.primefaces.examples.view;resolution:=optional,
>        WEB-INF.lib;resolution:=optional,
>        com.lowagie.text;resolution:=optional,
>        com.sun.syndication.feed.synd;resolution:=optional,
>        com.sun.syndication.io;resolution:=optional,
>        css;resolution:=optional,
>        design;resolution:=optional,
>        facestrace;resolution:=optional,
>        images;resolution:=optional,
>        images.antalya;resolution:=optional,
>        images.barca;resolution:=optional,
>        images.cars;resolution:=optional,
>        images.dock;resolution:=optional,
>        images.folders;resolution:=optional,
>        images.galleria;resolution:=optional,
>        images.godfather;resolution:=optional,
>        images.layout;resolution:=optional,
>        images.macosx;resolution:=optional,
>        images.picklist;resolution:=optional,
>        images.stack;resolution:=optional,
>        images.touch;resolution:=optional,
>        javax.annotation;resolution:=optional,
>        javax.faces.application;resolution:=optional,
>        javax.faces.component;resolution:=optional,
>        javax.faces.context;resolution:=optional,
>        javax.faces.convert;resolution:=optional,
>        javax.faces.event;resolution:=optional,
>        javax.faces.model;resolution:=optional,
>        javax.imageio.stream;resolution:=optional,
>        javax.servlet;resolution:=optional,
>        net.sourceforge.barbecue;resolution:=optional,
>        org.apache.poi.hssf.usermodel;resolution:=optional,
>        org.jfree.chart;resolution:=optional,
>        org.jfree.data.general;resolution:=optional,
>        org.primefaces.comet;resolution:=optional,
>        org.primefaces.component.chart.series;resolution:=optional,
>        org.primefaces.component.menuitem;resolution:=optional,
>        org.primefaces.component.submenu;resolution:=optional,
>        org.primefaces.component.tabview;resolution:=optional,
>        org.primefaces.context;resolution:=optional,
>        org.primefaces.event;resolution:=optional,
>        org.primefaces.event.map;resolution:=optional,
>        org.primefaces.examples.domain;resolution:=optional,
>        org.primefaces.examples.filter;resolution:=optional,
>        org.primefaces.examples.service;resolution:=optional,
>        org.primefaces.examples.touch;resolution:=optional,
>        org.primefaces.examples.view;resolution:=optional,
>        org.primefaces.model;resolution:=optional,
>        org.primefaces.model.chart;resolution:=optional,
>        org.primefaces.model.map;resolution:=optional,
>        syntaxhighlighter.scripts;resolution:=optional,
>        syntaxhighlighter.styles;resolution:=optional,
>        templates;resolution:=optional,
>        touch;resolution:=optional,
>        ui;resolution:=optional,
>        ui.sopranos;resolution:=optional
> Export-Package =
>        WEB-INF,
>        WEB-INF.classes.org.primefaces.examples,
>        WEB-INF.classes.org.primefaces.examples.domain;uses:=org.primefaces.examples.domain,
>        WEB-INF.classes.org.primefaces.examples.filter;uses:="javax.servlet,org.primefaces.examples.filter",
>        WEB-INF.classes.org.primefaces.examples.service;uses:="org.primefaces.examples.service,org.primefaces.examples.domain,com.sun.syndication.feed.synd,com.sun.syndication.io",
>        WEB-INF.classes.org.primefaces.examples.touch;uses:="org.primefaces.examples.service,org.primefaces.examples.domain,javax.faces.context,org.primefaces.examples.touch,javax.faces.event",
>        WEB-INF.classes.org.primefaces.examples.view;
>                uses:="org.primefaces.examples.domain,
>                        javax.faces.application,
>                        javax.faces.context,
>                        org.primefaces.event,
>                        org.primefaces.examples.view,
>                        javax.faces.event,
>                        org.primefaces.component.chart.series,
>                        org.primefaces.model.chart,
>                        org.primefaces.comet,
>                        javax.faces.component,
>                        javax.faces.convert,
>                        org.primefaces.examples.service,
>                        org.primefaces.model,
>                        org.jfree.data.general,
>                        org.jfree.chart,
>                        net.sourceforge.barbecue,
>                        org.primefaces.context,
>                        javax.annotation,
>                        javax.servlet,
>                        javax.imageio.stream,
>                        org.primefaces.event.map,
>                        org.primefaces.model.map,
>                        org.primefaces.component.menuitem,
>                        org.primefaces.component.submenu,
>                        org.primefaces.component.tabview,
>                        javax.faces.model,
>                        org.apache.poi.hssf.usermodel,
>                        com.lowagie.text",
>        WEB-INF.lib,
>        css,
>        design,
>        facestrace,
>        images,
>        images.antalya,
>        images.barca,
>        images.cars,
>        images.dock,
>        images.folders,
>        images.galleria,
>        images.godfather,
>        images.layout,
>        images.macosx,
>        images.picklist,
>        images.stack,
>        images.touch,
>        org.primefaces.examples.domain,
>        org.primefaces.examples.filter,
>        org.primefaces.examples.service,
>        org.primefaces.examples.touch,
>        org.primefaces.examples.view,
>        syntaxhighlighter.scripts,
>        syntaxhighlighter.styles,
>        templates,
>        touch,
>        ui,
>        ui.sopranos
>
> Where faces classes are loaded in the lib folder. I think that the
> issue is there dues to classloading issue  ....
>
> Regards,
>
> Charles Moulliard
>
> Sr. Principal Solution Architect - FuseSource
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>
>
>
> On Sat, Feb 12, 2011 at 9:21 PM, Achim Nierbeck <bc...@googlemail.com> wrote:
>> I attached myfaces-test-helloworld-osgi-pax-web.war
>>
>> that did work for me and I tested the jsf functionalities with it.
>>
>> The following steps were also needed in karaf shell (just verified once
>> more with Karaf-2.99.99-SNAPSHOT):
>>
>> install mvn:org.apache.myfaces.core/myfaces-api/1.2.9
>> install mvn:org.apache.myfaces.core/myfaces-impl/1.2.9
>> install mvn:commons-beanutils/commons-beanutils/1.8.3
>> install mvn:commons-collections/commons-collections/3.2.1
>> install mvn:commons-codec/commons-codec/1.4
>> install
>> mvn:org.apache.commons/com.springsource.org.apache.commons.digester/1.8.0
>> install
>> mvn:org.apache.commons/com.springsource.org.apache.commons.discovery/0.4.0
>>
>> Now the attached myfaces-test-helloworld-osgi.war is started and deployed
>> And running, there is some sort of variable replacement issue with this test
>> but in principle I think it is working :)
>>
>> Regards, Achim
>>
>>
>>> I have removed everything and still get the same error from the war
>>> containing all the jars file.
>>>
>>> karaf@root> packages:exports | grep javax.faces
>>> karaf@root> packages:exports | grep jsf
>>>   1929 org.springframework.web.jsf
>>>   1929 org.springframework.web.jsf.el
>>>
>>> 10:42:36,444 | WARN  | FelixStartLevel  | /prime-showcase-1
>>>     | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>> java.lang.IllegalStateException: Application was not properly
>>> initialized at startup, could not find Factory:
>>> javax.faces.context.FacesContextFactory
>>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1958:prime-showcase-1:0]
>>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1958:prime-showcase-1:0]
>>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1958:prime-showcase-1:0]
>>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>
>>>
>>> On Fri, Feb 11, 2011 at 9:26 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>>> Could you make:
>>>>
>>>> la|grep -i jsf
>>>>
>>>> to see if JSF api and implementation are not outside your bundle.
>>>> Else you have to use fragment to gather all in the same classloader.
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 02/11/2011 09:22 AM, Charles Moulliard wrote:
>>>>> The WAR contains the spec and the implementation.
>>>>>
>>>>> aristo-1.0.0.jar
>>>>> barbecue-1.5-beta1.jar
>>>>> bcmail-jdk14-1.38.jar
>>>>> bcmail-jdk14-138.jar
>>>>> bcprov-jdk14-1.38.jar
>>>>> bcprov-jdk14-138.jar
>>>>> bctsp-jdk14-1.38.jar
>>>>> black-tie-1.0.0.jar
>>>>> blitzer-1.0.0.jar
>>>>> bluesky-1.0.0.jar
>>>>> casablanca-1.0.0.jar
>>>>> commons-fileupload-1.2.1.jar
>>>>> commons-io-1.4.jar
>>>>> commons-logging-1.1.1.jar
>>>>> cupertino-1.0.0.jar
>>>>> dark-hive-1.0.0.jar
>>>>> dot-luv-1.0.0.jar
>>>>> eggplant-1.0.0.jar
>>>>> excite-bike-1.0.0.jar
>>>>> facestrace-1.1.0.jar
>>>>> flick-1.0.0.jar
>>>>> hot-sneaks-1.0.0.jar
>>>>> humanity-1.0.0.jar
>>>>> itext-2.1.7.jar
>>>>> jcommon-1.0.0.jar
>>>>> jdom-1.0.jar
>>>>> jfreechart-1.0.0.jar
>>>>>
>>>>> -->
>>>>> jsf-api-2.0.4-b09.jar
>>>>> jsf-impl-2.0.4-b09.jar
>>>>> -->
>>>>>
>>>>> jstl-1.2.jar
>>>>> junit-3.8.jar
>>>>> le-frog-1.0.0.jar
>>>>> log4j-1.2.13.jar
>>>>> midnight-1.0.0.jar
>>>>> mint-choc-1.0.0.jar
>>>>> overcast-1.0.0.jar
>>>>> pepper-grinder-1.0.0.jar
>>>>> poi-3.2-FINAL.jar
>>>>> primefaces-3.0-SNAPSHOT.jar
>>>>> redmond-1.0.0.jar
>>>>> rocket-1.0.0.jar
>>>>> rome-1.0.jar
>>>>> smoothness-1.0.0.jar
>>>>> south-street-1.0.0.jar
>>>>> start-1.0.0.jar
>>>>> sunny-1.0.0.jar
>>>>> swanky-purse-1.0.0.jar
>>>>> trontastic-1.0.0.jar
>>>>> ui-darkness-1.0.0.jar
>>>>> ui-lightness-1.0.0.jar
>>>>> vader-1.0.0.jar
>>>>>
>>>>>
>>>>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks<da...@yahoo.com>
>>>>>  wrote:
>>>>>> You need both the api jar and the implementation in your war.  Which jsf
>>>>>> implementation?
>>>>>>
>>>>>> You might consider trying myfaces-bundle deployed outside your web app
>>>>>> (removing jsf jars from the web app). This works find in geronimo but I'm
>>>>>> not sure at the moment if we do extra initialization to get around this
>>>>>> problem.
>>>>>>
>>>>>>
>>>>>> thanks
>>>>>> david jencks
>>>>>>
>>>>>>
>>>>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>>>>> but get this issue :
>>>>>>>
>>>>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>>>>> java.lang.IllegalStateException: Application was not properly
>>>>>>> initialized at startup, could not find Factory:
>>>>>>> javax.faces.context.FacesContextFactory
>>>>>>>       at
>>>>>>> javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>>       at
>>>>>>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>>       at
>>>>>>> javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>>       at
>>>>>>> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>>>       at
>>>>>>> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>>>       at
>>>>>>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>>>>
>>>>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>>>>> jsf-api-2.0.4-b09
>>>>>>>
>>>>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>>>>
>>>>>>> Is it something that you already experienced ?
>>>>>>>
>>>>>>> Regards,
>>>>>>>
>>>>>>> Charles Moulliard
>>>>>>>
>>>>>>> Sr. Principal Solution Architect - FuseSource
>>>>>>> Apache Committer
>>>>>>>
>>>>>>> Blog : http://cmoulliard.blogspot.com
>>>>>>> Twitter : http://twitter.com/cmoulliard
>>>>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>>>>> Skype: cmoulliard
>>>>>>
>>
>>
>

Re: Apache Karaf & WAR + JSF

Posted by Charles Moulliard <cm...@gmail.com>.
Hi Achim,

In your example, you do not import javax.faces but use requires bundles

Bundle-ClassPath =
.,WEB-INF/classes,WEB-INF/classes/META-INF/myfaces_core.tld,WEB-INF/classes/META-INF/myfaces_html.tld

Import-Package =
	javax.servlet;version=2.5.0,
	javax.servlet.http;version=2.5.0,
	javax.servlet.resources;version=2.1.0,
	javax.servlet.jsp;version=2.1.0,
	javax.servlet.jsp.jstl.core;version=1.1.2,
	javax.servlet.jsp.jstl.fmt;version=1.1.2,
	javax.servlet.jsp.jstl.tlv;version=1.1.2,
	org.apache.taglibs.standard.resources;version=1.1.2,
	org.apache.taglibs.standard.tag.common.core;version=1.1.2,
	org.apache.taglibs.standard.tag.rt.core;version=1.1.2,
	org.apache.taglibs.standard.tei;version=1.1.2,
	org.apache.taglibs.standard.tlv;version=1.1.2
Require-Bundle =
	org.apache.myfaces.core.api,
	org.apache.myfaces.core.impl

Why don't you import javax.faces classes ?

Here is the MANIFEST file generated for my example

prime-showcase (1979)
---------------------
Archiver-Version = Plexus Archiver
Tool = Bnd-0.0.313
Hudson-Project = Examples - Showcase
Implementation-Version = 1.0.0-SNAPSHOT
Build-Jdk = 1.6.0_13
Generated-By-Ops4j-Pax-From =
wrap:jardir:/Users/charlesmoulliard/Apache/karaf/assembly/target/apache-karaf-2.1.99-SNAPSHOT/deploy/prime-showcase$Bundle-SymbolicName=prime-showcase&Bundle-Version=0.0.0
Created-By = 1.6.0_22 (Apple Inc.)
Implementation-Title = prime-showcase
Manifest-Version = 1.0
Bnd-LastModified = 1297674544776
Originally-Created-By = Apache Maven
Hudson-Version = 1.336
Built-By = tomcat6
Extension-Name = prime-showcase
Hudson-Build-Number = 248

Bundle-Name = prime-showcase
Bundle-SymbolicName = prime-showcase
Bundle-Version = 0.0.0
Bundle-ManifestVersion = 2

Private-Package =
	.
Import-Package =
	WEB-INF;resolution:=optional,
	WEB-INF.classes.org.primefaces.examples;resolution:=optional,
	WEB-INF.classes.org.primefaces.examples.domain;resolution:=optional,
	WEB-INF.classes.org.primefaces.examples.filter;resolution:=optional,
	WEB-INF.classes.org.primefaces.examples.service;resolution:=optional,
	WEB-INF.classes.org.primefaces.examples.touch;resolution:=optional,
	WEB-INF.classes.org.primefaces.examples.view;resolution:=optional,
	WEB-INF.lib;resolution:=optional,
	com.lowagie.text;resolution:=optional,
	com.sun.syndication.feed.synd;resolution:=optional,
	com.sun.syndication.io;resolution:=optional,
	css;resolution:=optional,
	design;resolution:=optional,
	facestrace;resolution:=optional,
	images;resolution:=optional,
	images.antalya;resolution:=optional,
	images.barca;resolution:=optional,
	images.cars;resolution:=optional,
	images.dock;resolution:=optional,
	images.folders;resolution:=optional,
	images.galleria;resolution:=optional,
	images.godfather;resolution:=optional,
	images.layout;resolution:=optional,
	images.macosx;resolution:=optional,
	images.picklist;resolution:=optional,
	images.stack;resolution:=optional,
	images.touch;resolution:=optional,
	javax.annotation;resolution:=optional,
	javax.faces.application;resolution:=optional,
	javax.faces.component;resolution:=optional,
	javax.faces.context;resolution:=optional,
	javax.faces.convert;resolution:=optional,
	javax.faces.event;resolution:=optional,
	javax.faces.model;resolution:=optional,
	javax.imageio.stream;resolution:=optional,
	javax.servlet;resolution:=optional,
	net.sourceforge.barbecue;resolution:=optional,
	org.apache.poi.hssf.usermodel;resolution:=optional,
	org.jfree.chart;resolution:=optional,
	org.jfree.data.general;resolution:=optional,
	org.primefaces.comet;resolution:=optional,
	org.primefaces.component.chart.series;resolution:=optional,
	org.primefaces.component.menuitem;resolution:=optional,
	org.primefaces.component.submenu;resolution:=optional,
	org.primefaces.component.tabview;resolution:=optional,
	org.primefaces.context;resolution:=optional,
	org.primefaces.event;resolution:=optional,
	org.primefaces.event.map;resolution:=optional,
	org.primefaces.examples.domain;resolution:=optional,
	org.primefaces.examples.filter;resolution:=optional,
	org.primefaces.examples.service;resolution:=optional,
	org.primefaces.examples.touch;resolution:=optional,
	org.primefaces.examples.view;resolution:=optional,
	org.primefaces.model;resolution:=optional,
	org.primefaces.model.chart;resolution:=optional,
	org.primefaces.model.map;resolution:=optional,
	syntaxhighlighter.scripts;resolution:=optional,
	syntaxhighlighter.styles;resolution:=optional,
	templates;resolution:=optional,
	touch;resolution:=optional,
	ui;resolution:=optional,
	ui.sopranos;resolution:=optional
Export-Package =
	WEB-INF,
	WEB-INF.classes.org.primefaces.examples,
	WEB-INF.classes.org.primefaces.examples.domain;uses:=org.primefaces.examples.domain,
	WEB-INF.classes.org.primefaces.examples.filter;uses:="javax.servlet,org.primefaces.examples.filter",
	WEB-INF.classes.org.primefaces.examples.service;uses:="org.primefaces.examples.service,org.primefaces.examples.domain,com.sun.syndication.feed.synd,com.sun.syndication.io",
	WEB-INF.classes.org.primefaces.examples.touch;uses:="org.primefaces.examples.service,org.primefaces.examples.domain,javax.faces.context,org.primefaces.examples.touch,javax.faces.event",
	WEB-INF.classes.org.primefaces.examples.view;
		uses:="org.primefaces.examples.domain,
			javax.faces.application,
			javax.faces.context,
			org.primefaces.event,
			org.primefaces.examples.view,
			javax.faces.event,
			org.primefaces.component.chart.series,
			org.primefaces.model.chart,
			org.primefaces.comet,
			javax.faces.component,
			javax.faces.convert,
			org.primefaces.examples.service,
			org.primefaces.model,
			org.jfree.data.general,
			org.jfree.chart,
			net.sourceforge.barbecue,
			org.primefaces.context,
			javax.annotation,
			javax.servlet,
			javax.imageio.stream,
			org.primefaces.event.map,
			org.primefaces.model.map,
			org.primefaces.component.menuitem,
			org.primefaces.component.submenu,
			org.primefaces.component.tabview,
			javax.faces.model,
			org.apache.poi.hssf.usermodel,
			com.lowagie.text",
	WEB-INF.lib,
	css,
	design,
	facestrace,
	images,
	images.antalya,
	images.barca,
	images.cars,
	images.dock,
	images.folders,
	images.galleria,
	images.godfather,
	images.layout,
	images.macosx,
	images.picklist,
	images.stack,
	images.touch,
	org.primefaces.examples.domain,
	org.primefaces.examples.filter,
	org.primefaces.examples.service,
	org.primefaces.examples.touch,
	org.primefaces.examples.view,
	syntaxhighlighter.scripts,
	syntaxhighlighter.styles,
	templates,
	touch,
	ui,
	ui.sopranos

Where faces classes are loaded in the lib folder. I think that the
issue is there dues to classloading issue  ....

Regards,

Charles Moulliard

Sr. Principal Solution Architect - FuseSource
Apache Committer

Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard



On Sat, Feb 12, 2011 at 9:21 PM, Achim Nierbeck <bc...@googlemail.com> wrote:
> I attached myfaces-test-helloworld-osgi-pax-web.war
>
> that did work for me and I tested the jsf functionalities with it.
>
> The following steps were also needed in karaf shell (just verified once
> more with Karaf-2.99.99-SNAPSHOT):
>
> install mvn:org.apache.myfaces.core/myfaces-api/1.2.9
> install mvn:org.apache.myfaces.core/myfaces-impl/1.2.9
> install mvn:commons-beanutils/commons-beanutils/1.8.3
> install mvn:commons-collections/commons-collections/3.2.1
> install mvn:commons-codec/commons-codec/1.4
> install
> mvn:org.apache.commons/com.springsource.org.apache.commons.digester/1.8.0
> install
> mvn:org.apache.commons/com.springsource.org.apache.commons.discovery/0.4.0
>
> Now the attached myfaces-test-helloworld-osgi.war is started and deployed
> And running, there is some sort of variable replacement issue with this test
> but in principle I think it is working :)
>
> Regards, Achim
>
>
>> I have removed everything and still get the same error from the war
>> containing all the jars file.
>>
>> karaf@root> packages:exports | grep javax.faces
>> karaf@root> packages:exports | grep jsf
>>   1929 org.springframework.web.jsf
>>   1929 org.springframework.web.jsf.el
>>
>> 10:42:36,444 | WARN  | FelixStartLevel  | /prime-showcase-1
>>     | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>> java.lang.IllegalStateException: Application was not properly
>> initialized at startup, could not find Factory:
>> javax.faces.context.FacesContextFactory
>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1958:prime-showcase-1:0]
>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1958:prime-showcase-1:0]
>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1958:prime-showcase-1:0]
>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>
>>
>> On Fri, Feb 11, 2011 at 9:26 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>>> Could you make:
>>>
>>> la|grep -i jsf
>>>
>>> to see if JSF api and implementation are not outside your bundle.
>>> Else you have to use fragment to gather all in the same classloader.
>>>
>>> Regards
>>> JB
>>>
>>> On 02/11/2011 09:22 AM, Charles Moulliard wrote:
>>>> The WAR contains the spec and the implementation.
>>>>
>>>> aristo-1.0.0.jar
>>>> barbecue-1.5-beta1.jar
>>>> bcmail-jdk14-1.38.jar
>>>> bcmail-jdk14-138.jar
>>>> bcprov-jdk14-1.38.jar
>>>> bcprov-jdk14-138.jar
>>>> bctsp-jdk14-1.38.jar
>>>> black-tie-1.0.0.jar
>>>> blitzer-1.0.0.jar
>>>> bluesky-1.0.0.jar
>>>> casablanca-1.0.0.jar
>>>> commons-fileupload-1.2.1.jar
>>>> commons-io-1.4.jar
>>>> commons-logging-1.1.1.jar
>>>> cupertino-1.0.0.jar
>>>> dark-hive-1.0.0.jar
>>>> dot-luv-1.0.0.jar
>>>> eggplant-1.0.0.jar
>>>> excite-bike-1.0.0.jar
>>>> facestrace-1.1.0.jar
>>>> flick-1.0.0.jar
>>>> hot-sneaks-1.0.0.jar
>>>> humanity-1.0.0.jar
>>>> itext-2.1.7.jar
>>>> jcommon-1.0.0.jar
>>>> jdom-1.0.jar
>>>> jfreechart-1.0.0.jar
>>>>
>>>> -->
>>>> jsf-api-2.0.4-b09.jar
>>>> jsf-impl-2.0.4-b09.jar
>>>> -->
>>>>
>>>> jstl-1.2.jar
>>>> junit-3.8.jar
>>>> le-frog-1.0.0.jar
>>>> log4j-1.2.13.jar
>>>> midnight-1.0.0.jar
>>>> mint-choc-1.0.0.jar
>>>> overcast-1.0.0.jar
>>>> pepper-grinder-1.0.0.jar
>>>> poi-3.2-FINAL.jar
>>>> primefaces-3.0-SNAPSHOT.jar
>>>> redmond-1.0.0.jar
>>>> rocket-1.0.0.jar
>>>> rome-1.0.jar
>>>> smoothness-1.0.0.jar
>>>> south-street-1.0.0.jar
>>>> start-1.0.0.jar
>>>> sunny-1.0.0.jar
>>>> swanky-purse-1.0.0.jar
>>>> trontastic-1.0.0.jar
>>>> ui-darkness-1.0.0.jar
>>>> ui-lightness-1.0.0.jar
>>>> vader-1.0.0.jar
>>>>
>>>>
>>>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks<da...@yahoo.com>
>>>>  wrote:
>>>>> You need both the api jar and the implementation in your war.  Which jsf
>>>>> implementation?
>>>>>
>>>>> You might consider trying myfaces-bundle deployed outside your web app
>>>>> (removing jsf jars from the web app). This works find in geronimo but I'm
>>>>> not sure at the moment if we do extra initialization to get around this
>>>>> problem.
>>>>>
>>>>>
>>>>> thanks
>>>>> david jencks
>>>>>
>>>>>
>>>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>>>> but get this issue :
>>>>>>
>>>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>>>> java.lang.IllegalStateException: Application was not properly
>>>>>> initialized at startup, could not find Factory:
>>>>>> javax.faces.context.FacesContextFactory
>>>>>>       at
>>>>>> javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>       at
>>>>>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>       at
>>>>>> javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>       at
>>>>>> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>>       at
>>>>>> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>>       at
>>>>>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>>>
>>>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>>>> jsf-api-2.0.4-b09
>>>>>>
>>>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>>>
>>>>>> Is it something that you already experienced ?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Charles Moulliard
>>>>>>
>>>>>> Sr. Principal Solution Architect - FuseSource
>>>>>> Apache Committer
>>>>>>
>>>>>> Blog : http://cmoulliard.blogspot.com
>>>>>> Twitter : http://twitter.com/cmoulliard
>>>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>>>> Skype: cmoulliard
>>>>>
>
>

Re: Apache Karaf & WAR + JSF

Posted by Achim Nierbeck <bc...@googlemail.com>.
I attached myfaces-test-helloworld-osgi-pax-web.war

that did work for me and I tested the jsf functionalities with it.

The following steps were also needed in karaf shell (just verified once
more with Karaf-2.99.99-SNAPSHOT):

install mvn:org.apache.myfaces.core/myfaces-api/1.2.9
install mvn:org.apache.myfaces.core/myfaces-impl/1.2.9
install mvn:commons-beanutils/commons-beanutils/1.8.3
install mvn:commons-collections/commons-collections/3.2.1
install mvn:commons-codec/commons-codec/1.4
install
mvn:org.apache.commons/com.springsource.org.apache.commons.digester/1.8.0
install
mvn:org.apache.commons/com.springsource.org.apache.commons.discovery/0.4.0

Now the attached myfaces-test-helloworld-osgi.war is started and deployed
And running, there is some sort of variable replacement issue with this test
but in principle I think it is working :)

Regards, Achim


> I have removed everything and still get the same error from the war
> containing all the jars file.
>
> karaf@root> packages:exports | grep javax.faces
> karaf@root> packages:exports | grep jsf
>   1929 org.springframework.web.jsf
>   1929 org.springframework.web.jsf.el
>
> 10:42:36,444 | WARN  | FelixStartLevel  | /prime-showcase-1
>     | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
> java.lang.IllegalStateException: Application was not properly
> initialized at startup, could not find Factory:
> javax.faces.context.FacesContextFactory
> 	at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1958:prime-showcase-1:0]
> 	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1958:prime-showcase-1:0]
> 	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1958:prime-showcase-1:0]
> 	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>
>
> On Fri, Feb 11, 2011 at 9:26 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
>> Could you make:
>>
>> la|grep -i jsf
>>
>> to see if JSF api and implementation are not outside your bundle.
>> Else you have to use fragment to gather all in the same classloader.
>>
>> Regards
>> JB
>>
>> On 02/11/2011 09:22 AM, Charles Moulliard wrote:
>>> The WAR contains the spec and the implementation.
>>>
>>> aristo-1.0.0.jar
>>> barbecue-1.5-beta1.jar
>>> bcmail-jdk14-1.38.jar
>>> bcmail-jdk14-138.jar
>>> bcprov-jdk14-1.38.jar
>>> bcprov-jdk14-138.jar
>>> bctsp-jdk14-1.38.jar
>>> black-tie-1.0.0.jar
>>> blitzer-1.0.0.jar
>>> bluesky-1.0.0.jar
>>> casablanca-1.0.0.jar
>>> commons-fileupload-1.2.1.jar
>>> commons-io-1.4.jar
>>> commons-logging-1.1.1.jar
>>> cupertino-1.0.0.jar
>>> dark-hive-1.0.0.jar
>>> dot-luv-1.0.0.jar
>>> eggplant-1.0.0.jar
>>> excite-bike-1.0.0.jar
>>> facestrace-1.1.0.jar
>>> flick-1.0.0.jar
>>> hot-sneaks-1.0.0.jar
>>> humanity-1.0.0.jar
>>> itext-2.1.7.jar
>>> jcommon-1.0.0.jar
>>> jdom-1.0.jar
>>> jfreechart-1.0.0.jar
>>>
>>> -->
>>> jsf-api-2.0.4-b09.jar
>>> jsf-impl-2.0.4-b09.jar
>>> -->
>>>
>>> jstl-1.2.jar
>>> junit-3.8.jar
>>> le-frog-1.0.0.jar
>>> log4j-1.2.13.jar
>>> midnight-1.0.0.jar
>>> mint-choc-1.0.0.jar
>>> overcast-1.0.0.jar
>>> pepper-grinder-1.0.0.jar
>>> poi-3.2-FINAL.jar
>>> primefaces-3.0-SNAPSHOT.jar
>>> redmond-1.0.0.jar
>>> rocket-1.0.0.jar
>>> rome-1.0.jar
>>> smoothness-1.0.0.jar
>>> south-street-1.0.0.jar
>>> start-1.0.0.jar
>>> sunny-1.0.0.jar
>>> swanky-purse-1.0.0.jar
>>> trontastic-1.0.0.jar
>>> ui-darkness-1.0.0.jar
>>> ui-lightness-1.0.0.jar
>>> vader-1.0.0.jar
>>>
>>>
>>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks<da...@yahoo.com>
>>>  wrote:
>>>> You need both the api jar and the implementation in your war.  Which jsf
>>>> implementation?
>>>>
>>>> You might consider trying myfaces-bundle deployed outside your web app
>>>> (removing jsf jars from the web app). This works find in geronimo but I'm
>>>> not sure at the moment if we do extra initialization to get around this
>>>> problem.
>>>>
>>>>
>>>> thanks
>>>> david jencks
>>>>
>>>>
>>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>>> but get this issue :
>>>>>
>>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>>> java.lang.IllegalStateException: Application was not properly
>>>>> initialized at startup, could not find Factory:
>>>>> javax.faces.context.FacesContextFactory
>>>>>       at
>>>>> javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>       at
>>>>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>       at
>>>>> javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>       at
>>>>> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>       at
>>>>> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>       at
>>>>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>>
>>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>>> jsf-api-2.0.4-b09
>>>>>
>>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>>
>>>>> Is it something that you already experienced ?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Charles Moulliard
>>>>>
>>>>> Sr. Principal Solution Architect - FuseSource
>>>>> Apache Committer
>>>>>
>>>>> Blog : http://cmoulliard.blogspot.com
>>>>> Twitter : http://twitter.com/cmoulliard
>>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>>> Skype: cmoulliard
>>>>


Re: Apache Karaf & WAR + JSF

Posted by Charles Moulliard <cm...@gmail.com>.
I have removed everything and still get the same error from the war
containing all the jars file.

karaf@root> packages:exports | grep javax.faces
karaf@root> packages:exports | grep jsf
  1929 org.springframework.web.jsf
  1929 org.springframework.web.jsf.el

10:42:36,444 | WARN  | FelixStartLevel  | /prime-showcase-1
    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
java.lang.IllegalStateException: Application was not properly
initialized at startup, could not find Factory:
javax.faces.context.FacesContextFactory
	at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1958:prime-showcase-1:0]
	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1958:prime-showcase-1:0]
	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1958:prime-showcase-1:0]
	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]


On Fri, Feb 11, 2011 at 9:26 AM, Jean-Baptiste Onofré <jb...@nanthrax.net> wrote:
> Could you make:
>
> la|grep -i jsf
>
> to see if JSF api and implementation are not outside your bundle.
> Else you have to use fragment to gather all in the same classloader.
>
> Regards
> JB
>
> On 02/11/2011 09:22 AM, Charles Moulliard wrote:
>>
>> The WAR contains the spec and the implementation.
>>
>> aristo-1.0.0.jar
>> barbecue-1.5-beta1.jar
>> bcmail-jdk14-1.38.jar
>> bcmail-jdk14-138.jar
>> bcprov-jdk14-1.38.jar
>> bcprov-jdk14-138.jar
>> bctsp-jdk14-1.38.jar
>> black-tie-1.0.0.jar
>> blitzer-1.0.0.jar
>> bluesky-1.0.0.jar
>> casablanca-1.0.0.jar
>> commons-fileupload-1.2.1.jar
>> commons-io-1.4.jar
>> commons-logging-1.1.1.jar
>> cupertino-1.0.0.jar
>> dark-hive-1.0.0.jar
>> dot-luv-1.0.0.jar
>> eggplant-1.0.0.jar
>> excite-bike-1.0.0.jar
>> facestrace-1.1.0.jar
>> flick-1.0.0.jar
>> hot-sneaks-1.0.0.jar
>> humanity-1.0.0.jar
>> itext-2.1.7.jar
>> jcommon-1.0.0.jar
>> jdom-1.0.jar
>> jfreechart-1.0.0.jar
>>
>> -->
>> jsf-api-2.0.4-b09.jar
>> jsf-impl-2.0.4-b09.jar
>> -->
>>
>> jstl-1.2.jar
>> junit-3.8.jar
>> le-frog-1.0.0.jar
>> log4j-1.2.13.jar
>> midnight-1.0.0.jar
>> mint-choc-1.0.0.jar
>> overcast-1.0.0.jar
>> pepper-grinder-1.0.0.jar
>> poi-3.2-FINAL.jar
>> primefaces-3.0-SNAPSHOT.jar
>> redmond-1.0.0.jar
>> rocket-1.0.0.jar
>> rome-1.0.jar
>> smoothness-1.0.0.jar
>> south-street-1.0.0.jar
>> start-1.0.0.jar
>> sunny-1.0.0.jar
>> swanky-purse-1.0.0.jar
>> trontastic-1.0.0.jar
>> ui-darkness-1.0.0.jar
>> ui-lightness-1.0.0.jar
>> vader-1.0.0.jar
>>
>>
>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks<da...@yahoo.com>
>>  wrote:
>>>
>>> You need both the api jar and the implementation in your war.  Which jsf
>>> implementation?
>>>
>>> You might consider trying myfaces-bundle deployed outside your web app
>>> (removing jsf jars from the web app). This works find in geronimo but I'm
>>> not sure at the moment if we do extra initialization to get around this
>>> problem.
>>>
>>>
>>> thanks
>>> david jencks
>>>
>>>
>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>
>>>> Hi,
>>>>
>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>> but get this issue :
>>>>
>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>> java.lang.IllegalStateException: Application was not properly
>>>> initialized at startup, could not find Factory:
>>>> javax.faces.context.FacesContextFactory
>>>>       at
>>>> javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>       at
>>>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>       at
>>>> javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>       at
>>>> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>       at
>>>> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>       at
>>>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>
>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>> jsf-api-2.0.4-b09
>>>>
>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>
>>>> Is it something that you already experienced ?
>>>>
>>>> Regards,
>>>>
>>>> Charles Moulliard
>>>>
>>>> Sr. Principal Solution Architect - FuseSource
>>>> Apache Committer
>>>>
>>>> Blog : http://cmoulliard.blogspot.com
>>>> Twitter : http://twitter.com/cmoulliard
>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>> Skype: cmoulliard
>>>
>>>
>

Re: Apache Karaf & WAR + JSF

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Could you make:

la|grep -i jsf

to see if JSF api and implementation are not outside your bundle.
Else you have to use fragment to gather all in the same classloader.

Regards
JB

On 02/11/2011 09:22 AM, Charles Moulliard wrote:
> The WAR contains the spec and the implementation.
>
> aristo-1.0.0.jar
> barbecue-1.5-beta1.jar
> bcmail-jdk14-1.38.jar
> bcmail-jdk14-138.jar
> bcprov-jdk14-1.38.jar
> bcprov-jdk14-138.jar
> bctsp-jdk14-1.38.jar
> black-tie-1.0.0.jar
> blitzer-1.0.0.jar
> bluesky-1.0.0.jar
> casablanca-1.0.0.jar
> commons-fileupload-1.2.1.jar
> commons-io-1.4.jar
> commons-logging-1.1.1.jar
> cupertino-1.0.0.jar
> dark-hive-1.0.0.jar
> dot-luv-1.0.0.jar
> eggplant-1.0.0.jar
> excite-bike-1.0.0.jar
> facestrace-1.1.0.jar
> flick-1.0.0.jar
> hot-sneaks-1.0.0.jar
> humanity-1.0.0.jar
> itext-2.1.7.jar
> jcommon-1.0.0.jar
> jdom-1.0.jar
> jfreechart-1.0.0.jar
>
> -->
> jsf-api-2.0.4-b09.jar
> jsf-impl-2.0.4-b09.jar
> -->
>
> jstl-1.2.jar
> junit-3.8.jar
> le-frog-1.0.0.jar
> log4j-1.2.13.jar
> midnight-1.0.0.jar
> mint-choc-1.0.0.jar
> overcast-1.0.0.jar
> pepper-grinder-1.0.0.jar
> poi-3.2-FINAL.jar
> primefaces-3.0-SNAPSHOT.jar
> redmond-1.0.0.jar
> rocket-1.0.0.jar
> rome-1.0.jar
> smoothness-1.0.0.jar
> south-street-1.0.0.jar
> start-1.0.0.jar
> sunny-1.0.0.jar
> swanky-purse-1.0.0.jar
> trontastic-1.0.0.jar
> ui-darkness-1.0.0.jar
> ui-lightness-1.0.0.jar
> vader-1.0.0.jar
>
>
> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks<da...@yahoo.com>  wrote:
>> You need both the api jar and the implementation in your war.  Which jsf implementation?
>>
>> You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.
>>
>>
>> thanks
>> david jencks
>>
>>
>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>
>>> Hi,
>>>
>>> I have deployed a WAR project on Karaf which is JSF technology based
>>> but get this issue :
>>>
>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>     | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>> java.lang.IllegalStateException: Application was not properly
>>> initialized at startup, could not find Factory:
>>> javax.faces.context.FacesContextFactory
>>>        at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>        at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>        at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>
>>> The lib directory of the WAR contains well the jar of jsf api -->
>>> jsf-api-2.0.4-b09
>>>
>>> Remark : the same WAR deployed on Tomcat works fine
>>>
>>> Is it something that you already experienced ?
>>>
>>> Regards,
>>>
>>> Charles Moulliard
>>>
>>> Sr. Principal Solution Architect - FuseSource
>>> Apache Committer
>>>
>>> Blog : http://cmoulliard.blogspot.com
>>> Twitter : http://twitter.com/cmoulliard
>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>> Skype: cmoulliard
>>
>>

Re: Apache Karaf & WAR + JSF

Posted by Charles Moulliard <cm...@gmail.com>.
You are rights. I found faces/jsf packages exported by the myfaces
bundles that I deploy for other project. I do a cleanup and reinstall


On Fri, Feb 11, 2011 at 9:44 AM, Achim Nierbeck <bc...@googlemail.com> wrote:
> Hi Charles,
>
> depending on the pax-web version you are using pax-web does support jsf.
> you might take a look at http://issues.ops4j.org/browse/PAXWEB-98
> this tells you what was used to test it :)
>
> though you need to switch to pax-web 1.0.1-SNAPSHOT right now
> (Guillaume is releasing it right now)
> cause I introduced a stupid bug which makes pax-web 1.0.0 not work well :)
>
> Regards, Achim
>
>
> 2011/2/11 Charles Moulliard <cm...@gmail.com>:
>> No jsf bundles have been deployed.
>>
>> On Fri, Feb 11, 2011 at 9:24 AM, Guillaume Nodet <gn...@gmail.com> wrote:
>>> Also, make sure the jsf-api isn't deployed as an OSGi bundle, else
>>> that one could be used and it would not be able to find the
>>> implementation inside the jar.
>>>
>>> On Fri, Feb 11, 2011 at 09:22, Charles Moulliard <cm...@gmail.com> wrote:
>>>> The WAR contains the spec and the implementation.
>>>>
>>>> aristo-1.0.0.jar
>>>> barbecue-1.5-beta1.jar
>>>> bcmail-jdk14-1.38.jar
>>>> bcmail-jdk14-138.jar
>>>> bcprov-jdk14-1.38.jar
>>>> bcprov-jdk14-138.jar
>>>> bctsp-jdk14-1.38.jar
>>>> black-tie-1.0.0.jar
>>>> blitzer-1.0.0.jar
>>>> bluesky-1.0.0.jar
>>>> casablanca-1.0.0.jar
>>>> commons-fileupload-1.2.1.jar
>>>> commons-io-1.4.jar
>>>> commons-logging-1.1.1.jar
>>>> cupertino-1.0.0.jar
>>>> dark-hive-1.0.0.jar
>>>> dot-luv-1.0.0.jar
>>>> eggplant-1.0.0.jar
>>>> excite-bike-1.0.0.jar
>>>> facestrace-1.1.0.jar
>>>> flick-1.0.0.jar
>>>> hot-sneaks-1.0.0.jar
>>>> humanity-1.0.0.jar
>>>> itext-2.1.7.jar
>>>> jcommon-1.0.0.jar
>>>> jdom-1.0.jar
>>>> jfreechart-1.0.0.jar
>>>>
>>>> -->
>>>> jsf-api-2.0.4-b09.jar
>>>> jsf-impl-2.0.4-b09.jar
>>>> -->
>>>>
>>>> jstl-1.2.jar
>>>> junit-3.8.jar
>>>> le-frog-1.0.0.jar
>>>> log4j-1.2.13.jar
>>>> midnight-1.0.0.jar
>>>> mint-choc-1.0.0.jar
>>>> overcast-1.0.0.jar
>>>> pepper-grinder-1.0.0.jar
>>>> poi-3.2-FINAL.jar
>>>> primefaces-3.0-SNAPSHOT.jar
>>>> redmond-1.0.0.jar
>>>> rocket-1.0.0.jar
>>>> rome-1.0.jar
>>>> smoothness-1.0.0.jar
>>>> south-street-1.0.0.jar
>>>> start-1.0.0.jar
>>>> sunny-1.0.0.jar
>>>> swanky-purse-1.0.0.jar
>>>> trontastic-1.0.0.jar
>>>> ui-darkness-1.0.0.jar
>>>> ui-lightness-1.0.0.jar
>>>> vader-1.0.0.jar
>>>>
>>>>
>>>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks <da...@yahoo.com> wrote:
>>>>> You need both the api jar and the implementation in your war.  Which jsf implementation?
>>>>>
>>>>> You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.
>>>>>
>>>>>
>>>>> thanks
>>>>> david jencks
>>>>>
>>>>>
>>>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>>>> but get this issue :
>>>>>>
>>>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>>>> java.lang.IllegalStateException: Application was not properly
>>>>>> initialized at startup, could not find Factory:
>>>>>> javax.faces.context.FacesContextFactory
>>>>>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>>       at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>>       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>>>
>>>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>>>> jsf-api-2.0.4-b09
>>>>>>
>>>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>>>
>>>>>> Is it something that you already experienced ?
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Charles Moulliard
>>>>>>
>>>>>> Sr. Principal Solution Architect - FuseSource
>>>>>> Apache Committer
>>>>>>
>>>>>> Blog : http://cmoulliard.blogspot.com
>>>>>> Twitter : http://twitter.com/cmoulliard
>>>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>>>> Skype: cmoulliard
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Cheers,
>>> Guillaume Nodet
>>> ------------------------
>>> Blog: http://gnodet.blogspot.com/
>>> ------------------------
>>> Open Source SOA
>>> http://fusesource.com
>>>
>>
>

Re: Apache Karaf & WAR + JSF

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

depending on the pax-web version you are using pax-web does support jsf.
you might take a look at http://issues.ops4j.org/browse/PAXWEB-98
this tells you what was used to test it :)

though you need to switch to pax-web 1.0.1-SNAPSHOT right now
(Guillaume is releasing it right now)
cause I introduced a stupid bug which makes pax-web 1.0.0 not work well :)

Regards, Achim


2011/2/11 Charles Moulliard <cm...@gmail.com>:
> No jsf bundles have been deployed.
>
> On Fri, Feb 11, 2011 at 9:24 AM, Guillaume Nodet <gn...@gmail.com> wrote:
>> Also, make sure the jsf-api isn't deployed as an OSGi bundle, else
>> that one could be used and it would not be able to find the
>> implementation inside the jar.
>>
>> On Fri, Feb 11, 2011 at 09:22, Charles Moulliard <cm...@gmail.com> wrote:
>>> The WAR contains the spec and the implementation.
>>>
>>> aristo-1.0.0.jar
>>> barbecue-1.5-beta1.jar
>>> bcmail-jdk14-1.38.jar
>>> bcmail-jdk14-138.jar
>>> bcprov-jdk14-1.38.jar
>>> bcprov-jdk14-138.jar
>>> bctsp-jdk14-1.38.jar
>>> black-tie-1.0.0.jar
>>> blitzer-1.0.0.jar
>>> bluesky-1.0.0.jar
>>> casablanca-1.0.0.jar
>>> commons-fileupload-1.2.1.jar
>>> commons-io-1.4.jar
>>> commons-logging-1.1.1.jar
>>> cupertino-1.0.0.jar
>>> dark-hive-1.0.0.jar
>>> dot-luv-1.0.0.jar
>>> eggplant-1.0.0.jar
>>> excite-bike-1.0.0.jar
>>> facestrace-1.1.0.jar
>>> flick-1.0.0.jar
>>> hot-sneaks-1.0.0.jar
>>> humanity-1.0.0.jar
>>> itext-2.1.7.jar
>>> jcommon-1.0.0.jar
>>> jdom-1.0.jar
>>> jfreechart-1.0.0.jar
>>>
>>> -->
>>> jsf-api-2.0.4-b09.jar
>>> jsf-impl-2.0.4-b09.jar
>>> -->
>>>
>>> jstl-1.2.jar
>>> junit-3.8.jar
>>> le-frog-1.0.0.jar
>>> log4j-1.2.13.jar
>>> midnight-1.0.0.jar
>>> mint-choc-1.0.0.jar
>>> overcast-1.0.0.jar
>>> pepper-grinder-1.0.0.jar
>>> poi-3.2-FINAL.jar
>>> primefaces-3.0-SNAPSHOT.jar
>>> redmond-1.0.0.jar
>>> rocket-1.0.0.jar
>>> rome-1.0.jar
>>> smoothness-1.0.0.jar
>>> south-street-1.0.0.jar
>>> start-1.0.0.jar
>>> sunny-1.0.0.jar
>>> swanky-purse-1.0.0.jar
>>> trontastic-1.0.0.jar
>>> ui-darkness-1.0.0.jar
>>> ui-lightness-1.0.0.jar
>>> vader-1.0.0.jar
>>>
>>>
>>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks <da...@yahoo.com> wrote:
>>>> You need both the api jar and the implementation in your war.  Which jsf implementation?
>>>>
>>>> You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.
>>>>
>>>>
>>>> thanks
>>>> david jencks
>>>>
>>>>
>>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>>> but get this issue :
>>>>>
>>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>>> java.lang.IllegalStateException: Application was not properly
>>>>> initialized at startup, could not find Factory:
>>>>> javax.faces.context.FacesContextFactory
>>>>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>       at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>>       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>>
>>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>>> jsf-api-2.0.4-b09
>>>>>
>>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>>
>>>>> Is it something that you already experienced ?
>>>>>
>>>>> Regards,
>>>>>
>>>>> Charles Moulliard
>>>>>
>>>>> Sr. Principal Solution Architect - FuseSource
>>>>> Apache Committer
>>>>>
>>>>> Blog : http://cmoulliard.blogspot.com
>>>>> Twitter : http://twitter.com/cmoulliard
>>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>>> Skype: cmoulliard
>>>>
>>>>
>>>
>>
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>> ------------------------
>> Blog: http://gnodet.blogspot.com/
>> ------------------------
>> Open Source SOA
>> http://fusesource.com
>>
>

Re: Apache Karaf & WAR + JSF

Posted by Charles Moulliard <cm...@gmail.com>.
No jsf bundles have been deployed.

On Fri, Feb 11, 2011 at 9:24 AM, Guillaume Nodet <gn...@gmail.com> wrote:
> Also, make sure the jsf-api isn't deployed as an OSGi bundle, else
> that one could be used and it would not be able to find the
> implementation inside the jar.
>
> On Fri, Feb 11, 2011 at 09:22, Charles Moulliard <cm...@gmail.com> wrote:
>> The WAR contains the spec and the implementation.
>>
>> aristo-1.0.0.jar
>> barbecue-1.5-beta1.jar
>> bcmail-jdk14-1.38.jar
>> bcmail-jdk14-138.jar
>> bcprov-jdk14-1.38.jar
>> bcprov-jdk14-138.jar
>> bctsp-jdk14-1.38.jar
>> black-tie-1.0.0.jar
>> blitzer-1.0.0.jar
>> bluesky-1.0.0.jar
>> casablanca-1.0.0.jar
>> commons-fileupload-1.2.1.jar
>> commons-io-1.4.jar
>> commons-logging-1.1.1.jar
>> cupertino-1.0.0.jar
>> dark-hive-1.0.0.jar
>> dot-luv-1.0.0.jar
>> eggplant-1.0.0.jar
>> excite-bike-1.0.0.jar
>> facestrace-1.1.0.jar
>> flick-1.0.0.jar
>> hot-sneaks-1.0.0.jar
>> humanity-1.0.0.jar
>> itext-2.1.7.jar
>> jcommon-1.0.0.jar
>> jdom-1.0.jar
>> jfreechart-1.0.0.jar
>>
>> -->
>> jsf-api-2.0.4-b09.jar
>> jsf-impl-2.0.4-b09.jar
>> -->
>>
>> jstl-1.2.jar
>> junit-3.8.jar
>> le-frog-1.0.0.jar
>> log4j-1.2.13.jar
>> midnight-1.0.0.jar
>> mint-choc-1.0.0.jar
>> overcast-1.0.0.jar
>> pepper-grinder-1.0.0.jar
>> poi-3.2-FINAL.jar
>> primefaces-3.0-SNAPSHOT.jar
>> redmond-1.0.0.jar
>> rocket-1.0.0.jar
>> rome-1.0.jar
>> smoothness-1.0.0.jar
>> south-street-1.0.0.jar
>> start-1.0.0.jar
>> sunny-1.0.0.jar
>> swanky-purse-1.0.0.jar
>> trontastic-1.0.0.jar
>> ui-darkness-1.0.0.jar
>> ui-lightness-1.0.0.jar
>> vader-1.0.0.jar
>>
>>
>> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks <da...@yahoo.com> wrote:
>>> You need both the api jar and the implementation in your war.  Which jsf implementation?
>>>
>>> You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.
>>>
>>>
>>> thanks
>>> david jencks
>>>
>>>
>>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>>
>>>> Hi,
>>>>
>>>> I have deployed a WAR project on Karaf which is JSF technology based
>>>> but get this issue :
>>>>
>>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>>> java.lang.IllegalStateException: Application was not properly
>>>> initialized at startup, could not find Factory:
>>>> javax.faces.context.FacesContextFactory
>>>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>       at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>>       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>>
>>>> The lib directory of the WAR contains well the jar of jsf api -->
>>>> jsf-api-2.0.4-b09
>>>>
>>>> Remark : the same WAR deployed on Tomcat works fine
>>>>
>>>> Is it something that you already experienced ?
>>>>
>>>> Regards,
>>>>
>>>> Charles Moulliard
>>>>
>>>> Sr. Principal Solution Architect - FuseSource
>>>> Apache Committer
>>>>
>>>> Blog : http://cmoulliard.blogspot.com
>>>> Twitter : http://twitter.com/cmoulliard
>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>>> Skype: cmoulliard
>>>
>>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>

Re: Apache Karaf & WAR + JSF

Posted by Guillaume Nodet <gn...@gmail.com>.
Also, make sure the jsf-api isn't deployed as an OSGi bundle, else
that one could be used and it would not be able to find the
implementation inside the jar.

On Fri, Feb 11, 2011 at 09:22, Charles Moulliard <cm...@gmail.com> wrote:
> The WAR contains the spec and the implementation.
>
> aristo-1.0.0.jar
> barbecue-1.5-beta1.jar
> bcmail-jdk14-1.38.jar
> bcmail-jdk14-138.jar
> bcprov-jdk14-1.38.jar
> bcprov-jdk14-138.jar
> bctsp-jdk14-1.38.jar
> black-tie-1.0.0.jar
> blitzer-1.0.0.jar
> bluesky-1.0.0.jar
> casablanca-1.0.0.jar
> commons-fileupload-1.2.1.jar
> commons-io-1.4.jar
> commons-logging-1.1.1.jar
> cupertino-1.0.0.jar
> dark-hive-1.0.0.jar
> dot-luv-1.0.0.jar
> eggplant-1.0.0.jar
> excite-bike-1.0.0.jar
> facestrace-1.1.0.jar
> flick-1.0.0.jar
> hot-sneaks-1.0.0.jar
> humanity-1.0.0.jar
> itext-2.1.7.jar
> jcommon-1.0.0.jar
> jdom-1.0.jar
> jfreechart-1.0.0.jar
>
> -->
> jsf-api-2.0.4-b09.jar
> jsf-impl-2.0.4-b09.jar
> -->
>
> jstl-1.2.jar
> junit-3.8.jar
> le-frog-1.0.0.jar
> log4j-1.2.13.jar
> midnight-1.0.0.jar
> mint-choc-1.0.0.jar
> overcast-1.0.0.jar
> pepper-grinder-1.0.0.jar
> poi-3.2-FINAL.jar
> primefaces-3.0-SNAPSHOT.jar
> redmond-1.0.0.jar
> rocket-1.0.0.jar
> rome-1.0.jar
> smoothness-1.0.0.jar
> south-street-1.0.0.jar
> start-1.0.0.jar
> sunny-1.0.0.jar
> swanky-purse-1.0.0.jar
> trontastic-1.0.0.jar
> ui-darkness-1.0.0.jar
> ui-lightness-1.0.0.jar
> vader-1.0.0.jar
>
>
> On Fri, Feb 11, 2011 at 5:06 AM, David Jencks <da...@yahoo.com> wrote:
>> You need both the api jar and the implementation in your war.  Which jsf implementation?
>>
>> You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.
>>
>>
>> thanks
>> david jencks
>>
>>
>> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>>
>>> Hi,
>>>
>>> I have deployed a WAR project on Karaf which is JSF technology based
>>> but get this issue :
>>>
>>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>>> java.lang.IllegalStateException: Application was not properly
>>> initialized at startup, could not find Factory:
>>> javax.faces.context.FacesContextFactory
>>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>       at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>>       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>>
>>> The lib directory of the WAR contains well the jar of jsf api -->
>>> jsf-api-2.0.4-b09
>>>
>>> Remark : the same WAR deployed on Tomcat works fine
>>>
>>> Is it something that you already experienced ?
>>>
>>> Regards,
>>>
>>> Charles Moulliard
>>>
>>> Sr. Principal Solution Architect - FuseSource
>>> Apache Committer
>>>
>>> Blog : http://cmoulliard.blogspot.com
>>> Twitter : http://twitter.com/cmoulliard
>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>> Skype: cmoulliard
>>
>>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Apache Karaf & WAR + JSF

Posted by Charles Moulliard <cm...@gmail.com>.
The WAR contains the spec and the implementation.

aristo-1.0.0.jar
barbecue-1.5-beta1.jar
bcmail-jdk14-1.38.jar
bcmail-jdk14-138.jar
bcprov-jdk14-1.38.jar
bcprov-jdk14-138.jar
bctsp-jdk14-1.38.jar
black-tie-1.0.0.jar
blitzer-1.0.0.jar
bluesky-1.0.0.jar
casablanca-1.0.0.jar
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
commons-logging-1.1.1.jar
cupertino-1.0.0.jar
dark-hive-1.0.0.jar
dot-luv-1.0.0.jar
eggplant-1.0.0.jar
excite-bike-1.0.0.jar
facestrace-1.1.0.jar
flick-1.0.0.jar
hot-sneaks-1.0.0.jar
humanity-1.0.0.jar
itext-2.1.7.jar
jcommon-1.0.0.jar
jdom-1.0.jar
jfreechart-1.0.0.jar

-->
jsf-api-2.0.4-b09.jar
jsf-impl-2.0.4-b09.jar
-->

jstl-1.2.jar
junit-3.8.jar
le-frog-1.0.0.jar
log4j-1.2.13.jar
midnight-1.0.0.jar
mint-choc-1.0.0.jar
overcast-1.0.0.jar
pepper-grinder-1.0.0.jar
poi-3.2-FINAL.jar
primefaces-3.0-SNAPSHOT.jar
redmond-1.0.0.jar
rocket-1.0.0.jar
rome-1.0.jar
smoothness-1.0.0.jar
south-street-1.0.0.jar
start-1.0.0.jar
sunny-1.0.0.jar
swanky-purse-1.0.0.jar
trontastic-1.0.0.jar
ui-darkness-1.0.0.jar
ui-lightness-1.0.0.jar
vader-1.0.0.jar


On Fri, Feb 11, 2011 at 5:06 AM, David Jencks <da...@yahoo.com> wrote:
> You need both the api jar and the implementation in your war.  Which jsf implementation?
>
> You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.
>
>
> thanks
> david jencks
>
>
> On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:
>
>> Hi,
>>
>> I have deployed a WAR project on Karaf which is JSF technology based
>> but get this issue :
>>
>> 14:05:19,408 | WARN  | FelixStartLevel  | war
>>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
>> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
>> java.lang.IllegalStateException: Application was not properly
>> initialized at startup, could not find Factory:
>> javax.faces.context.FacesContextFactory
>>       at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
>>       at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>       at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
>>       at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
>>
>> The lib directory of the WAR contains well the jar of jsf api -->
>> jsf-api-2.0.4-b09
>>
>> Remark : the same WAR deployed on Tomcat works fine
>>
>> Is it something that you already experienced ?
>>
>> Regards,
>>
>> Charles Moulliard
>>
>> Sr. Principal Solution Architect - FuseSource
>> Apache Committer
>>
>> Blog : http://cmoulliard.blogspot.com
>> Twitter : http://twitter.com/cmoulliard
>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> Skype: cmoulliard
>
>

Re: Apache Karaf & WAR + JSF

Posted by David Jencks <da...@yahoo.com>.
You need both the api jar and the implementation in your war.  Which jsf implementation?

You might consider trying myfaces-bundle deployed outside your web app (removing jsf jars from the web app). This works find in geronimo but I'm not sure at the moment if we do extra initialization to get around this problem.


thanks
david jencks


On Feb 10, 2011, at 5:33 AM, Charles Moulliard wrote:

> Hi,
> 
> I have deployed a WAR project on Karaf which is JSF technology based
> but get this issue :
> 
> 14:05:19,408 | WARN  | FelixStartLevel  | war
>    | .eclipse.jetty.util.log.Slf4jLog   50 | 1834 -
> org.eclipse.jetty.util - 7.2.2.v20101205 | unavailable
> java.lang.IllegalStateException: Application was not properly
> initialized at startup, could not find Factory:
> javax.faces.context.FacesContextFactory
> 	at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
> 	at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
> 	at javax.faces.webapp.FacesServlet.init(FacesServlet.java:166)[1957:file__Users_charlesmoulliard_Apache_karaf_assembly_target_apache-karaf-2.1.99-SNAPSHOT_deploy_prime-showcase-1.0.0-SNAPSHOT.war:0]
> 	at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
> 	at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[1842:org.eclipse.jetty.servlet:7.2.2.v20101205]
> 	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[1834:org.eclipse.jetty.util:7.2.2.v20101205]
> 
> The lib directory of the WAR contains well the jar of jsf api -->
> jsf-api-2.0.4-b09
> 
> Remark : the same WAR deployed on Tomcat works fine
> 
> Is it something that you already experienced ?
> 
> Regards,
> 
> Charles Moulliard
> 
> Sr. Principal Solution Architect - FuseSource
> Apache Committer
> 
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard