Ola estou iniciando do 0 com hibernate estou criando um exemplo de uma video aula da DevMedia onde ele cria uma classe user,product,sale e hibernate util e cria também suas classes DAO um GenericDAO e um User Face onde el cria um CachedUsers…e 2 interfaces web jsf. qyando executo a aplicação ele gera um erro no cached aqi um pedaço do erro
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: /users.jsp(20,12) ‘#{userFace.cachedUsers}’ Error reading ‘cachedUsers’ on type devmedia.faces.UserFace
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
org.apache.jasper.el.JspELException: /users.jsp(20,12) ‘#{userFace.cachedUsers}’ Error reading ‘cachedUsers’ on type devmedia.faces.UserFace
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:112)
javax.faces.component.UIData.getValue(UIData.java:582)
vou colocar como esta onde esta meu cached e onde chamei ele na classe usuario logo abaixo se alguem puder ajudar agradeço
Código da Classe User.Jsf[code]
<%@page contentType=“text/html” pageEncoding=“UTF-8”%>
<%@taglib prefix=“f” uri=“http://java.sun.com/jsf/core”%>
<%@taglib prefix=“h” uri=“http://java.sun.com/jsf/html”%>
<f:view>
JSP PageMenu de Usuarios
<h:column>
<f:facet name="header">
<h:outputText value="Nome"/>
</f:facet>
<h:outputText value="#{item.name}"/>
</h:column>
</h:dataTable>
</h:form>
</body>
[/code]
Classe UserFace
Código[code]
package devmedia.faces;
import devmedia.dao.UserDAO;
import devmedia.entity.User;
import java.util.List;
/**
*
-
@author Claudio
*/
public class UserFace {private List cachedUsers = null;
private UserDAO userDAO = new UserDAO();
/** Creates a new instance of UserFace */
public UserFace() {
}public List getCachedUsers() {
if (cachedUsers == null) {
cachedUsers = userDAO.getUsers();} return cachedUsers;
}
}
[/code]
Aqui o Erro Todo vai q nao to conseguindo ver o erro srsr
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: /products.jsp(20,12) '#{productFace.cachedProducts}' Error reading 'cachedProducts' on type devmedia.faces.ProductFace
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
org.apache.jasper.el.JspELException: /products.jsp(20,12) '#{productFace.cachedProducts}' Error reading 'cachedProducts' on type devmedia.faces.ProductFace
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:112)
javax.faces.component.UIData.getValue(UIData.java:582)
javax.faces.component.UIData.getDataModel(UIData.java:1063)
javax.faces.component.UIData.setRowIndex(UIData.java:417)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:85)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
javax.faces.component.UIData.encodeBegin(UIData.java:879)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
org.hibernate.exception.SQLGrammarException: could not execute query
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.doList(Loader.java:2231)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
devmedia.dao.GenericDAO.getPureList(GenericDAO.java:81)
devmedia.dao.ProductDAO.getProducts(ProductDAO.java:36)
devmedia.faces.ProductFace.getCachedProducts(ProductFace.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.el.BeanELResolver.getValue(BeanELResolver.java:87)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
org.apache.el.parser.AstValue.getValue(AstValue.java:169)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:106)
javax.faces.component.UIData.getValue(UIData.java:582)
javax.faces.component.UIData.getDataModel(UIData.java:1063)
javax.faces.component.UIData.setRowIndex(UIData.java:417)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:85)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
javax.faces.component.UIData.encodeBegin(UIData.java:879)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
java.sql.SQLSyntaxErrorException: O esquema 'HIBERNATE' não existe
org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
org.hibernate.loader.Loader.doQuery(Loader.java:696)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
devmedia.dao.GenericDAO.getPureList(GenericDAO.java:81)
devmedia.dao.ProductDAO.getProducts(ProductDAO.java:36)
devmedia.faces.ProductFace.getCachedProducts(ProductFace.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.el.BeanELResolver.getValue(BeanELResolver.java:87)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
org.apache.el.parser.AstValue.getValue(AstValue.java:169)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:106)
javax.faces.component.UIData.getValue(UIData.java:582)
javax.faces.component.UIData.getDataModel(UIData.java:1063)
javax.faces.component.UIData.setRowIndex(UIData.java:417)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:85)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
javax.faces.component.UIData.encodeBegin(UIData.java:879)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
root cause
org.apache.derby.client.am.SqlException: O esquema 'HIBERNATE' não existe
org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
org.apache.derby.client.am.Statement.readPrepareDescribeOutput(Unknown Source)
org.apache.derby.client.am.PreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
org.apache.derby.client.am.PreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
org.apache.derby.client.am.PreparedStatement.prepare(Unknown Source)
org.apache.derby.client.am.Connection.prepareStatementX(Unknown Source)
org.apache.derby.client.am.Connection.prepareStatement(Unknown Source)
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:534)
org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:452)
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)
org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
org.hibernate.loader.Loader.doQuery(Loader.java:696)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
devmedia.dao.GenericDAO.getPureList(GenericDAO.java:81)
devmedia.dao.ProductDAO.getProducts(ProductDAO.java:36)
devmedia.faces.ProductFace.getCachedProducts(ProductFace.java:27)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
javax.el.BeanELResolver.getValue(BeanELResolver.java:87)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:67)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
org.apache.el.parser.AstValue.getValue(AstValue.java:169)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:106)
javax.faces.component.UIData.getValue(UIData.java:582)
javax.faces.component.UIData.getDataModel(UIData.java:1063)
javax.faces.component.UIData.setRowIndex(UIData.java:417)
com.sun.faces.renderkit.html_basic.TableRenderer.encodeBegin(TableRenderer.java:85)
javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:788)
javax.faces.component.UIData.encodeBegin(UIData.java:879)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:884)
javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:245)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.11 logs.
--------------------------------------------------------------------------------