Hi all
I'm using Ivy 6.3 and use ivy.repo api to persist data. When i persits data as this JSON:
"qualificationMessageResults": [
{
"code": "amount",
"severity": "ORANGE",
"message": {
"descriptor": {
"content": "/ch/axonivy/fintech/soba/Message/PreQualification/Amount/amountBetweenMinAmountAndMaxAmountForReplacement",
"type": "URI"
},
"paramDescriptors": [
{
"descriptor": {
"content": "500000",
"type": "PLAIN_TEXT",
"placeHolder": "{minAmount}"
},
"paramDescriptors": []
}
]
}
}
]
},
The api say:
[errorId=15BCE2ED377AD1E0, request=HTTP POST ch/axonivy/fintech/soba/showcase/DemoSobaPersistence/DemoSobaPersistenceProcess.mod/15A1694DAA1C0A9F(9907.9907.17.0), session=1, task=9907, application=102, requestId=4093, executionContext=1, pmv=Portal$soba_test$2, hd=ch.axonivy.fintech.soba.showcase.DemoSobaPersistence, processElement=15A168DC648B6158-f9]
Caused by: ch.ivyteam.ivy.persistence.PersistencyException: Could not create BusinessData.
at ch.ivyteam.ivy.business.data.store.internal.ElasticSystemDbPersistence.execute(ElasticSystemDbPersistence.java:115)
at ch.ivyteam.ivy.business.data.store.internal.ElasticSystemDbPersistence.execute(ElasticSystemDbPersistence.java:104)
at ch.ivyteam.ivy.business.data.store.internal.ElasticSystemDbPersistence.create(ElasticSystemDbPersistence.java:89)
at ch.ivyteam.ivy.business.data.store.internal.BusinessDataRepositoryImpl.persist(BusinessDataRepositoryImpl.java:112)
at ch.ivyteam.ivy.business.data.store.internal.BusinessDataRepositoryImpl.save(BusinessDataRepositoryImpl.java:96)
at ch.axonivy.fintech.standard.dossier.persistence.BaseDossierPersistence.persist(BaseDossierPersistence.java:35)
at ch.axonivy.fintech.soba.dossier.service.SobaDossierService.persist(SobaDossierService.java:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at ch.ivyteam.ivy.scripting.internal.types.IvyJavaMethod.invokeImpl(IvyJavaMethod.java:73)
... 208 more
[errorId=15BCE2ED377AD1E0, request=HTTP POST ch/axonivy/fintech/soba/showcase/DemoSobaPersistence/DemoSobaPersistenceProcess.mod/15A1694DAA1C0A9F(9907.9907.17.0), session=1, task=9907, application=102, requestId=4093, executionContext=1, pmv=Portal$soba_test$2, hd=ch.axonivy.fintech.soba.showcase.DemoSobaPersistence, processElement=15A168DC648B6158-f9]
Caused by: ch.ivyteam.ivy.business.data.store.search.internal.elasticsearch.ElasticsearchException: Elasticsearch update index of document failed because of: {"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse [onlineMortgageProgress.qualificationMessageResults.message]"}],"type":"mapper_parsing_exception","reason":"failed to parse [onlineMortgageProgress.qualificationMessageResults.message]","caused_by":{"type":"illegal_argument_exception","reason":"unknown property [descriptor]"}}
at ch.ivyteam.ivy.business.data.store.search.internal.elasticsearch.JestOperation.checkStatusAndThrow(JestOperation.java:61)
at ch.ivyteam.ivy.business.data.store.search.internal.elasticsearch.JestOperation.execute(JestOperation.java:39)
at ch.ivyteam.ivy.business.data.store.search.internal.elasticsearch.JestIndexSynchronizer.execute(JestIndexSynchronizer.java:165)
at ch.ivyteam.ivy.business.data.store.search.internal.elasticsearch.JestIndexSynchronizer.updateIndex(JestIndexSynchronizer.java:64)
at ch.ivyteam.ivy.business.data.store.search.internal.ElasticBusinessDataSearchIndex.update(ElasticBusinessDataSearchIndex.java:30)
at ch.ivyteam.ivy.business.data.store.internal.ElasticSystemDbPersistence.lambda$1(ElasticSystemDbPersistence.java:96)
at ch.ivyteam.ivy.persistence.base.AbstractPersistencyService.execute(AbstractPersistencyService.java:177)
at ch.ivyteam.ivy.persistence.base.AbstractPersistencyService.execute(AbstractPersistencyService.java:240)
at ch.ivyteam.ivy.persistence.base.ClassPersistencyService.execute(ClassPersistencyService.java:694)
at
My object QualificationMessageResult has list of Object A, and object A has two properties: a object descriptor and a list of Object A (looped Object) with name: paramDescriptors.
Can anyone suggest me something?
Thanks
asked
03.05.2017 at 09:41
trungdv
(suspended)
accept rate:
52%
i have found the root cause. it's because on new version we just changed the type of property
qualificationMessageResults.message
from String to an object type, so it lead to issue that when we deploy this version to server, the old business data (where message is still String type) can not be index anymore. And it throw exception unknow property descriptor.Problematic is that ElasticSearch already determined the type of this field as string. I heard elasticsearch has way to reindex, does ivy support it?
Currently there is no API in the axon.ivy core that would trigger an index-recreation or schema update on the ElasticSearch server. But you could basically flush the whole ElasticSearch index and trigger the axon.ivy engine to synchronize its data again with the ElasticSearch index. The API to do so is here:
ch.ivyteam.ivy.business.data.store.restricted.IBusinessDataManager.startIndexRecreation()
. There is also a built in mechanism on axon.ivy engine startup that synchronizes the indexes if the ElasticSeach index is not up to date.