title: org.hibernate.engine.jdbc.spi.SqlExceptionHelper - Column with name «name» isn't present in this «ResultSet» Hibernate with PostgreSQL JDBC
body: <p>As the subject says, I have that error in Hibernate 5 with a PostgreSQL DB.</p>
  
  <p>The query that Hibernate returns to me is:
  <code>SELECT u.email, u.password FROM utenti u WHERE u.email = ?</code> (so it's correct)
  and the table is:</p>
  
  <pre><code>utenti(email (pk), password, nome, cognome, datanascita, sesso)
  </code></pre>
  
  <p>Moreover, I get another error:
  Exception starting filter struts2 </p>
  
  <pre><code>Unable to load configuration. - action - file:&lt;path&gt;/NetBeansProjects/DBIIProject/target/DBIIProject-1.0-SNAPSHOT/WEB-INF/classes/struts.xml:15:34
  </code></pre>
  
  <p>My <code>struts.xml</code> is:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
      "http://struts.apache.org/dtds/struts-2.3.dtd"&gt;
  &lt;struts&gt;
  
      &lt;constant name="struts.enable.DynamicMethodInvocation" value="false"/&gt;
      &lt;constant name="struts.devMode" value="true"/&gt;
  
      &lt;!-- Cambio l'estensione delle Action da .action a .do --&gt;
      &lt;constant name="struts.action.extension" value="do" /&gt;
  
      &lt;package name="default" extends="struts-default" namespace="/"&gt;
          &lt;action name="Login" class="org.altervista.cdpjavaexamples.dbiiproject.actions.LoginAction" method="execute"&gt;
              &lt;result name="success"&gt;index.jsp&lt;/result&gt;
              &lt;result name="input"&gt;login.jsp&lt;/result&gt;
          &lt;/action&gt;
          &lt;action name="Logout" class="org.altervista.cdpjavaexamples.dbiiproject.actions.LogoutAction" method="execute"&gt;
              &lt;result name="success"&gt;index.jsp&lt;/result&gt;
          &lt;/action&gt;
          &lt;action name="PasswordRecovery" class="org.altervista.cdpjavaexamples.dbiiproject.actions.PasswordRecoveryAction" method="execute"&gt;
              &lt;result name="success"&gt;password_recovery.jsp&lt;/result&gt;
              &lt;result name="input"&gt;password_recovery.jsp&lt;/result&gt;
          &lt;/action&gt;
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>
  
  <p>My pom.xml is:</p>
  
  <pre class="lang-xml prettyprint-override"><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;org.altervista.cdpjavaexamples&lt;/groupId&gt;
      &lt;artifactId&gt;DBIIProject&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;name&gt;DBIIProject&lt;/name&gt;
  
      &lt;properties&gt;
          &lt;struts2.version&gt;2.3.24.1&lt;/struts2.version&gt;
          &lt;log4j2.version&gt;2.2&lt;/log4j2.version&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts-taglib&lt;/artifactId&gt;
              &lt;version&gt;1.3.10&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-convention-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.24.1&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
              &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
              &lt;version&gt;1.5.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;jstl&lt;/groupId&gt;
              &lt;artifactId&gt;jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.mail&lt;/groupId&gt;
              &lt;artifactId&gt;javax.mail-api&lt;/artifactId&gt;
              &lt;version&gt;1.5.5&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;9.4.1207.jre7&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;5.0.7.Final&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-core&lt;/artifactId&gt;
              &lt;version&gt;${struts2.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.struts&lt;/groupId&gt;
              &lt;artifactId&gt;struts2-junit-plugin&lt;/artifactId&gt;
              &lt;version&gt;${struts2.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-api&lt;/artifactId&gt;
              &lt;version&gt;${log4j2.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.logging.log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-core&lt;/artifactId&gt;
              &lt;version&gt;${log4j2.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.8.2&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.3&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
                      &lt;source&gt;1.5&lt;/source&gt;
                      &lt;target&gt;1.5&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;
                  &lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;8.1.16.v20140903&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;stopKey&gt;CTRL+C&lt;/stopKey&gt;
                      &lt;stopPort&gt;8999&lt;/stopPort&gt;
                      &lt;systemProperties&gt;
                          &lt;systemProperty&gt;
                              &lt;name&gt;xwork.loggerFactory&lt;/name&gt;
                              &lt;value&gt;com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory&lt;/value&gt;
                          &lt;/systemProperty&gt;
                      &lt;/systemProperties&gt;
                      &lt;scanIntervalSeconds&gt;10&lt;/scanIntervalSeconds&gt;
                      &lt;webAppSourceDirectory&gt;${basedir}/src/main/webapp/&lt;/webAppSourceDirectory&gt;
                      &lt;webAppConfig&gt;
                          &lt;descriptor&gt;${basedir}/src/main/webapp/WEB-INF/web.xml&lt;/descriptor&gt;
                      &lt;/webAppConfig&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Finally my Hibernate's files are:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
    &lt;session-factory&gt;
      &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.PostgreSQLDialect&lt;/property&gt;
      &lt;property name="hibernate.connection.driver_class"&gt;org.postgresql.Driver&lt;/property&gt;
      &lt;property name="hibernate.connection.url"&gt;jdbc:postgresql://localhost:5432/testdb&lt;/property&gt;
      &lt;property name="hibernate.connection.username"&gt;test&lt;/property&gt;
      &lt;property name="hibernate.connection.password"&gt;test&lt;/property&gt;
      &lt;property name="hibernate.show_sql"&gt;true&lt;/property&gt;
      &lt;mapping class="" file="" jar="" package="" resource="org/altervista/cdpjavaexamples/dbiiproject/model/Utenti.hbm.xml"/&gt;
    &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>and:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping&gt;
    &lt;!-- Mappatura classe - tabella --&gt;
    &lt;class name="org.altervista.cdpjavaexamples.dbiiproject.model.Utenti" table="utenti"&gt;
      &lt;meta attribute="class-description"&gt;
            Descrizione della classe
        &lt;/meta&gt;
      &lt;!-- Chiave primaria --&gt;
      &lt;id column="email" name="email" type="text"/&gt;
      &lt;!-- Campi --&gt;
      &lt;property column="nome" name="nome" not-null="true" type="text"/&gt;
      &lt;property column="cognome" name="cognome" not-null="true" type="text"/&gt;
      &lt;property column="password" name="password" not-null="true" type="text"/&gt;
      &lt;property column="sesso" name="sesso" not-null="true" type="boolean"/&gt;
      &lt;property column="datanascita" name="dataNascita" not-null="true" type="date"/&gt;
    &lt;/class&gt;
  
    &lt;!-- Query --&gt;
    &lt;sql-query name="selectEmailPassword"&gt;
        &lt;return class="org.altervista.cdpjavaexamples.dbiiproject.model.Utenti"/&gt;
        &lt;![CDATA[
          SELECT email, password FROM utenti WHERE email = :email
        ]]&gt;
    &lt;/sql-query&gt;
    &lt;sql-query name="selectNomeCognomePassword"&gt;
        &lt;return class="org.altervista.cdpjavaexamples.dbiiproject.model.Utenti"/&gt;
        &lt;![CDATA[
          SELECT nome, cognome, password FROM utenti WHERE email = :email
        ]]&gt;
    &lt;/sql-query&gt;
    &lt;sql-query name="emailExists"&gt;
        &lt;return class="org.altervista.cdpjavaexamples.dbiiproject.model.Utenti"/&gt;
        &lt;![CDATA[
          SELECT * FROM utenti WHERE email = :email
        ]]&gt;
    &lt;/sql-query&gt;
    &lt;!-- Fine query --&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/XZMI9.png" alt="Project&#39;s structure"></p>
  
  <p>I have already searched in the forum, but the solutions I found weren't good to solve my problem.</p>