You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Yaron Spektor <ya...@b6systems.com> on 2007/01/11 23:36:35 UTC
Onload - retry
Hi there,
I followed your advice and tried myFaces 1.1.4. Apparently it does not
work either. These are the jars I used:
tomahawk-1.1.5.jar
myfaces-impl-1.1.4.jar
myfaces-api-1.1.4.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.1.jar
ccommons-el-1.0.jar
commons-digester-1.6.jar
commons-lang-2.1.jar
jstl-1.1.0.jar
commons-logging-1.0.4.jar
jakarta-oro.jar
commons-fileupload-1.0.jar
commons-validator.jar
jsfExt.0.8.1.jar
If this doesn't work then it's off to the usual hack with a javaBean
property or Shale PhaseListener....
Any suggestions?
Reminder this is the error message:
2007-01-09 10:34:39,328 [main] ERROR
org.apache.catalina.core.ContainerBase.[Cat
alina].[localhost].[/BEA2_PROJ] - Exception sending context initialized
event to listener instance of class
org.apache.myfaces.webapp.StartupServletContextLis
tener
java.lang.NoClassDefFoundError: javax/faces/event/PhaseListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
my faces-config is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>pc_Master</managed-bean-name>
<managed-bean-class>pagecode.MasterBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>pc_Search</managed-bean-name>
<managed-bean-class>pagecode.SearchBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<lifecycle>
<phase-listener>net.sf.jsfcomp.ext.onload.OnLoadPhaseListener</phase-lis
tener>
</lifecycle>
</faces-config>
the onload-config.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<onload-config xmlns="urn:onload-config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:onload-config onload-config.xsd">
<navigation-rule>
<view-id>/SearchScreen2.jsp</view-id>
<action>#{pc_Search.doBtnPrintAction}</action>
</navigation-rule>
<navigation-rule>
<view-id>/path*</view-id>
<action>#{pc_Search.doBtnPrintAction}</action>
</navigation-rule>
</onload-config>
the web.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener<
/listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</f
ilter-class>
<init-param>
<param-name>maxFileSize</param-name>
<param-value>20m</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>*.faces</url-pattern>
</filter-mapping>
<context-param>
<param-name>onload-config</param-name>
<param-value>/WEB-INF/onload-config.xml</param-value>
</context-param>
</web-app>
i didn't change the xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:onload-config"
xmlns="urn:onload-config"
elementFormDefault="qualified" version="1.0">
<xs:element name="onload-config" type="Config"/>
<xs:complexType name="Config">
<xs:annotation>
<xs:documentation>
Root element. Contains
the configuration for the OnLoadPhaseListener
</xs:documentation>
</xs:annotation>
<xs:sequence maxOccurs="unbounded">
<xs:element name="navigation-rule"
type="Rule"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Rule">
<xs:annotation>
<xs:documentation>
Defines the navigation
rule for a JSF view-id or view-id pattern
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="view-id"
type="ViewId"/>
<xs:element name="action"
type="Action"/>
<xs:element name="success-result"
type="SuccessResult" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ViewId">
<xs:annotation>
<xs:documentation>
The view ID to match.
This can be a full view-id or a path
ending with an asterisk.
Examples: /myDir/myFile.xhtml, /myDir/my*, *
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="Action">
<xs:annotation>
<xs:documentation>
The EL syntax action
name to invoke. This is the same syntax as
when specifying an
action in the JSF page.
Example:
#{myBean.myActionMethod}
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
<xs:simpleType name="SuccessResult">
<xs:annotation>
<xs:documentation>
If the result of an
action is null or equal to the success result,
nothing is done. If the
result is not equal to the success result
the result is used to
navigate to a new view based on the
faces configuration
file.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string"/>
</xs:simpleType>
</xs:schema>
Re: Onload - retry
Posted by Andrew Robinson <an...@gmail.com>.
I'm not sure why your classpath is not finding the phase listener as
it is in myfaces-api.jar.
As for on-load, please use 0.9.0 instead of 0.8.x.
Are you sure your WAR file has "/WEB-INF/lib/myfaces-api-1.1.4.jar" in it?
On 1/11/07, Yaron Spektor <ya...@b6systems.com> wrote:
>
>
>
>
> Hi there,
>
> I followed your advice and tried myFaces 1.1.4. Apparently it does not work
> either. These are the jars I used:
>
> tomahawk-1.1.5.jar
>
> myfaces-impl-1.1.4.jar
>
> myfaces-api-1.1.4.jar
>
> commons-beanutils-1.7.0.jar
>
> commons-codec-1.3.jar
>
> commons-collections-3.1.jar
>
> ccommons-el-1.0.jar
>
> commons-digester-1.6.jar
>
> commons-lang-2.1.jar
>
> jstl-1.1.0.jar
>
> commons-logging-1.0.4.jar
>
> jakarta-oro.jar
>
> commons-fileupload-1.0.jar
>
> commons-validator.jar
>
> jsfExt.0.8.1.jar
>
>
>
> If this doesn't work then it's off to the usual hack with a javaBean
> property or Shale PhaseListener….
>
> Any suggestions?
>
>
>
> Reminder this is the error message:
>
> 2007-01-09 10:34:39,328 [main] ERROR
>
> org.apache.catalina.core.ContainerBase.[Cat
>
> alina].[localhost].[/BEA2_PROJ] - Exception sending context initialized
> event to listener instance of class
> org.apache.myfaces.webapp.StartupServletContextLis
>
> tener
>
> java.lang.NoClassDefFoundError: javax/faces/event/PhaseListener
>
> at java.lang.ClassLoader.defineClass1(Native
> Method)
>
> at
> java.lang.ClassLoader.defineClass(ClassLoader.java:620)
>
>
>
>
>
>
>
>
>
> my faces-config is:
>
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
> Faces Config 1.1//EN"
> "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
>
> <faces-config>
>
> <managed-bean>
>
> <managed-bean-name>pc_Master</managed-bean-name>
>
> <managed-bean-class>pagecode.MasterBean</managed-bean-class>
>
> <managed-bean-scope>request</managed-bean-scope>
>
> </managed-bean>
>
> <managed-bean>
>
>
> <managed-bean-name>pc_Search</managed-bean-name>
>
>
> <managed-bean-class>pagecode.SearchBean</managed-bean-class>
>
>
> <managed-bean-scope>session</managed-bean-scope>
>
> </managed-bean>
>
> <lifecycle>
>
> <phase-listener>net.sf.jsfcomp.ext.onload.OnLoadPhaseListener</phase-listener>
>
> </lifecycle>
>
>
>
> </faces-config>
>
>
>
> the onload-config.xml is:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>
>
> <onload-config xmlns="urn:onload-config"
>
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> xsi:schemaLocation="urn:onload-config
> onload-config.xsd">
>
>
>
> <navigation-rule>
>
>
> <view-id>/SearchScreen2.jsp</view-id>
>
>
> <action>#{pc_Search.doBtnPrintAction}</action>
>
> </navigation-rule>
>
> <navigation-rule>
>
> <view-id>/path*</view-id>
>
>
> <action>#{pc_Search.doBtnPrintAction}</action>
>
> </navigation-rule>
>
> </onload-config>
>
>
>
>
>
>
>
> the web.xml is:
>
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
>
> <context-param>
>
> <param-name>javax.faces.CONFIG_FILES</param-name>
>
> <param-value>/WEB-INF/faces-config.xml</param-value>
>
> </context-param>
>
> <listener>
>
>
> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
>
> </listener>
>
> <servlet>
>
> <servlet-name>Faces Servlet</servlet-name>
>
> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>
> <load-on-startup>0</load-on-startup>
>
> </servlet>
>
> <servlet-mapping>
>
> <servlet-name>Faces Servlet</servlet-name>
>
> <url-pattern>*.faces</url-pattern>
>
> </servlet-mapping>
>
> <filter>
>
> <filter-name>MyFacesExtensionsFilter</filter-name>
>
>
> <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
>
> <init-param>
>
> <param-name>maxFileSize</param-name>
>
> <param-value>20m</param-value>
>
> </init-param>
>
> </filter>
>
> <filter-mapping>
>
> <filter-name>MyFacesExtensionsFilter</filter-name>
>
> <url-pattern>*.faces</url-pattern>
>
> </filter-mapping>
>
> <context-param>
>
> <param-name>onload-config</param-name>
>
> <param-value>/WEB-INF/onload-config.xml</param-value>
>
> </context-param>
>
> </web-app>
>
>
>
>
>
>
>
> i didn't change the xsd:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
> targetNamespace="urn:onload-config"
>
> xmlns="urn:onload-config"
>
> elementFormDefault="qualified" version="1.0">
>
>
>
> <xs:element name="onload-config" type="Config"/>
>
>
>
> <xs:complexType name="Config">
>
> <xs:annotation>
>
> <xs:documentation>
>
> Root element. Contains the
> configuration for the OnLoadPhaseListener
>
> </xs:documentation>
>
> </xs:annotation>
>
> <xs:sequence maxOccurs="unbounded">
>
> <xs:element name="navigation-rule"
> type="Rule"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
>
>
> <xs:complexType name="Rule">
>
> <xs:annotation>
>
> <xs:documentation>
>
> Defines the navigation rule
> for a JSF view-id or view-id pattern
>
> </xs:documentation>
>
> </xs:annotation>
>
> <xs:sequence>
>
> <xs:element name="view-id"
> type="ViewId"/>
>
> <xs:element name="action"
> type="Action"/>
>
> <xs:element name="success-result"
> type="SuccessResult" minOccurs="0"/>
>
> </xs:sequence>
>
> </xs:complexType>
>
>
>
> <xs:simpleType name="ViewId">
>
> <xs:annotation>
>
> <xs:documentation>
>
> The view ID to match. This
> can be a full view-id or a path
>
> ending with an asterisk.
> Examples: /myDir/myFile.xhtml, /myDir/my*, *
>
> </xs:documentation>
>
> </xs:annotation>
>
> <xs:restriction base="xs:string"/>
>
> </xs:simpleType>
>
>
>
> <xs:simpleType name="Action">
>
> <xs:annotation>
>
> <xs:documentation>
>
> The EL syntax action name to
> invoke. This is the same syntax as
>
> when specifying an action in
> the JSF page.
>
> Example:
> #{myBean.myActionMethod}
>
> </xs:documentation>
>
> </xs:annotation>
>
> <xs:restriction base="xs:string"/>
>
> </xs:simpleType>
>
>
>
> <xs:simpleType name="SuccessResult">
>
> <xs:annotation>
>
> <xs:documentation>
>
> If the result of an action
> is null or equal to the success result,
>
> nothing is done. If the
> result is not equal to the success result
>
> the result is used to
> navigate to a new view based on the
>
> faces configuration file.
>
> </xs:documentation>
>
> </xs:annotation>
>
> <xs:restriction base="xs:string"/>
>
> </xs:simpleType>
>
>
>
> </xs:schema>
>
>