NullPointerException when executing PreparedStatement

Solution Verified - Updated -

Issue

An application deployed onto JBoss EAP server is throwing exceptions while inserting data to the certain table in Oracle DB.

Connectivity was checked between JBoss EAP & Oracle DB server and there are no issues. Application server is able to successfully connect to database via configured JNDI.

The stacktrace looks like this:

====================================================
2017-11-13 08:32:56,403 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] (default task-32) Creating new transaction with name [another.package.ProjectModuleService.addProjectModule]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'admTxManager'
2017-11-13 08:32:56,404 DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (default task-32) jdbc/jndi_name: getConnection(null, WrappedConnectionRequestInfo@7bd0e41f[userName=someUsername]) [0/20]
2017-11-13 08:32:56,404 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] (default task-32) Acquired Connection [org.jboss.jca.adapters.jdbc.jdk8.WrappedConnectionJDK8@2ccfa3d4] for JDBC transaction
2017-11-13 08:32:56,404 DEBUG [org.springframework.jdbc.datasource.DataSourceTransactionManager] (default task-32) Switching JDBC Connection [org.jboss.jca.adapters.jdbc.jdk8.WrappedConnectionJDK8@2ccfa3d4] to manual commit
2017-11-13 08:32:56,415 DEBUG [org.springframework.jdbc.core.JdbcTemplate] (default task-32) Executing SQL update and returning generated keys
2017-11-13 08:32:56,416 DEBUG [org.springframework.jdbc.core.JdbcTemplate] (default task-32) Executing prepared SQL statement [INSERT INTO TABLE_NAME (PROJ_MODTMPL_N, PROJ_MODREF_T, MOD_C, 
  PROJ_CODEFMT_C, PROJ_MODALLOC_TP_C, SHOW_OVERALL_GRD_F, DEFUNCT_F, CREATOR_USER, CREATED_DTM, REC_UPDUSER_I, REC_UPD_DTM) 
VALUES (USPA_PROJTMPL_MODULE_SEQ.NEXTVAL, ?, ?, 
  ?, ?, ?, 'N', ?, SYSDATE, ?, SYSDATE) ]
2017-11-13 08:32:56,455 WARN  [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (default task-32) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@775a892e[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@6dfd0f23 connection handles=1 lastReturned=1510533171011 lastValidated=1510533098506 lastCheckedOut=1510533176404 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@3c7d2ba mcp=SemaphoreConcurrentLinkedQueueManagedConnectionPool@7161714e[pool=jdbc/someJNDI] xaResource=LocalXAResourceImpl@6f3bb783[connectionListener=775a892e connectionManager=7a77e1bb warned=false currentXid=null productName=Oracle productVersion=Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options jndiName=java:/jdbc/someJNDI] txSync=null]: java.lang.NullPointerException
                at oracle.jdbc.driver.AutoKeyInfo.initMetaDataColumnIndexes(AutoKeyInfo.java:423)
                at oracle.jdbc.driver.AutoKeyInfo.initMetaData(AutoKeyInfo.java:396)
                at oracle.jdbc.driver.OracleReturnResultSet.getMetaData(OracleReturnResultSet.java:77)
                at org.jboss.jca.adapters.jdbc.WrappedResultSet.getMetaData(WrappedResultSet.java:1613)
                at org.springframework.jdbc.core.ColumnMapRowMapper.mapRow(ColumnMapRowMapper.java:52)
                at org.springframework.jdbc.core.ColumnMapRowMapper.mapRow(ColumnMapRowMapper.java:48)
                at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93)
                at org.springframework.jdbc.core.JdbcTemplate$3.doInPreparedStatement(JdbcTemplate.java:911)
                at org.springframework.jdbc.core.JdbcTemplate$3.doInPreparedStatement(JdbcTemplate.java:900)
                at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
                at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:900)
                at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:318)
                at some.package.ProjectModuleDAO.addProjectModule(ProjectModuleDAO.java:74)

Environment

  • Red Hat JBoss EAP
    • 6.x
    • 7.x
  • Oracle database
  • Oracle JDBC driver 12.1.0.1
  • Spring

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
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.