still struggling - heres were i have got to
1. works fina if i do a grails WAR and manually load into external tomcat
2. fails with errors when accessing the same facelet page in embedded tomcat dev mode
if you look at the error its from spring mvc calling into faces to do a Lifecycle factory lookup
with root cause
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 application and that all the necessary libs are included. Also check 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:286)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:206)
at org.springframework.faces.mvc.JsfView.createFacesLifecycle(JsfView.java:108)
at org.springframework.faces.mvc.JsfView.afterPropertiesSet(JsfView.java:53)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:386)
at org.springframework.web.servlet.view.UrlBasedViewResolver.applyLifecycleMethods(UrlBasedViewResolver.java:442)
at org.springframework.web.servlet.view.UrlBasedViewResolver.loadView(UrlBasedViewResolver.java:437)
at org.springframework.web.servlet.view.AbstractCachingViewResolver.createView(AbstractCachingViewResolver.java:186)
at org.springframework.web.servlet.view.UrlBasedViewResolver.createView(UrlBasedViewResolver.java:401)
at org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:103)
at org.springframework.web.servlet.DispatcherServlet.resolveViewName(DispatcherServlet.java:1211)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1160)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
so heres what i tried to do
i have written some extension classes in plugin project that extend the myfaces classes - just so i could see whether my code was getting called
- i've add a WillsMyfacesServlet, WillsStartupServletContextListener and WillsJsfLifecycleFactoryImpl
for the latter i added a line in my faces-config to register the WillsJsfLifecycleFactoryImpl like this
<lifecycle-factory>
com.softwood.web.WillsJsfLifecycleFactoryImpl
</lifecycle-factory>
my StartupContextListner is registered in the web.xml in the plugin doWithWebDescriptor closure
listeners + {
listener {
'listener-class'('com.softwood.web.WillsStartupServletContextListener')
}
}
i can see my debug code printing on startup like this
however when i try and access my facelet at
/app/home, i only get this. this first part is my trace print from my servletContextListener.requestInitialised (not sure if it should look liek these values at this time or not)
the the code fails - but it doesnt this time seem to go through my WillsJsfLifecycleFactoryImpl - as i see no debug from my getLifecycle method
[code=java]
request initialised notified to listener
> got content type null
> got dispatcher type REQUEST
> got local name 0.0.0.0
> got char encoding null
> got content length -1
| Error 2012-04-25 11:33:05,901 [http-bio-8080-exec-6] ERROR [/aflowMyfacesPlugin].[springmvc] - Servlet.service() for servlet [springmvc] in context with path [/aflowMyfacesPlugin] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/home': Invocation of init method failed; nested exception is 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 application and that all the necessary libs are included. Also check 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>
] with root cause
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 application and that all the necessary libs are included. Also check 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:286)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:206)
at org.springframework.faces.mvc.JsfView.createFacesLifecycle(JsfView.java:108)
at org.springframework.faces.mvc.JsfView.afterPropertiesSet(JsfView.java:53)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:386)
at org.springframework.web.servlet.view.UrlBasedViewResolver.applyLifecycleMethods(UrlBasedViewResolver.java:442)
at org.springframework.web.servlet.view.UrlBasedViewResolver.loadView(UrlBasedViewResolver.java:437)
at org.springframewor
[code]
that kinda implies to me that there must be another
thread in spring somewhere ? which hasnt loaded my class from the faces-config - and is trying to do a lookup using the apches classes and fails for some reason.
kind of seriously lost here - would really appreciate any ones help to try and sort of why it fails in embedded mode and then request a fix from someone (spring?) to fix it
Will