Announcement Announcement Module
Collapse
No announcement yet.
lost in webflow and jsp with grails Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • lost in webflow and jsp with grails

    this is follow on to earlier post http://forum.springsource.org/showth...d-grails-2-0-3

    essentially i have tried to add faces capability ontop of grails. This works when i generate WAR and manually publish to tomcat 7 - but fails in dev mode working when ever i try and access my facelets pages .

    Code:
    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)
    ....
    essentially this plugin fails in embedded tomcat mode with both mojarra and myfaces

    I have tried to put some intercept code into the faces, jsp stuff so i can see whats getting called and what isnt

    so ive extended StartupServletContextListener and but the tracing version in the web.xml

    i've extended the MyfacesServlet to show it gets created

    i've extended the LifecycleFactoryImpl and added a line my faces-config for this

    Code:
    		<lifecycle-factory>
    			com.softwood.web.WillsJsfLifecycleFactoryImpl
    		</lifecycle-factory>

    as you can see the error is in org.springframework.faces.mvc.JsfView.createFacesL ifecycle(JsfView.java:108)

    which if you look at the source code is this line 108 is the getFactory(FactoryFinder.LIFECYCLE_FACTORY); call
    Code:
    private Lifecycle createFacesLifecycle() {
    		LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder
    				.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
    		return lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
    	}
    Now i just cant figure this out -

    when the embedded server starts i get to see stuff like this
    Code:
    ..
    jsf lifecycle impl : wills jsf lifecyle factory constructor called 
      jsf lifecycle impl : get lifcecyle instance for DEFAULT returned org.apache.myfaces.lifecycle.LifecycleImpl@1bdfbf625-Apr-2012 11:02:03 org.apache.myfaces.config.FacesConfigurator handle
    
    ...
    faces is using contextPath : /aflowMyfacesPlugin
      jsf lifecycle impl : get lifcecyle instance for DEFAULT returned org.apache.myfaces.lifecycle.LifecycleImpl@1bdfbf6
    ->wills my faces servlet : faces servlet constructor called 
      jsf lifecycle impl : get lifcecyle instance for DEFAULT returned org.apache.myfaces.lifecycle.LifecycleImpl@1bdfbf625-Apr-2012 11:02:03 org.apache.myfaces.webapp.MyFacesServlet init
    
    ..
    INFO: MyFacesServlet for context 'C:\Users\802518659\Documents\grails-workspace\aflowMyfacesPlugin\web-app\' initialized.
    
    | Server running. Browse to http://localhost:8080/aflowMyfacesPlugin
    but and the embedded server starts - however if i access my facelet on /app/home

    i can see my listener being called


    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

    then i just get the error hilighted previously


    whats weird is its reporting failure to lookup Lifecyle -via the factory - but this doesnt seem to intercept the extending jsf factory impl class i have added in my project and registered in the faces-config (but which are called in the startup phases)

    its almost as though theres a seperate thread class tree in spring mvc estate without my classes loaded at all. and in that thread the Factory Lookup fails.

    I repeat this all works fine in externalised WAR into tomcat but fails like this in dev tomcat embedded mode.

    does any one have a clue what may be happening

    regards will
Working...
X