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

Solution Verified - Updated -

Issue

  • 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(CachedRowSet.java:1383)
    at sun.jdbc.rowset.CachedRowSet.getString(CachedRowSet.java:2167)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)
    at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.event(JBossWebContext.java:91)
    at org.jboss.modcluster.container.jbossweb.JBossWebContext$RequestListenerValve.invoke(JBossWebContext.java:72)
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336)
    at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:488)
    at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:420)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920)
    at java.lang.Thread.run(Thread.java:724)
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?

Environment

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

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content