Olá,
estou tentando fazer um exemplo usando JSF com MYFACE mas na hora de executar com TOMCAT apresenta o erro abaixo.
O que estou usando :
Eclipse Version: 3.4.0
MyFaces Core 1.2.7
TOmcat 5.5
java 1.5
se alguém puder me ajudar agradeceria…
abs
06/09/2009 18:49:29 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_12\bin;.;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.5.0_12/bin/client;C:/Program Files/Java/jre1.5.0_12/bin;D:\oracle\product\10.2.0\db_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE;C:\Program Files\Java\jdk1.5.0_12\bin;d:\apache-ant-1.6.1\bin;C:\Program Files\QuickTime\QTSystem\
06/09/2009 18:49:29 org.apache.coyote.http11.Http11BaseProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
06/09/2009 18:49:29 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1962 ms
06/09/2009 18:49:30 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
06/09/2009 18:49:30 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.25
06/09/2009 18:49:30 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
06/09/2009 18:49:30 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.apache.myfaces.webapp.StartupServletContextListener
java.lang.NoClassDefFoundError: javax/el/ExpressionFactory
at org.apache.myfaces.webapp.StartupServletContextListener.getFacesInitializer(StartupServletContextListener.java:91)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:72)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3764)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4216)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
06/09/2009 18:49:30 org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
06/09/2009 18:49:30 org.apache.catalina.core.StandardContext start
SEVERE: Context [/springjsf] startup failed due to previous errors
06/09/2009 18:49:31 org.apache.myfaces.config.annotation.DefaultLifecycleProviderFactory getLifecycleProvider
INFO: No ExternalContext using fallback LifecycleProvider.
06/09/2009 18:49:31 org.apache.myfaces.config.annotation.DefaultLifecycleProviderFactory getLifecycleProvider
INFO: Using LifecycleProvider org.apache.myfaces.config.annotation.NoAnnotationLifecyleProvider
06/09/2009 18:49:31 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
06/09/2009 18:49:31 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
06/09/2009 18:49:31 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/145 config=null
06/09/2009 18:49:31 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
06/09/2009 18:49:32 org.apache.catalina.startup.Catalina start
INFO: Server startup in 2365 ms
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<f:view>
<h:form>
<h:panelGrid columns="2">
<h:outputLabel for="email" value="Email:"/>
<h:inputText id="email" value="#{usuarioFormBean.usuario.email}"/>
<h:outputLabel for="nome" value="Nome:"/>
<h:inputText id="nome" value="#{usuarioFormBean.usuario.nome}"/>
<h:outputLabel for="telefone" value="Telefone:"/>
<h:inputText id="telefone" value="#{usuarioFormBean.usuario.telefone}"/>
</h:panelGrid>
<h:commandButton value="Inserir" action="#{usuarioFormBean.inserir}"/>
<f:verbatim></f:verbatim>
<f:verbatim></f:verbatim>
<h:dataTable value="#{usuarioFormBean.usuarios}" var="usuario" width="30%" border="1" cellpading="0" cellspacing="0">
<h:column>
<f:facet name="Header">
<h:outputText value="Email"/>
</f:facet>
<h:outputText value="#{usuario.email}"/>
</h:column>
<h:column>
<f:facet name="Header">
<h:outputText value="Nome"/>
</f:facet>
<h:outputText value="#{usuario.nome}"/>
</h:column>
<h:column>
<f:facet name="Header">
<h:outputText value="Telefone"/>
</f:facet>
<h:outputText value="#{usuario.telefone}"/>
</h:column>
</h:dataTable>
</h:form>
</f:view>
</body>
</html>
-----
web.xml
<display-name>
springjsf</display-name>
<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>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
----
--faces-config.xml
<faces-config>
<managed-bean>
<managed-bean-name>usuarioFormBean</managed-bean-name>
<managed-bean-class>br.com.jm.springjsf.UsuarioFormBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<display-name>index</display-name>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>sucesso</from-outcome>
<to-view-id>/index.jsp</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>