Tenho postado poucas dúvidas, pois a maioria delas resolvi apenas observando os tópicos deste forum. Só que dessa vez não consegui encontrar uma solução.
Estou com um projeto web no eclipse galileo e servidor JBoss 4.2.
O erro inteiro segue abaixo.
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Cant instantiate class: br.com.cearadiesel.sistematica.controller.TemperaturaBean.. [PersistenceUnit: sistematica] class or package not found
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
javax.faces.FacesException: Cant instantiate class: br.com.cearadiesel.sistematica.controller.TemperaturaBean.. [PersistenceUnit: sistematica] class or package not found
com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:282)
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:546)
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
org.apache.el.parser.AstValue.getValue(AstValue.java:86)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
javax.persistence.PersistenceException: [PersistenceUnit: sistematica] class or package not found
org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1089)
org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:886)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:772)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:183)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:240)
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
br.com.cearadiesel.sistematica.dao.TemperaturaDao.<init>(TemperaturaDao.java:16)
br.com.cearadiesel.sistematica.controller.TemperaturaBean.<init>(TemperaturaBean.java:16)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:277)
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:546)
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
org.apache.el.parser.AstValue.getValue(AstValue.java:86)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.ClassNotFoundException: No ClassLoaders found for: WEB-INF.classes.br.com.cearadiesel.sistematica.model.Temperatura
org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:112)
org.hibernate.ejb.Ejb3Configuration.classForName(Ejb3Configuration.java:1005)
org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1077)
org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactory(Ejb3Configuration.java:886)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:772)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:183)
org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:240)
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:120)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
br.com.cearadiesel.sistematica.dao.TemperaturaDao.<init>(TemperaturaDao.java:16)
br.com.cearadiesel.sistematica.controller.TemperaturaBean.<init>(TemperaturaBean.java:16)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
java.lang.reflect.Constructor.newInstance(Unknown Source)
java.lang.Class.newInstance0(Unknown Source)
java.lang.Class.newInstance(Unknown Source)
com.sun.faces.config.ManagedBeanFactoryImpl.newInstance(ManagedBeanFactoryImpl.java:277)
com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:546)
com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:45)
org.apache.el.parser.AstValue.getValue(AstValue.java:86)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101)
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.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.
--------------------------------------------------------------------------------
JBossWeb/2.0.1.GA
TemperaturaBean.java
package br.com.cearadiesel.sistematica.controller;
import java.util.ArrayList;
import java.util.List;
import br.com.cearadiesel.sistematica.dao.TemperaturaDao;
import br.com.cearadiesel.sistematica.model.Temperatura;
public class TemperaturaBean {
Temperatura temperatura;
TemperaturaDao dao;
List<Temperatura> lista = new ArrayList<Temperatura>();
public TemperaturaBean() {
temperatura = new Temperatura();
dao = new TemperaturaDao();
}
public void findAll() {
this.lista = dao.findAll();
}
public Temperatura getTemperatura() {
return temperatura;
}
public void setTemperatura(Temperatura temperatura) {
this.temperatura = temperatura;
}
public List<Temperatura> getLista() {
return lista;
}
public void setLista(List<Temperatura> lista) {
this.lista = lista;
}
}
TemperaturaDao.java
package br.com.cearadiesel.sistematica.dao;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import br.com.cearadiesel.sistematica.model.Temperatura;
public class TemperaturaDao {
Temperatura temperatura = new Temperatura();
EntityManager em;
public TemperaturaDao() {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("sistematica");
em = emf.createEntityManager();
}
public List<Temperatura> findAll() {
return em.createNamedQuery("SELECT * FROM temperatura").getResultList();
}
}
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="sistematica" transaction-type="RESOURCE_LOCAL">
<class>br.com.cearadiesel.sistematica.model.Temperatura</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/sistematica"/>
<property name="javax.persistence.jdbc.user" value="marcus"/>
<property name="javax.persistence.jdbc.password" value="123456"/>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
</properties>
</persistence-unit>
</persistence>
TemperaturaList.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title></title>
</head>
<body>
<f:view>
<h:form id="formTemperaturaList">
<h:dataTable id="listas" value="#{temperaturaBean.findAll}" var="itens" cellpadding="1" cellspacing="1" border="1">
<h:column>
<f:facet name="header">
<h:outputText value="Descrição" />
</f:facet>
<h:outputText value="#{itens.descricao}"/>
</h:column>
</h:dataTable>
</h:form>
</f:view>
</body>
</html>
Poderiam me ajudar onde estou errando?