org.hibernate.PropertyNotFoundException:在com.elvolcan.saga.pojos.Proyecto类中找不到notaProyectos的getter

时间:2017-08-23 17:41:43

标签: hibernate hibernate-mapping

英语不是我的母语,但我希望它能被理解。我是从hibernate开始的,在这个带有hibernate,JSP,springframewor的JAVA WEB项目中,我无法通过登录,发生以下错误

GlassFish的

Información:   HHH000006: Autocommit mode: false
Información:   HHH000115: Hibernate connection pool size: 20 (min=1)
Información:   HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Información:   HHH000399: Using default transaction strategy (direct JDBC transactions)
Información:   HHH000397: Using ASTQueryTranslatorFactory
Grave:   Inicial SessionFactory creacion org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Advertencia:   #{loginSdiBean.logear}: java.lang.ExceptionInInitializerError
javax.faces.FacesException: #{loginSdiBean.logear}: java.lang.ExceptionInInitializerError
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:416)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:283)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:206)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:180)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:283)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:200)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:132)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:536)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    ... 35 more
Caused by: java.lang.ExceptionInInitializerError
    at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:43)
    at com.elvolcan.saga.hibernate.CatalogoSdi.buscarUsuarioPorUser(CatalogoSdi.java:982)
    at com.beans.LoginSdiBean.logear(LoginSdiBean.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:289)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    ... 36 more
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
    at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185)
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:400)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
    at com.elvolcan.saga.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:33)
    ... 46 more
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:138)
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:188)
    at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:403)
    at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:520)
    at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:148)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)
    ... 51 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:135)
    ... 60 more
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for notaProyectos in class com.elvolcan.saga.pojos.Proyecto
    at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:310)
    at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:304)
    at org.hibernate.mapping.Property.getGetter(Property.java:323)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:411)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:200)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:80)
    ... 65 more

Grave:   javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)

Caused by: java.lang.ExceptionInInitializerError
    at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:43)
    at com.hibernate.CatalogoSdi.buscarUsuarioPorUser(CatalogoSdi.java:982)
    at com.beans.LoginSdiBean.logear(LoginSdiBean.java:80)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at com.sun.el.parser.AstValue.invoke(AstValue.java:289)
    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304)
    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
    at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
    ... 36 more
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
    at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185)
    at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:400)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
    at com.elvolcan.saga.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:33)
    ... 46 more
Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for notaProyectos in class com.elvolcan.saga.pojos.Proyecto
    at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:310)
    at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:304)
    at org.hibernate.mapping.Property.getGetter(Property.java:323)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:411)
    at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:200)
    at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:80)
    ... 65 more

我已经使用了几天了,而且我不确定它是什么我认为库使用hibernate 4.3x以及glassfish 4.1.1 JSP 2.2和springframewor 4.0.1 有谁知道它可能是什么?

从此感谢

HibernateUtil.java

public class HibernateUtil {

    //private static final SessionFactory sessionFactory;
    private static final SessionFactory sessionFactory1;
    /*private static final SessionFactory sessionfactory2=null;
    private static final SessionFactory sessionFactory3=null;
    private static final SessionFactory sessionFactory4=null;
    private static final SessionFactory sessionFactory5=null;*/

    static {
        try {
            // Create the SessionFactory from standard (hibernate.cfg.xml) 
            // config file.
            System.out.println("Construyendo Session Factory");
            sessionFactory1 = new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
            /*Configuration cfg = new Configuration().configure("hibernate.cfg.xml");
            StandardServiceRegistryBuilder sb = new StandardServiceRegistryBuilder();
            sb.applySettings(cfg.getProperties());
            StandardServiceRegistry standardServiceRegistry = sb.build();
            sessionFactory1 = cfg.buildSessionFactory(standardServiceRegistry);*/
            //sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
        } catch (Throwable ex) {
            // Log the exception. 
            System.err.println("Inicial SessionFactory creacion " + ex);
                    throw new ExceptionInInitializerError(ex);
        }
    }

    public static SessionFactory getSessionFactory1() {
        return sessionFactory1;
    }

   /* public static SessionFactory getSessionFactory2() {
        return sessionfactory2;
    }

    public static SessionFactory getSessionFactory3() {
        return sessionFactory3;
    }*/
}`

hibernate.cfg.xml中

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
  <session-factory>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">jdbc:mysql://star.elrio.cl:3306/star?zeroDateTimeBehavior=convertToNull</property>
    <property name="hibernate.connection.username">usuario</property>
    <property name="hibernate.connection.password">clave</property>
    <mapping resource="com/DatosOcOriginal.hbm.xml"/>
    <mapping resource="com/Usuario.hbm.xml"/>
    <mapping resource="com/EstadosOc.hbm.xml"/>
    <mapping resource="com/ProyectoCompras.hbm.xml"/>
    <mapping resource="com/Agendamiento.hbm.xml"/>
    <mapping resource="com/Solicitud.hbm.xml"/>
    <mapping resource="com/UsuarioAplicacion.hbm.xml"/>
    <mapping resource="com/Aplicacion.hbm.xml"/>
    <mapping resource="com/AplicacionVersion.hbm.xml"/>
    <mapping resource="com/Propiedad.hbm.xml"/>
    <mapping resource="com/Proyecto.hbm.xml"/>
    <mapping resource="com/DatosCorreo.hbm.xml"/>
    <mapping resource="com/ProyectoTi.hbm.xml"/>
    <mapping resource="com/EventoUsuario.hbm.xml"/>
    <mapping resource="com/Componente.hbm.xml"/>
    <mapping resource="com/Permiso.hbm.xml"/>
    <mapping resource="com/NotaProyecto.hbm.xml"/>
    <mapping resource="com/ArchivosCargados.hbm.xml"/>
    <mapping resource="com/DatosOc.hbm.xml"/>
    <mapping resource="com/Email.hbm.xml"/>
    <mapping resource="com/Evento.hbm.xml"/>
  </session-factory>
</hibernate-configuration>

Usuario

import java.text.NumberFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.primefaces.model.menu.MenuModel;

/**
 * Usuario generated by hbm2java
 */
public class Usuario implements java.io.Serializable {

    private String rut;
    private String cargo;
    private String user;
    private String pass;
    private int activo;
    private String codErp;
    private String area;
    private String nombre;
    private String apellido1;
    private String apellido2;
    private String email;
    private Date fechaCreacion;
    private Date ultimoAcceso;
    private int vendedor;
    private int admin;
    private int respondeReclamos;
    private double ventaNeta;
    private String ventaNetaString;
    private Set usuarioAplicacions = new HashSet(0);
    private Set solicitudsForUsuarioEmite = new HashSet(0);
    private Set solicitudsForUsuarioRecibe = new HashSet(0);
    private Set emailsForRemitente = new HashSet(0);
    private Set notaProyectos = new HashSet(0);
    private Set emailsForDestinatario = new HashSet(0);

    private Map<String, UsuarioAplicacion> aplicaciones;
    private boolean vendedorBoolean;
    private boolean adminBoolean;

    private MenuModel menuAplicaciones;

    public static final String APP_CONSULTA_TRANSITO = "TRANSI";
    public static final String APP_CONSULTA_HISTORIAL_CLIENTE = "HISTCL";

    public static final String MSJ_NO_SELECCIONADO = "Debe seleccionar un usuario";
    public static final String MSJ_GUARDADO = "Usuario guardado correctamente";
    public static final String MSJ_ACTUALIZADO = "Usuario actualizado correctamente";

    public static final int ACTIVO_SI = 1;
    public static final int ACTIVO_NO = 0;

    public static final int RESPONDE_RECLAMOS_URGENCIAS_SI = 1;
    public static final int RESPONDE_RECLAMOS_URGENCIAS_NO = 0;

    public Usuario() {

    }

    public Usuario(String user, String pass, int activo, String nombre, String apellido1, String apellido2, String email, Date fechaCreacion) {
        this.user = user;
        this.pass = pass;
        this.activo = activo;
        this.nombre = nombre;
        this.apellido1 = apellido1;
        this.apellido2 = apellido2;
        this.email = email;
        this.fechaCreacion = fechaCreacion;
    }

    public Usuario(String user, String pass, int activo, String codErp, String area, String nombre, String apellido1, String apellido2, String email, Date fechaCreacion, Set tabUsuarioAplicacions) {
        this.user = user;
        this.pass = pass;
        this.activo = activo;
        this.codErp = codErp;
        this.area = area;
        this.nombre = nombre;
        this.apellido1 = apellido1;
        this.apellido2 = apellido2;
        this.email = email;
        this.fechaCreacion = fechaCreacion;
        this.usuarioAplicacions = tabUsuarioAplicacions;
    }

    public Map getAplicaciones() {
        aplicaciones = new HashMap<String, UsuarioAplicacion>();

        Iterator it = usuarioAplicacions.iterator();
        UsuarioAplicacion ap = null;
        while (it.hasNext()) {
            ap = (UsuarioAplicacion) it.next();
            aplicaciones.put(ap.getId().getCodAplicacion(), ap);
        }
        return aplicaciones;
    }

//    /////////////////Permiso aplicacion //////////////////////
//    public boolean isTieneConsultaTransito(){
//        UsuarioAplicacion ap = (UsuarioAplicacion) getAplicaciones().get(APP_CONSULTA_TRANSITO);
//        if(ap == null){
//            return false;
//        }else{
//            return true;
//        }
//    }
//    
//    public boolean isTieneConsultaHistorialCliente(){
//        UsuarioAplicacion ap = (UsuarioAplicacion) getAplicaciones().get(APP_CONSULTA_HISTORIAL_CLIENTE);
//        if(ap == null){
//            return false;
//        }else{
//            return true;
//        }
//    }
    public String getVentaNetaString() {
        if (vendedor == 1) {
            Double amount = new Double(ventaNeta);
            NumberFormat numberFormatter;
            String amountOut;

            numberFormatter = NumberFormat.getNumberInstance(new Locale("es"));
            amountOut = numberFormatter.format(amount);

            return "$ " + amountOut;
        } else {
            return "";
        }
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 97 * hash + (this.user != null ? this.user.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Usuario other = (Usuario) obj;
        if ((this.user == null) ? (other.user != null) : !this.user.equals(other.user)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return user;
    }

    public boolean isVendedorBoolean() {
        if (vendedor == 1) {
            return true;
        } else {
            return false;
        }
    }

    public void setVendedorBoolean(boolean vendedorBoolean) {
        this.vendedorBoolean = vendedorBoolean;
        if (this.vendedorBoolean) {
            vendedor = 1;
        } else {
            vendedor = 0;
        }
    }

    public boolean isAdminBoolean() {
        if (admin == 1) {
            return true;
        } else {
            return false;
        }
    }

    public void setAdminBoolean(boolean adminBoolean) {
        this.adminBoolean = adminBoolean;
        if (this.adminBoolean) {
            admin = 1;
        } else {
            admin = 0;
        }
    }

    public int getAdmin() {
        return admin;
    }

    public void setAdmin(int admin) {
        this.admin = admin;
    }

    public MenuModel getMenuAplicaciones() {
        return menuAplicaciones;
    }

    public void setMenuAplicaciones(MenuModel menuAplicaciones) {
        this.menuAplicaciones = menuAplicaciones;
    }

    public String getUser() {
        return this.user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    public String getPass() {
        return this.pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }

    public int getActivo() {
        return this.activo;
    }

    public void setActivo(int activo) {
        this.activo = activo;
    }

    public String getCodErp() {
        return this.codErp;
    }

    public void setCodErp(String codErp) {
        this.codErp = codErp;
    }

    public String getArea() {
        return this.area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getNombre() {
        return this.nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApellido1() {
        return this.apellido1;
    }

    public void setApellido1(String apellido1) {
        this.apellido1 = apellido1;
    }

    public String getApellido2() {
        return this.apellido2;
    }

    public void setApellido2(String apellido2) {
        this.apellido2 = apellido2;
    }

    public String getEmail() {
        return this.email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Date getFechaCreacion() {
        return this.fechaCreacion;
    }

    public void setFechaCreacion(Date fechaCreacion) {
        this.fechaCreacion = fechaCreacion;
    }

    public Set getUsuarioAplicacions() {
        return this.usuarioAplicacions;
    }

    public void setUsuarioAplicacions(Set usuarioAplicacions) {
        this.usuarioAplicacions = usuarioAplicacions;
    }

    public int getVendedor() {
        return vendedor;
    }

    public void setVendedor(int vendedor) {
        this.vendedor = vendedor;
    }

    public double getVentaNeta() {
        return ventaNeta;
    }

    public void setVentaNeta(double ventaNeta) {
        this.ventaNeta = ventaNeta;
    }

    public Date getUltimoAcceso() {
        return ultimoAcceso;
    }

    public void setUltimoAcceso(Date ultimoAcceso) {
        this.ultimoAcceso = ultimoAcceso;
    }

    public Set getSolicitudsForUsuarioEmite() {
        return solicitudsForUsuarioEmite;
    }

    public void setSolicitudsForUsuarioEmite(Set solicitudsForUsuarioEmite) {
        this.solicitudsForUsuarioEmite = solicitudsForUsuarioEmite;
    }

    public Set getSolicitudsForUsuarioRecibe() {
        return solicitudsForUsuarioRecibe;
    }

    public void setSolicitudsForUsuarioRecibe(Set solicitudsForUsuarioRecibe) {
        this.solicitudsForUsuarioRecibe = solicitudsForUsuarioRecibe;
    }

    public int getRespondeReclamos() {
        return respondeReclamos;
    }

    public void setRespondeReclamos(int respondeReclamos) {
        this.respondeReclamos = respondeReclamos;
    }

    public Set getEmailsForRemitente() {
        return emailsForRemitente;
    }

    public void setEmailsForRemitente(Set emailsForRemitente) {
        this.emailsForRemitente = emailsForRemitente;
    }

    public Set getEmailsForDestinatario() {
        return emailsForDestinatario;
    }

    public void setEmailsForDestinatario(Set emailsForDestinatario) {
        this.emailsForDestinatario = emailsForDestinatario;
    }

    public Set getNotaProyectos() {
        return notaProyectos;
    }

    public void setNotaProyectos(Set notaProyectos) {
        this.notaProyectos = notaProyectos;
    }

    /**
     * @return the rut
     */
    public String getRut() {
        return rut;
    }

    /**
     * @param rut the rut to set
     */
    public void setRut(String rut) {
        this.rut = rut;
    }

    /**
     * @return the cargo
     */
    public String getCargo() {
        return cargo;
    }

    /**
     * @param cargo the cargo to set
     */
    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

}

由于观察到的是创建会话的时刻停止工作

     public Usuario buscarUsuarioPorUser(String username) {
            Session session = null;
            try {
 ** HERE FALLS  session = HibernateUtil.getSessionFactory1().openSession();**
                Usuario usuario = (Usuario) session.createCriteria(Usuario.class).
                        add(Restrictions.eq("this.user", username)).
                        uniqueResult();
                if (usuario == null) {
                    System.out.println("USUARIO NULL");
                } else {
                }
                return usuario;
            } catch (HibernateException e) {
                e.printStackTrace();
                return null;
            } finally {
                if (session != null && session.isOpen()) {
                    session.close();
                }
            }
        }

1 个答案:

答案 0 :(得分:0)

 Could not find a getter for notaProyectos in class com.elvolcan.saga.pojos.Proyecto

看起来这是根本原因。从它的外观来看,Hiberate正在尝试初始化pojo&#34; com.elvolcan.saga.pojos.Proyecto&#34;并且无法找到它期望的getter方法notaProyectos。

您可能需要查看com / Proyecto.hbm.xml及其相应的Java类