java.lang.NoClassDefFoundError: javax/faces/event/PhaseListener that looks like the container doesn't find the myfaces-api.jar
-M On 1/9/07, Yaron Spektor <[EMAIL PROTECTED]> wrote:
Ask and you shall receive :-> The phaseListener is not found.... 2007-01-09 10:34:39,328 [main] ERROR org.apache.catalina.core.ContainerBase.[Cat alina].[localhost].[/BESSA2_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) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12 4) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:299) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1270) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1201) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at org.apache.myfaces.util.ClassUtils.classForName(ClassUtils.java:131) at org.apache.myfaces.util.ClassUtils.simpleClassForName(ClassUtils.java :157) at org.apache.myfaces.util.ClassUtils.newInstance(ClassUtils.java:265) at org.apache.myfaces.config.FacesConfigurator.configureLifecycle(FacesC onfigurator.java:622) at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurat or.java:133) at org.apache.myfaces.webapp.StartupServletContextListener.initFaces(Sta rtupServletContextListener.java:63) at org.apache.myfaces.webapp.StartupServletContextListener.contextInitia lized(StartupServletContextListener.java:46) at org.apache.catalina.core.StandardContext.listenerStart(StandardContex t.java:3763) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 211) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase .java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:73 9) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav a:904) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.j ava:867) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474 ) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java :310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl eSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442 ) at org.apache.catalina.core.StandardService.start(StandardService.java:4 50) at org.apache.catalina.core.StandardServer.start(StandardServer.java:709 ) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432) Jan 9, 2007 10:34:39 AM org.apache.catalina.core.StandardContext start SEVERE: Error listenerStart Jan 9, 2007 10:34:39 AM org.apache.catalina.core.StandardContext start SEVERE: Context [/BESSA2_PROJ] startup failed due to previous errors -----Original Message----- From: Andrew Robinson [mailto:[EMAIL PROTECTED] Sent: Monday, January 08, 2007 8:18 PM To: MyFaces Discussion Subject: Re: FW: onload comp-jsf It is hard to say without the proper logging. Your log4j isn't correctly configured and therefore the logs from the on load listener will not be able to be seen. What JDK are you using (>= 1.5 is required by the current version of the on load listener)? Other than that, please get your log4j environment up and configured correctly and set the loggging for the net.sf.jsfcomp package to debug. On 1/8/07, Yaron Spektor <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I was trying to install the onload custom phaseLoader from comp-jsf. > (http://jsf-comp.sourceforge.net/components/onload/index.html) > > For some reason it is not working. > > I tried following the instructions and put onload-config.xml and > onload-config.xsd under /WEB-INF/ > > When I take: > > <lifecycle> > > <phase-listener>net.sf.jsfcomp.ext.onload.OnLoadPhaseListener</phase-lis tener> > > </lifecycle> > > From faces-config everything works, once I add it I get this error message: > > SEVERE: Context [/BA2_PROJ] startup failed due to previous errors > > > > The entire output is listed below as well as the files I am using for this > test example. > > > > Any ideas? > > Thanks, > > Yaron, > > > > Jan 8, 2007 5:10:22 PM > org.apache.catalina.core.AprLifecycleListener lifecycleEv > > ent > > INFO: The Apache Tomcat Native library which allows optimal performance in > produ > > ction environments was not found on the java.library.path: > C:\java\jdk\bin;.;C:\ > > WINDOWS\system32;C:\WINDOWS;D:\oracle\product\10.2.0\client_1;C:\WINDOWS \system3 > > 2;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\java\bin;C:\java\jdk\bin;C:\Pro gram > Fil > > es\CVSNT\ > > Jan 8, 2007 5:10:22 PM > org.apache.coyote.http11.Http11BaseProtocol init > > INFO: Initializing Coyote HTTP/1.1 on http-8080 > > Jan 8, 2007 5:10:22 PM org.apache.catalina.startup.Catalina > load > > INFO: Initialization processed in 562 ms > > Jan 8, 2007 5:10:23 PM > org.apache.catalina.core.StandardService start > > INFO: Starting service Catalina > > Jan 8, 2007 5:10:23 PM > org.apache.catalina.core.StandardEngine start > > INFO: Starting Servlet Engine: Apache Tomcat/5.5.20 > > Jan 8, 2007 5:10:23 PM > org.apache.catalina.core.StandardHost start > > INFO: XML validation disabled > > log4j:WARN No appenders could be found for logger > (org.apache.commons.digester.D > > igester.sax). > > log4j:WARN Please initialize the log4j system properly. > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ConverterRule end > > WARNING: [ConverterRule]{faces-config/converter} > Merge(null,java.math.BigDecimal > > ) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ConverterRule end > > WARNING: [ConverterRule]{faces-config/converter} > Merge(null,java.math.BigInteger > > ) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ValidatorRule end > > WARNING: [ValidatorRule]{faces-config/validator} > Merge(javax.faces.DoubleRange) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ValidatorRule end > > WARNING: [ValidatorRule]{faces-config/validator} > Merge(javax.faces.LongRange) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ConverterRule end > > WARNING: [ConverterRule]{faces-config/converter} > Merge(javax.faces.Number,null) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ConverterRule end > > WARNING: [ConverterRule]{faces-config/converter} > Merge(javax.faces.DateTime,null > > ) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ComponentRule end > > WARNING: [ComponentRule]{faces-config/component} > Merge(javax.faces.Data) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ComponentRule end > > WARNING: [ComponentRule]{faces-config/component} > Merge(javax.faces.Graphic) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ComponentRule end > > WARNING: [ComponentRule]{faces-config/component} > Merge(javax.faces.Input) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ComponentRule end > > WARNING: [ComponentRule]{faces-config/component} > Merge(javax.faces.Output) > > Jan 8, 2007 5:10:26 PM > com.sun.faces.config.rules.ComponentRule end > > WARNING: [ComponentRule]{faces-config/component} > Merge(javax.faces.Panel) > > Jan 8, 2007 5:10:28 PM > org.apache.catalina.core.StandardContext start > > SEVERE: Error listenerStart > > Jan 8, 2007 5:10:28 PM > org.apache.catalina.core.StandardContext start > > SEVERE: Context [/BA2_PROJ] startup failed due to previous errors > > Jan 8, 2007 5:10:30 PM > org.apache.coyote.http11.Http11BaseProtocol start > > INFO: Starting Coyote HTTP/1.1 on http-8080 > > Jan 8, 2007 5:10:30 PM org.apache.jk.common.ChannelSocket > init > > INFO: JK: ajp13 listening on /0.0.0.0:8009 > > Jan 8, 2007 5:10:30 PM org.apache.jk.server.JkMain start > > INFO: Jk running ID=0 time=0/16 config=null > > Jan 8, 2007 5:10:30 PM > org.apache.catalina.storeconfig.StoreLoader load > > INFO: Find registry server-registry.xml at classpath resource > > Jan 8, 2007 5:10:30 PM org.apache.catalina.startup.Catalina > start > > INFO: Server startup in 7532 ms > > > > > > > > > > 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> > > > >
-- Matthias Wessendorf http://tinyurl.com/fmywh further stuff: blog: http://jroller.com/page/mwessendorf mail: mwessendorf-at-gmail-dot-com