Hi Dan, this might be an issue with pax-web right now. Depending on the version of Karaf you are using JSF isn't supported at all. If you are using Karaf 2.1.x JSF isn't supported by Pax-Web (0.8.x) If you are using Karaf 2.2.x JSF should work (Pax-web 1.0.1), but I'm not quite sure that everything is properly working yet, haven't had the time to check this in detail. Concerning your startup class, are you already creating a Manifest for your war? If not, the servlet class is not interpreted yet. There is a issue for pax-url I was working on but haven't tested yet if this works for all use cases. (http://issues.ops4j.org/browse/PAXURL-107)
This is the current state. My suggestion is to create a manifest for your war, the maven-bundle-plugin in version 2.3.4 does support wars. Greetings Achim 2011/3/3 Dan Tran <[email protected]>: > I am using mojarra 2.1.0-b11 and 2.0.4-b09, switching to myfaces 2.0.4 > gives me further error like this > > java.lang.IllegalStateException: No Factories configured for this > Application. This happens if the faces-initialization does not work at > all - make sure that you properly include all configuration settings > necessary for a basic faces applic > ck the logging output of your web application and your container for > any exceptions! > If you did that and find nothing, the mistake might be due to the fact > that you use some special web-containers which do not support > registering context-listeners via TLD files and a context listener is > not setup in your web.xml. > A typical config looks like this; > <listener> > <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> > </listener> > > at > javax.faces.FactoryFinder.getFactory(FactoryFinder.java:196)[219:mc:0.0.0] > > -D > > > On Thu, Mar 3, 2011 at 12:52 AM, Charles Moulliard <[email protected]> > wrote: >> Hi, >> >> This is an issue that I experienced some weeks ago with a JSF project >> based on PrimeFaces. Can you tell me if the JSF (spec) and >> implementation lib are embedded into your bundle or deployed >> separately ? >> >> Regards, >> >> Charles Moulliard >> Apache Committer >> >> Blog : http://cmoulliard.blogspot.com >> Twitter : http://twitter.com/cmoulliard >> Linkedin : http://www.linkedin.com/in/charlesmoulliard >> Skype: cmoulliard >> >> >> >> On Thu, Mar 3, 2011 at 9:32 AM, Dan Tran <[email protected]> wrote: >>> ouch, I will need to temporary add simple onelines bean definitions >>> for all the annotated beans. But that is ok >>> >>> NowI run into >>> >>> 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:815)[211:mc:0.0.0] >>> at >>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:317)[211:mc:0.0.0] >>> at >>> javax.faces.webapp.FacesServlet.init(FacesServlet.java:253)[211:mc:0.0.0] >>> at >>> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[199:org.eclipse.jetty.servlet:7.2.2.v20101205] >>> at >>> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[199:org.eclipse.jetty.servlet:7.2.2.v20101205] >>> at >>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[193:org.eclipse.jetty.util:7.2.2.v20101205] >>> at >>> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:762)[199:org.eclipse.jetty.servlet:7.2.2.v20101205] >>> >>> Big Thanks >>> >>> -Dan >>> >>> On Wed, Mar 2, 2011 at 11:52 PM, Charles Moulliard <[email protected]> >>> wrote: >>>> Hi Dan, >>>> >>>> Can you make a test using <context:annotation-config/> instead of >>>> <context:component-scan> (see here for more info - >>>> http://wiki.ops4j.org/display/ops4j/Pax+Web+Extender+-+War+-+Examples) >>>> to see if the error is still there ? >>>> >>>> Regards, >>>> >>>> Charles >>>> >>>> >>>> On Thu, Mar 3, 2011 at 8:33 AM, Dan Tran <[email protected]> wrote: >>>>> Hi Charles , thank you for looking into this issue: >>>>> >>>>> Here is the stack trace >>>>> >>>>> Problem accessing /mc/index.jsp. Reason: >>>>> >>>>> Error creating bean with name 'shiroFilter' defined in >>>>> ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot >>>>> resolve reference to bean 'securityManager' while setting bean >>>>> property 'securityManager'; nested exception is >>>>> org.springframework.beans.factory.BeanCreationException: Error >>>>> creating bean with name 'securityManager' defined in ServletContext >>>>> resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference >>>>> to bean 'localRealm' while setting bean property 'realm'; nested >>>>> exception is >>>>> org.springframework.beans.factory.NoSuchBeanDefinitionException: >>>>> No bean named 'localRealm' is defined >>>>> at >>>>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)[93:mc:0.0.0] >>>>> at >>>>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)[93:mc:0.0.0] >>>>> >>>>> >>>>> This means my 'shiroBean' is defined in applicationContext.xml which >>>>> needs to reference 'securityContext' , also defined in the same Spring >>>>> xml file, which then requires 'localRealm' bean which is annotated via >>>>> Spring @Component. >>>>> >>>>> If I manually add my 'localRealm' to the Spring XML, then same issue >>>>> happens on other annotated bean. >>>>> >>>>> It sound like ' <context:component-scan ...' got muted ( no problem >>>>> under Virgo ) >>>>> >>>>> I you see no hints from this log, i will try to scale down the project >>>>> and post it >>>>> >>>>> Thanks >>>>> >>>>> -D >>>>> >>>>> >>>>> On Wed, Mar 2, 2011 at 10:44 PM, Charles Moulliard <[email protected]> >>>>> wrote: >>>>>> Hi Dan, >>>>>> >>>>>> Can you provide us the exception generated in the stack trace of Karaf >>>>>> (using command log:display -n 10) and maybe a test case or the war >>>>>> used to reproduce the error and check what happens ? >>>>>> >>>>>> 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 Thu, Mar 3, 2011 at 3:53 AM, Dan Tran <[email protected]> wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I have a JSF 2.0 + Spring + JPA 2.0 standalone webapp loading fine on >>>>>>> Eclipse Virgo 2.1[1], but not with Karaf. It seems like no Spring >>>>>>> annotated beans can be created. No problem creating beans via XML >>>>>>> configuration thou. >>>>>>> >>>>>>> Any advice for me to trouble this issue? or Have any one successfully >>>>>>> get this combination working? >>>>>>> >>>>>>> Big thanks ahead >>>>>>> >>>>>>> -Dan >>>>>>> >>>>>>> PS: I see the same issue with Karaf 2.1.4 >>>>>>> >>>>>>> [1] >>>>>>> http://www.eclipse.org/forums/index.php?t=msg&goto=657502&S=b35e653a8e2ccc6da8734a1cfb0eed16 >>>>>>> >>>>>> >>>>> >>>> >>> >> >
