java.sql.SQLException: Invalid column name in JBoss EAP

Solution Verified - Updated -


  • Getting below error in DEV Server when using db2cc4 driver.In my local JBOSS server I am not getting any exception. Could you let me know if you have any idea on this?
  • Both dev and QA points to same database and the column name is valid.

  • Exception retrieving data from result set.

java.sql.SQLException: Invalid column name
    at sun.jdbc.rowset.CachedRowSet.getColIdxByName(
    at sun.jdbc.rowset.CachedRowSet.getString(
    at org.apache.struts.action.RequestProcessor.processActionPerform(
    at org.apache.struts.action.RequestProcessor.process(
    at org.apache.struts.action.ActionServlet.process(
    at org.apache.struts.action.ActionServlet.doPost(
    at javax.servlet.http.HttpServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(
    at org.apache.catalina.core.StandardWrapperValve.invoke(
    at org.apache.catalina.core.StandardContextValve.invoke(
    at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(
    at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(
    at org.apache.catalina.core.StandardHostValve.invoke(
    at org.apache.catalina.valves.ErrorReportValve.invoke(
    at org.apache.catalina.core.StandardEngineValve.invoke(
    at org.apache.catalina.connector.CoyoteAdapter.service(
    at org.apache.coyote.ajp.AjpProcessor.process(
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(
10/17/13 03:49:51 ERROR [IntlProdnRptNewStructAction.executeAction:406] BaseApplicationExceptionException creating production report from an existing product structure. See error log.
  • Further to update on this issue in my local server I have db2cc.jar and in my Dev server I have db2cc4.jar.Query is executing fine if I have db2cc.jar but throwing the above error if I have db2cc4.jar.
  • We have issue in hibernate JPA implementation Entity/NativeQuery mapping.
  • We need to manage some cases when an entity class has many more properties that the associated SQL statement's select list but in such case we get below exception:
java.sql.SQLException: Invalid column name
  • We noticed that Hibernate JPA 2.0 implementation, differently from EclipseLink, mandate that EVERY property in the entity class, that has been annotated with @Column, MUST be populated by a native query, thus the SQL statement's select list MUST include EVERY column specified in the entity class. Is that true? Can this behaviour be modified perhaps using a property in the persistence.xml file?


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
  • DB2 Database

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In