-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native vs jvm command line mode with panache mongodb #13301
Comments
/cc @FroMage, @evanchooly, @galderz, @loicmathieu, @zakkak |
Can you update the ticket to include the REST endpoints you are using? |
Sorry but I don"t understand your question. This issue is related to command mode and I don!t have Rest endpoints on the project. |
I see. I asked because you mentioned the same code works with REST endpoints. Try this: Annotate your model / entity object with |
I'll try it later in the week. In the meantime, I installed graal vm instead of mandrel and the results are different. My entity (POJO) extends a base classe with some common field throughout my entities and only the POJO fields are written. The base classes fields are not persited, except for the id field which is one of the fields present in the base classe. |
We register for reflection all entities (wether they extends PanacheEntity or are the parameter type of PanacheRepository). If it's working for rest endpoint but not command line application, we may have miss some corner case, we would really need a reproducer. |
@seseso I mean a reproducer project, on github or attached as a zip file, so I can have a look easily. |
@loicmathieu, sorry, I forgot the link. Here it is: https://github.com/seseso/mongodb-panache-quickstart.git |
@seseso sorry for the late reply. I chased down the issue to reflection issue on native. I'll work on a fix but meanwhile, as a workaround, you can add the |
Describe the bug
I'm building a migration data application between mysql and mongodb. My command line app works fine in jvm mode but in native mode, some entities are empty except for the _id field.
Expected behavior
Same behavior between native and jvm mode
Actual behavior
Entity written in jvm mode:
{
"_id": {
"$oid": "5fb1584f20e51620e60f6b7e"
},
"additionalProperties": {},
"comarca": "comarca",
"competencia": "competencia",
"createdAt": {
"$date": "2020-11-15T16:33:19.468Z"
},
"instancia": "instancia",
"juizo": "juizo"
}
Entity written in native mode:
{
"_id": {
"$oid": "5fb159dc350bbe685b6fa7c2"
}
}
With the exact same code / build, meaning, running binary vs java -jar
On another entity, only some fields are missing:
Entity written in jvm mode:
{
"_id": {
"$oid": "5fb1584f20e51620e60f6b7f"
},
"additionalProperties": {},
"concelho": "Lisboa",
"cp": "1600",
"cpDesc": "Lisboa",
"createdAt": {
"$date": "2020-11-15T16:33:19.480Z"
},
"distrito": "Lisboa",
"localidade": "Lisboa"
}
Entity written in native mode:
{
"_id": {
"$oid": "5fb159dc350bbe685b6fa7c3"
},
"concelho": "Lisboa",
"cp": "1600",
"cpDesc": "Lisboa",
"distrito": "Lisboa",
"localidade": "Lisboa"
}
Additionally, using the same code in a REST endpoint works just fine on jvm and native mode.
To Reproduce
I could try to create a reproducer but it would take me some time cause of several dependencies (not needed for this example).
Environment (please complete the following information):
uname -a
orver
: Linux hp-spectre-x360 5.8.0-28-generic Arc - make it possible to get interceptor bindings from #30-Ubuntu SMP Thu Nov 5 13:24:33 UTC 2020 x86_64 x86_64 x86_64 GNU/Linuxjava -version
: openjdk version "11.0.9.1" 2020-11-04mvnw --version
orgradlew --version
): Apache Maven 3.6.3The text was updated successfully, but these errors were encountered: