title: Hibernate: parameter does not exist as a named parameter on Wildfly
body: <p>I have the following code snippet working with hibernate 4.2.2:</p>
  
  <pre><code>Query query = session.getNamedQuery("Usuario.findById");
  query.setLong("id", identificadorUsuario);
  </code></pre>
  
  <p>This is the query:</p>
  
  <pre><code>SELECT user FROM scsg.model.Usuario user WHERE user.idUsuario=:id
  </code></pre>
  
  <p>And it Works locally. But when I deploy to the server it launches following exception: </p>
  
  <pre><code>java.lang.IllegalArgumentException: Parameter id does not exist as a named parameter in [SELECT user FROM scsg.model.Usuario user WHERE user.idUsuario=:id]
  </code></pre>
  
  <p>Server is a Wildfly server. All POJO clases have their getters and setters. Any help?</p>