Hide Forgot
Created attachment 829126 [details] Full stacktrace Description of problem: DefaultGuvnorApprover fills server.log with the following warning thrown when parsing a pom.xml located in kie-wb-common-defaultapprover-0.9.jar (see the attachment for complete stacktrace): 10:14:39,012 WARN [org.drools.compiler.kproject.xml.PomModel] (http-localhost/127.0.0.1:8080-1) Error generated by the maven pom parser, falling back to the internal one: java.lang.RuntimeException: org.apache.maven.project.ProjectBuildingException: 1 problem was encountered while building the effective model for org.kie.workbench.services:kie-wb-common-defaultapprover:0.9 [FATAL] Non-resolvable parent POM: Could not find artifact org.kie.workbench.services:kie-wb-common-services:pom:6.0.0-SNAPSHOT @ line 5, column 11 for project org.kie.workbench.services:kie-wb-common-defaultapprover:0.9 at org.kie.scanner.embedder.MavenProjectLoader.parseMavenPom(MavenProjectLoader.java:38) [kie-ci-6.0.0-redhat-6.jar:6.0.0-redhat-6] at org.kie.scanner.MavenPomModelGenerator.parse(MavenPomModelGenerator.java:18) [kie-ci-6.0.0-redhat-6.jar:6.0.0-redhat-6] The exception reports that parent pom (org.kie.workbench.services:kie-wb-common-services:pom:6.0.0-SNAPSHOT) cannot be resolved, which makes sense, because ER5 should not contain any SNAPSHOT dependencies. It is a warning, so it does not impact functionality, but it is quite confusing to the user. Moreover, when looking at the code, I can see several potential problems: - the method requestApproval(JobRequest) loads a KIE Jar (kie-wb-common-defaultapprover-0.9.jar), inserts the JobRequest into the KieSession and fires rules. However, the method ignores any results of rule firing and always returns true. - the kie-wb-common-defaultapprover-0.9.jar is practically empty (it contains kmodule.xml, which does not define any bases nor sessions, and pom.xml which declares parent as the above mentioned SNAPSHOT dependency) - the kie-wb-common-defaultapprover-0.9.jar is physically located in another jar (!) - drools-wb-rest-6.0.0-redhat-6.jar - the class DefaultGuvnorApprover contains other methods, some of them ignore their input arguments, which is quite misleading. It also does a lot of System.out.println instead of logging. If DefaultGuvnorApprover is meant to approve every JobRequest, I would suggest replacing the contents of this class with method requestApproval(JobRequest) which would just always return true (and perhaps log it), and remove the kie-wb-common-defaultapprover-0.9.jar. This would remove the confusing warning in the log. Version-Release number of selected component (if applicable): Drools 6.0.0-SNAPSHOT BRMS 6.0.0 ER5 How reproducible: Send a REST request to kie-wb, for instance to ProjectResource.createOrCloneRepository. Actual results: The request is executed, but the log contains a misleading warning message. Expected results: The request is processed without warning in the server.log.
We can look into reducing the amount of logging being done. Any further change will be deferred.
The following changes have been made:- 1) Module renamed "drools-wb-rest-defaultapprover" (to convey it's correct location) 2) All System.out statements changed to logging statements (INFO level) 3) drools-wb-rest-defaultapprover actually *does* something now. It contains a rule that handles approval of certain REST requests (all be it that it will always approve every request). 4) drools-wb-rest-defaultapprover is a POM dependency of drools-wb-rest (rather than including the JAR manually as a resource). This module is a place-holder for adding workflow to the workbench. I'd rather keep it (approving everything) than remove it.
5) drools-wb-rest-defaultapprover does not have a dependency on org.kie.workbench.services anymore.
Verified on BRMS 6.0.0 ER7.