quarkusio / quarkus-quickstarts

Quarkus quickstart code
https://quarkus.io
Apache License 2.0
1.97k stars 1.47k forks source link

kogito-quickstart not working? #799

Open edtbl76 opened 3 years ago

edtbl76 commented 3 years ago

This looks like a problem w/ the module (quarkus-kogito) itself.

When I POST a new Person, I get the results back in the response, however if I run a GET /persons immediately after, it's empty.

I bumped up the quarkus logs to ALL, and I found something interesting when I do my POST:

As far as I can tell, the last thing it's trying to do is delete the element I just posted.

2021-03-02 16:47:41,251 TRACE [org.dro.cor.phr.AddRemoveRule] (executor-thread-199) Adding Rule Is adult 2021-03-02 16:47:41,272 TRACE [org.dro.cor.ret.EntryPointNode] (executor-thread-199) Insert [fact 0:1:308758892:308758892:1:DEFAULT:NON_TRAIT:org.acme.kogito.model.Person:Person [name=John Doe, age=41, adult=false]] 2021-03-02 16:47:41,274 DEBUG [org.dro.cor.com.DefaultAgenda] (executor-thread-199) State was INACTIVE is now FIRING_ALL_RULES 2021-03-02 16:47:41,274 TRACE [org.dro.cor.com.DefaultAgenda] (executor-thread-199) Starting Fire All Rules 2021-03-02 16:47:41,277 TRACE [org.dro.cor.ret.PathMemory] (executor-thread-199) LinkRule name=Is adult 2021-03-02 16:47:41,278 TRACE [org.dro.cor.ret.PathMemory] (executor-thread-199) Queue RuleAgendaItem [Activation rule=Is adult, act#=0, salience=0, tuple=null] 2021-03-02 16:47:41,278 TRACE [org.dro.cor.uti.BinaryHeapQueue] (executor-thread-199) Queue Added 1 [Activation rule=Is adult, act#=0, salience=0, tuple=null] 2021-03-02 16:47:41,284 TRACE [org.dro.cor.phr.RuleExecutor] (executor-thread-199) Fire event default for rule "Is adult" [[ Is adult active=false ] [ [fact 0:1:308758892:308758892:1:DEFAULT:NON_TRAIT:org.acme.kogito.model.Person:Person [name=John Doe, age=41, adult=false]] ] ] 2021-03-02 16:47:41,285 TRACE [org.dro.cor.ret.EntryPointNode] (executor-thread-199) Update [fact 0:1:308758892:308758892:2:DEFAULT:NON_TRAIT:org.acme.kogito.model.Person:Person [name=John Doe, age=41, adult=true]] 2021-03-02 16:47:41,286 TRACE [org.dro.cor.ret.PathMemory] (executor-thread-199) LinkRule name=Is adult 2021-03-02 16:47:41,287 TRACE [org.dro.cor.phr.RuleExecutor] (executor-thread-199) Removing RuleAgendaItem [Activation rule=Is adult, act#=0, salience=0, tuple=null] 2021-03-02 16:47:41,287 TRACE [org.dro.cor.uti.BinaryHeapQueue] (executor-thread-199) Queue Removed 1 [Activation rule=Is adult, act#=0, salience=0, tuple=null] 2021-03-02 16:47:41,287 DEBUG [org.dro.cor.com.DefaultAgenda] (executor-thread-199) State was FIRING_ALL_RULES is now HALTING 2021-03-02 16:47:41,287 DEBUG [org.dro.cor.com.DefaultAgenda] (executor-thread-199) State was HALTING is now INACTIVE 2021-03-02 16:47:41,287 TRACE [org.dro.cor.com.DefaultAgenda] (executor-thread-199) Ending Fire All Rules 2021-03-02 16:47:41,288 TRACE [org.dro.cor.ret.EntryPointNode] (executor-thread-199) Delete [fact 0:1:308758892:308758892:2:DEFAULT:NON_TRAIT:org.acme.kogito.model.Person:Person [name=John Doe, age=41, adult=true]]

Regardless, if I try to exec a GET immediately after, I get an empty set.... [ ] LOGS: 2021-03-02 16:48:56,403 FINEST [io.ver.ext.web.imp.RouterImpl] (vert.x-eventloop-thread-28) Router: 86309173 accepting request GET http://localhost:8080/persons 2021-03-02 16:48:56,403 FINEST [io.ver.ext.web.imp.RoutingContextImplBase] (vert.x-eventloop-thread-28) Route matches: RouteState{path='null', order=-2147483648, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.quarkus.vertx.http.runtime.VertxHttpRecorder$5@4cfe5b46], failureHandlers=null, added=true, pattern=null, groups=null, useNormalisedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=false} 2021-03-02 16:48:56,403 FINEST [io.ver.ext.web.imp.RoutingContextImplBase] (vert.x-eventloop-thread-28) Calling the handler 2021-03-02 16:48:56,407 FINEST [io.ver.ext.web.imp.RoutingContextImplBase] (vert.x-eventloop-thread-28) Route matches: RouteState{path='null', order=-2, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.quarkus.vertx.http.runtime.VertxHttpRecorder$4@58589238], failureHandlers=null, added=true, pattern=null, groups=null, useNormalisedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=false, exclusive=false, exactPath=false} 2021-03-02 16:48:56,407 FINEST [io.ver.ext.web.imp.RoutingContextImplBase] (vert.x-eventloop-thread-28) Calling the handler 2021-03-02 16:48:56,407 FINEST [io.ver.ext.web.imp.RoutingContextImplBase] (vert.x-eventloop-thread-28) Route matches: RouteState{path='/', order=10001, enabled=true, methods=null, consumes=null, emptyBodyPermittedWithConsumes=false, produces=null, contextHandlers=[io.quarkus.resteasy.runtime.standalone.VertxRequestHandler@6b8e13a9], failureHandlers=null, added=true, pattern=null, groups=null, useNormalisedPath=true, namedGroupsInRegex=null, virtualHostPattern=null, pathEndsWithSlash=true, exclusive=false, exactPath=false} 2021-03-02 16:48:56,407 FINEST [io.ver.ext.web.imp.RoutingContextImplBase] (vert.x-eventloop-thread-28) Calling the handler 2021-03-02 16:48:56,407 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) RESTEASY002315: PathInfo: /persons 2021-03-02 16:48:56,410 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) MessageBodyWriter: org.jboss.resteasy.core.providerfactory.SortedKey 2021-03-02 16:48:56,411 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) MessageBodyWriter: org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider 2021-03-02 16:48:56,411 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) MessageBodyWriter: org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider 2021-03-02 16:48:56,411 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) MessageBodyWriter: org.jboss.resteasy.core.providerfactory.SortedKey 2021-03-02 16:48:56,411 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) Interceptor Context: org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext, Method : proceed 2021-03-02 16:48:56,412 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) MessageBodyWriter: org.jboss.resteasy.core.providerfactory.SortedKey 2021-03-02 16:48:56,412 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) MessageBodyWriter: org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider 2021-03-02 16:48:56,412 DEBUG [org.jbo.res.res.i18n] (executor-thread-199) Provider : org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider, Method : writeTo

I hopped over to the kogito examples and i'm not having a problem. I'll take a closer look. My guess is version.

edtbl76 commented 3 years ago

It was the version. PR coming shortly.

Pom file is pointing at a stale BOM (kogito-bom).

fix is here: newer bom points to newer version (1.2.0.Final), changed in props too.

        <artifactId>kogito-quarkus-bom</artifactId>
        <version>${kogito-quarkus.version}</version>
        <type>pom</type>
        <scope>import</scope>