Peter Thua created FINERACT-2227:
------------------------------------
Summary: Triggered SMS message fails due to
org.hibernate.PropertyValueException: not-null property references a null or
transient value : org.fineract.messagegateway.sms.domain.SMSMessage.internalId
Key: FINERACT-2227
URL: https://issues.apache.org/jira/browse/FINERACT-2227
Project: Apache Fineract
Issue Type: Bug
Components: Database, System
Reporter: Peter Thua
Attachments: error_log.txt
When the system attempts to send a triggered SMS message (e.g., on client
activation), the process fails due to a database integrity violation. The error
log indicates that the internalId field of SMSMessage is null, which violates a
non-null constraint.
*Steps to Reproduce:*
Make sure you have an SMS external service configured.
Create a triggered SMS campaign e.g. on client activation.
Perform an action that triggers an SMS message (e.g., activating a client).
Observe the SMS gateway application logs.
The error occurs when attempting to persist the SMS message in the database.
*Expected Behaviour:*
The SMS message should be successfully recorded and sent without causing a
system failure.
*Actual Behaviour:*
The process fails with a DataIntegrityViolationException, specifically due to a
missing or transient internalId value.
*Error Log (Excerpt):*
{code:java}
org.hibernate.PropertyValueException: not-null property references a null or
transient value : org.fineract.messagegateway.sms.domain.SMSMessage.internalId
at
org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:111)
at
org.hibernate.action.internal.AbstractEntityInsertAction.nullifyTransientReferencesIfNotAlready(AbstractEntityInsertAction.java:116)
at
org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:72){code}
*Possible Causes:*
internalId may not be properly assigned before persisting the entity.
The entity might be missing an ID generation strategy or is not managed
correctly in the persistence context.
*Suggested Fix:*
Ensure that internalId is correctly assigned before saving the SMSMessage
entity.
Check the entity mapping and ID generation strategy.
Validate that the SMS message entity is properly managed before attempting to
persist it
--
This message was sent by Atlassian Jira
(v8.20.10#820010)