Hi List...
I know, this is by far not the first post about MyFaces and
Listenerstart woes, quite the contrary.
It's a pitty - it makes people willing to try out MyFaces run away
hard from their first steps.
What happened?
I colleague wanted to try out MyFaces.
My advice: follow the advice given on the MyFaces site EXACTLY,
download the jars, configure yr web.xml (following the examples),
this is what he got:
Dec 12, 2006 9:41:18 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 12, 2006 9:41:18 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/Flido] startup failed due to previous errors
2006-12-12 21:41:18,621 DEBUG [org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/Flido]] - Stopping filters
2006-12-12 21:41:18,623 INFO [org.apache.catalina.core.ContainerBase.
[Catalina].[localhost].[/Flido]] - Shutting down Log4J
(& nothing in the Tomcat logs - Tomcat version 5.5.20 used)
To try to help him out, I went trough my old MyFaces List mails. I
found lots of people were having this exact same problem, yet I
didn't find an answer.
I looked at Jira/the MyFaces site - nothing there either...
Guys, downloading the jars and trying to boot a dead simple app (he
hasn't even a class - just a startup SJF page!) is really the first
thing that people will try. Already the MyFaces site is a bit messy
(to my taste, sorry) in helping people out (e.g. no clear list of
subsequent, documented steps to follow (documented = PLUS links to
complete crucial example files like the web.xml or the examples
themselves. These examples are mentioned > 10 times but without 1 link)
New users are left in the dark too much.
Compare that to the Sun RI: just throw in the jars, no dozen pars
required that explode the web.xml... can we blaim frustrated people?
It really should be simpler.
Add to that these ever recurring Listener start troubles ... I'm
starting to be afraid to recommend MyFaces myself! Despite the fine
components.
Which brings me back to issue: has anyone an idea how to solve it?
Btw his Config = MyFaces 114, tomahawk-sandbox-snapshot115 & Sanbox-
snapshot115. ( & no, the RI jars are not on the CP, nor do they
reside somewhere in Tomcat's CP. And also the Ext. Resource Filter is
not forgotten, cf. web.xml below)
_______________
web.xml: (...)
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="Flido" 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">
<display-name>Flido</display-name>
<!-- First the Spring-Integration context parameters: -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/META-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<description>Comma separated list of URIs of (additional) faces
config files.</description>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/META-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/META-INF/log4j.properties</param-value>
</context-param>
<context-param>
<description>State saving method: "client" or "server" (=
default)</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<description>
This parameter tells MyFaces if javascript code should
be allowed in the rendered HTML output.
If javascript is allowed, command_link anchors will have
javascript code that submits the corresponding form.
If javascript is not allowed, the state saving info and
nested parameters will be added as url parameters.
Defaults to "true"
</description>
<param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>
</description>
<param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<description>If true, rendered HTML code will be formatted,
so that it is "human readable" i.e. additional line separators
and whitespace will be written, that do not influence the
HTML code.
Defaults to "true"
</description>
<param-name>org.apache.myfaces.PRETTY_HTML</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>
If true, a javascript function will be rendered that is
able to restore the former vertical scroll on every request.
Convenient feature if you have pages with long lists and
you do not want the browser page to always jump to the top
if you trigger a link or button action that stays on the
same page.
Defaults to "false".
</description>
<param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<description>
Whether should look for an extension filter. (default =
true)
</description>
<param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</
param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>Context parameter necessary for the
StreamAddResource (i.e. to add streaming external resources)</
description>
<param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
<param-
value>org.apache.myfaces.component.html.util.StreamingAddResource</
param-value>
</context-param>
<!-- Extensions Filter -->
<filter>
<filter-name>JSFExtraResourcesExtensionsFilter</filter-name>
<filter-
class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
<init-param>
<description>Set the size limit for uploaded files.
Format: 10 - 10 bytes
10k - 10 KB
10m - 10 MB
1g - 1 GB
</description>
<param-name>uploadMaxFileSize</param-name>
<param-value>6m</param-value>
</init-param>
<init-param>
<description>Set the path where the intermediary files
will be stored. </description>
<param-name>uploadRepositoryPath</param-name>
<param-value>/temp</param-value>
</init-param>
</filter>
<!-- Listener, that does all the startup work (configuration,
init). -->
<filter-mapping>
<filter-name>JSFExtraResourcesExtensionsFilter</filter-name>
<!-- servlet-name must match the name of your
javax.faces.webapp.FacesServlet entry -->
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>JSFExtraResourcesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
<listener>
<description>Ensures Spring (only > Spring v.2!!) is made aware
of Web-scoped lifecycles (Request/Session/...) </description>
<listener-
class>org.springframework.web.context.request.RequestContextListener</
listener-class>
</listener>
<listener>
<description>Loads the Spring Context (using the Ctx-par
from above!)</description>
<listener-
class>org.springframework.web.context.ContextLoaderListener</listener-
class>
</listener>
<listener>
<description>Listener voor Log4J (gaat de requests dus af
gaan @runtime)</description>
<listener-
class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<!-- 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>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/spring</taglib-uri>
<taglib-location>/resources/tlds/spring.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>/resources/tlds/c.tld</taglib-location>
</taglib>
</jsp-config>
<welcome-file-list>
<welcome-file>Flido/index.jsf</welcome-file>
</welcome-file-list>
<session-config>
<!-- Specifies the session timeout in minutes (0 = never expire)
Can also be retrieved from the HttpSession Object
with its getMaxInactiveInterval method, but this returns the nr of
equivalent seconds, not minutes -->
<session-timeout>0</session-timeout>
</session-config>
</web-app>