Skip to content

ClassCastException in JdbcMessageStore.getMessageGroup() with Oracle DB #3578

@piercemar

Description

@piercemar

In what version(s) of Spring Integration are you seeing this issue?

5.5.0

Describe the bug

When running the latest 5.5.0 with an Oracle DB, calls to JdbcMessageStore.getMessageGroup(String) throw a ClassCastException on line 509.
groupInfo.get("COMPLETE") returns a java.math.BigDecimal under Oracle, which cannot be cast to Long.

java.lang.ClassCastException: class java.math.BigDecimal cannot be cast to class java.lang.Long (java.math.BigDecimal and java.lang.Long are in module java.base of loader 'bootstrap')
	at org.springframework.integration.jdbc.store.JdbcMessageStore.getMessageGroup(JdbcMessageStore.java:409)
	at org.springframework.integration.store.AbstractMessageGroupStore.addMessageToGroup(AbstractMessageGroupStore.java:190)
	at org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler.store(AbstractCorrelatingMessageHandler.java:856)
	at org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler.processMessageForGroup(AbstractCorrelatingMessageHandler.java:566)
	at org.springframework.integration.aggregator.AbstractCorrelatingMessageHandler.handleMessageInternal(AbstractCorrelatingMessageHandler.java:546)
	at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:56)
	... 113 common frames omitted

Expected behavior

Correct handling of the BigDecimal value.
5.4.7 leverages the driver conversion feature by calling rs.getInt() on the ResultSet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions