Bom dia pessoal, eu fiz um pequenino projeto no eclipse. Na minha máquina local, ele roda perfeitamente, com o tomcat local. A versão do tomcat local da minha máquina é a mesma do servidor que eu tento jogar. Quando eu exportei o projeto para *.war e joguei o arquivo dentro do servidor de aplicação num servidor linux. Aparece alguns erros.
Aqui estão:
An Error Occurred:
javax.el.ELException: /pages/grafico.xhtml @66,63 value="#{procurarRelatorio.listarTodos}": Error reading 'listarTodos' on type br.gov.ce.srh.grafico.bean.ProcurarRelatorio
+- Stack Trace
javax.faces.FacesException: javax.el.ELException: /pages/grafico.xhtml @66,63 value="#{procurarRelatorio.listarTodos}": Error reading 'listarTodos' on type br.gov.ce.srh.grafico.bean.ProcurarRelatorio
at javax.faces.component.UISelectItems.getValue(UISelectItems.java:144)
at com.sun.faces.renderkit.RenderKitUtils.getSelectItems(RenderKitUtils.java:283)
at com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:783)
at com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:280)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:861)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:937)
at javax.faces.render.Renderer.encodeChildren(Renderer.java:148)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:837)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:933)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:532)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:61)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: javax.el.ELException: /pages/grafico.xhtml @66,63 value="#{procurarRelatorio.listarTodos}": Error reading 'listarTodos' on type grafico.bean.ProcurarRelatorio
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76)
at javax.faces.component.UISelectItems.getValue(UISelectItems.java:141)
... 53 more
Caused by: java.lang.NullPointerException
at sun.jdbc.odbc.JdbcOdbcDriver.initialize(JdbcOdbcDriver.java:436)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:153)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at br.gov.ce.srh.grafico.util.DataBaseUtil.getConnection(DataBaseUtil.java:33)
at br.gov.ce.srh.grafico.util.DataBaseUtil.getStatement(DataBaseUtil.java:51)
at br.gov.ce.srh.grafico.dao.MaterialDAO.listarTodos(MaterialDAO.java:48)
at br.gov.ce.srh.grafico.bean.ProcurarRelatorio.listarMateriais(ProcurarRelatorio.java:43)
at br.gov.ce.srh.grafico.bean.ProcurarRelatorio.getListarTodos(ProcurarRelatorio.java:93)
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:597)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
at org.apache.el.parser.AstValue.getValue(AstValue.java:114)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
... 54 more
+- Component Tree
<AjaxViewRoot id="_viewRoot" immediate="false" locale="pt_BR" renderKitId="HTML_BASIC" renderRegionOnly="false" rendered="true" selfRendered="false" submitted="false" transient="false" viewId="/pages/grafico.xhtml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Gerar Gráfico Consumo</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <script language="javascript" type="text/javascript"> function formatar_mascara(src, mascara) { var campo = src.value.length; var saida = mascara.substring(0,1); var texto = mascara.substring(campo); if(texto.substring(0,1) != saida) { src.value += texto.substring(0,1); } } </script> <style> #topo {background:url(/GraficoMaterial/pages/images/grafico_r1_c1.jpg) no-repeat; width:auto; height:88px; background-position:center; } #conteudo {background:url(/GraficoMaterial/pages/images/conteudo-fundo.jpg) no-repeat; width:auto; height:280px; background-position:center; text-align:center; } #rodape {background:url(/GraficoMaterial/pages/images/grafico2_r7_c1.jpg) no-repeat; width:auto; height:75px; background-position:center; } td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; text-align:left; height:58px; } table { position: absolute; left: 360px; } </style> </head>
<body>
<HtmlForm enctype="application/x-www-form-urlencoded" id="j_id3" prependId="true" rendered="true" submitted="false" transient="false">
<center><img /></center> <hr/> <div id="topo"/> <div id="conteudo"> <table width="544" border="0"> <tr> <td width="135"><strong>Nome do Material:</strong></td> <td width="399">
<HtmlSelectOneMenu disabled="false" id="j_id5" immediate="false" localValueSet="false" readonly="false" rendered="true" required="false" transient="false" valid="true">
<UISelectItem id="j_id6" itemDisabled="false" itemEscaped="true" itemLabel="" rendered="true" transient="false"/>
<UISelectItems id="j_id7" rendered="true" transient="false"/>
</HtmlSelectOneMenu>
</td> </tr> <tr> <td><strong>Data Inicial: </strong></td> <td>
<HtmlInputText disabled="false" id="j_id9" immediate="false" localValueSet="false" maxlength="10" onkeypress="javascript:formatar_mascara(this, '##/##/####');" readonly="false" rendered="true" required="false" size="10" transient="false" valid="true"/>
</td> </tr> <tr> <td><strong>Data Final: </strong></td> <td>
<HtmlInputText disabled="false" id="j_id11" immediate="false" localValueSet="false" maxlength="10" onkeypress="javascript:formatar_mascara(this, '##/##/####');" readonly="false" rendered="true" required="false" size="10" transient="false" valid="true"/>
</td> </tr> <tr> <td><strong>Nome do Arquivo: </strong></td> <td>
<HtmlInputText disabled="false" id="j_id13" immediate="false" localValueSet="false" maxlength="-2147483648" readonly="false" rendered="true" required="false" size="-2147483648" transient="false" valid="true"/>
<HtmlCommandButton action="#{procurarRelatorio.GerarGrafico}" actionExpression="#{procurarRelatorio.GerarGrafico}" disabled="false" id="j_id14" immediate="false" readonly="false" rendered="true" transient="false" type="submit" value="Gerar Grafico"/>
</td> </tr> </table> </div> <div id="rodape"/>
</HtmlForm>
</body>
</html>
</AjaxViewRoot>
+- Scoped Variables
Request ParametersName Value
None
Request AttributesName Value
ajaxContext org.ajax4jsf.context.AjaxContextImpl@11dc21
procurarRelatorio br.gov.ce.srh.grafico.bean.ProcurarRelatorio@8b02c5
Session AttributesName Value
None
Application AttributesName Value
None
06/01/2010 08:49:46 - Generated by Facelets
… aqui está meu web.xml
<?xml version="1.0"?>
<web-app version="2.5" 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-app_2_5.xsd">
<description>Facelets StarterKit</description>
<display-name>GraficoMaterial</display-name>
<!-- RichFaces Config -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>emeraldTown</param-value>
<!-- <param-value>classic</param-value> -->
<!-- <param-value>blueSky</param-value> -->
<!-- <param-value>ruby</param-value> -->
<!-- <param-value>wine</param-value> -->
<!-- <param-value>deepMarine</param-value> -->
<!-- <param-value>japanCherry</param-value> -->
<!-- <param-value>plain</param-value> -->
</context-param>
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param>
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
<param-value>classic</param-value>
</context-param>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<context-param>
<param-name>facelets.REFRESH_PERIOD</param-name>
<param-value>2</param-value>
</context-param>
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<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>
<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>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
</web-app>
fiz uma simples classe de conexao aqui …
public class Conexao {
private static String NAME = "sun.jdbc.odbc.JdbcOdbcDriver";
private static String URL = "jdbc:odbc://172.31.128.23:1433/SistemasAccess/Controle de Materiais SRH-MATControle de Materiais SRH-MAT_be;";
private static String LOGIN = "";
private static String PASS = "";
public Conexao() {
}
/**
*
* @return Conexao
* @throws SQLException
* @throws IOException
*/
public static Connection connect() throws SQLException, IOException {
Connection con = null;
try {
Class.forName(NAME);
con = DriverManager.getConnection(URL, LOGIN, PASS);
} catch (ClassNotFoundException e) {
System.out.print("\nNão foi possível estabelecer conexão com a base de dados.\n");
e.printStackTrace();
return null;
}
return con;
}
}
Bom, pelo que vejo é erro com facelets, ou algo do tipo como web.xml … mas n consegui resolver… alguém teria alguma dica ?