Troubles with using PhaseListener implementation
serrgblues Mar 15, 2007 5:38 AMI use JBoss 4.0.4GA+JSF(1.2_04-b07-FCS)+Facelets(1.1.11)
My web.xml file :
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > <!-- Use Documents Saved as *.xhtml --> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.jsf</param-value> </context-param> <!-- Special Debug Output for Development --> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <!-- Optional JSF-RI Parameters to Help Debug --> <context-param> <param-name>com.sun.faces.validateXml</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>com.sun.faces.verifyObjects</param-name> <param-value>true</param-value> </context-param> <!-- Faces Servlet --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> <security-constraint> <display-name>Restrict XHTML Documents</display-name> <web-resource-collection> <web-resource-name>JSF</web-resource-name> <url-pattern>*.jsf</url-pattern> </web-resource-collection> <auth-constraint> <description>Only Let 'developer's access JSF pages</description> <role-name>developer</role-name> </auth-constraint> </security-constraint> <security-role> <role-name>developer</role-name> </security-role> </web-app>
And faces-config.xml file :
<?xml version='1.0' encoding='UTF-8'?> <faces-config xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd" version="1.2"> <application> <view-handler> com.sun.facelets.FaceletViewHandler </view-handler> </application> <!-- our NumberBean we just created --> <managed-bean> <managed-bean-name>loginBean</managed-bean-name> <managed-bean-class>com.fabulous_valley.managed_beans.login.LoginBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> <managed-bean> <managed-bean-name>prototypeBean</managed-bean-name> <managed-bean-class>com.fabulous_valley.PrototypeBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>testString</property-name> <value>test</value> </managed-property> </managed-bean> </faces-config>
And all worked ...
But if I try to use
<lifecycle> <phase-listener> com.mydomen.web.MyPhaseListener </phase-listener> </lifecycle>
in faces-config.xml, then in deploy stage I have next message :
13:27:14,941 INFO [Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)] Started in 25s:970ms
13:27:15,160 ERROR [[/]] StandardWrapper.Throwable
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:256)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:142)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
How can I fix this problem Help me please ...