Closed tlappe closed 1 year ago
@tlappe did you try adding the "openejb.additional.include"
https://github.com/otaviojava/tomee-jnosql-sample/blob/main/pom.xml#L44L46
I've updated this repository, and I got this exception:
org.eclipse.jnosql.mapping.document.DefaultDocumentTemplate has no explicit no-arg constructor! A public or protected constructor without args is required!
So, we need to return all beans to have a no-arg constructor.
@otaviojava, I'm just curious... is this requirement a default one of the CDI? I'm asking about it because we didn't face this problem when we worked on the sample codes https://github.com/JNOSQL/demos-se/tree/main/mongodb and https://github.com/JNOSQL/demo-ee/tree/main/liberty-mongodb...
I've just figured out that another DocumentTemplate implementation (e.g: https://github.com/eclipse/jnosql-databases/blob/42881b7d97b6e3be73c4d53ebf788af102c259e2/jnosql-couchbase/src/main/java/org/eclipse/jnosql/databases/couchbase/mapping/DefaultCouchbaseTemplate.java#L70C1-L71C6) has a no-arg constructor... then we should add to all CDI beans a no-arg constructor in order to avoid this issue...
@otaviojava, I'm gonna work on it!
@dearrudam, it works on CDI Weld by Red Hat.
@dearrudam, we need to check any inject bean that does not provide a no-arg constructor and return it to the original.
@dearrudam I took this one here: https://github.com/eclipse/jnosql-databases/pull/231
@dearrudam @tlappe I've updated the sample project with the newest version of both TomEE and Eclipsel JNoSQL:
https://github.com/otaviojava/tomee-jnosql-sample/
Please, let me know what you think.
Ps:: Max, what do you think about moving this sample to the demo-ee one?
@otaviojava I liked this idea! I've used this project to test locally the changes of the PR https://github.com/eclipse/jnosql/pull/402... I'll move it to there at demo-ee samples!!
@tlappe, thank you, it is fixed, and we will release version 1.0.1 ASAP. It will probably be at the end of the month.
@otaviojava will you release a SNAPSHOT version?
@dearrudam it is already as 1.0.1-SNAPSHOT!
Which JNoSQL project the issue refers to?
JNoSQL (Core)
Bug description
I'm trying to upgrade my application from 0.0.6 to 1.0.0 and to use @Inject to get a DocumentTemplate instead of using a Repository. I don't know if I'm doing something wrong or there is a problem in jnosql's code. It always ends in an exception starting my app in tomee 9.1.0. So I create a clean new project in Eclipse to understand what's going on.
Deploying the app to Tomee 9.1.0 results in:
JNoSQL Version
1.0.0
Steps To Reproduce
Expected Results
No exception and DocumentTemplate injected.
Code example, screenshot, or link to a repository
Starting a new project with
src/main/webapp/META-INF/microprofile-config.properties