I upgraded jboss 7 to wildfly 10 but there is a strange error which I couldn't understand why
The exception:
Caused by: java.sql.SQLException: Invalid column index at oracle.jdbc.driver.OraclePreparedStatement.setLongInternal(OraclePreparedStatement.java:4901) at oracle.jdbc.driver.OraclePreparedStatement.setLong(OraclePreparedStatement.java:4888) at oracle.jdbc.driver.OraclePreparedStatementWrapper.setLong(OraclePreparedStatementWrapper.java:206) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.setLong(NewProxyPreparedStatement.java:703) at org.hibernate.type.descriptor.sql.BigIntTypeDescriptor$1.doBind(BigIntTypeDescriptor.java:46) at org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:73) at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:257) at org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:252) at org.hibernate.persister.entity.AbstractEntityPersister.dehydrateId(AbstractEntityPersister.java:2636) at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2604) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2883)
It looks like hibernate is trying to convert datatype as wildfly is using newer version of hibernate
Generated sql which works fine when I run directly on oracle:
Error in processing CreateProvisiningBaseServiceImpl: org.springframework.orm.hibernate3.HibernateJdbcException: JDBC exception on Hibernate data access: SQLException for SQL [insert into NE_NOTIFICATION_INPUT (CREATION_DATE, FILE_NAME, INPUT_TYPE, INPUT_ID) values (?, ?, 'NotificationInput', ?)]; SQL state [99999]; error code [17003]; could not insert: [com.ericsson.enk.ne.db.model.NotificationInput]; nested exception is org.hibernate.exception.GenericJDBCException: could not insert: [com.ericsson.enk.ne.db.model.NotificationInput]
There is also something weird. When I remove the table, the error doesnt change. But when I remove the sequence, the error changes and says it cannot find sequence.
Java code for sequence is below:
@Id @Column(name = "INPUT_ID", nullable = false) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "inputSequence") @SequenceGenerator(name = "inputSequence", sequenceName = "SEQ_INPUT_ID", allocationSize = 1) public long getInputId() { return inputId; }