Bug 1034664 - DefaultGuvnorApprover fills server.log with exceptions
Summary: DefaultGuvnorApprover fills server.log with exceptions
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ER6
: 6.0.0
Assignee: manstis
QA Contact: Marek Winkler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-26 09:58 UTC by Marek Winkler
Modified: 2014-08-06 20:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:16:00 UTC
Type: Bug


Attachments (Terms of Use)
Full stacktrace (15.25 KB, text/plain)
2013-11-26 09:58 UTC, Marek Winkler
no flags Details

Description Marek Winkler 2013-11-26 09:58:34 UTC
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.

Comment 1 Rajesh Rajasekaran 2013-11-26 15:42:51 UTC
We can look into reducing the amount of logging being done. Any further change will be deferred.

Comment 3 manstis 2013-11-27 12:43:23 UTC
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.

Comment 4 manstis 2013-11-27 12:44:22 UTC
5) drools-wb-rest-defaultapprover does not have a dependency on org.kie.workbench.services anymore.

Comment 6 Marek Winkler 2014-01-10 08:55:44 UTC
Verified on BRMS 6.0.0 ER7.


Note You need to log in before you can comment on or make changes to this bug.