Bug 1265709 - ClassNotFoundException: org.guvnor.rest.client.CreateOrCloneRepositoryRequest
ClassNotFoundException: org.guvnor.rest.client.CreateOrCloneRepositoryRequest
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
urgent Severity urgent
: ER5
: 6.2.0
Assigned To: manstis
Marián Macik
: TestBlocker
Depends On:
  Show dependency treegraph
Reported: 2015-09-23 09:59 EDT by Jiri Locker
Modified: 2015-12-21 11:15 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Full server.log (125.90 KB, text/plain)
2015-09-23 09:59 EDT, Jiri Locker
no flags Details

  None (edit)
Description Jiri Locker 2015-09-23 09:59:47 EDT
Created attachment 1076244 [details]
Full server.log

Description of problem:
Happens during REST request to clone a repository when both business-central.war and kie-server.war are deployed. Sometimes on BRMS, sometimes on BPM Suite.

Important parts of server.log:

JNDI bindings for session bean named AvailableJobsExecutor in deployment unit deployment "kie-server.war" are as follows:
JNDI bindings for session bean named AvailableJobsExecutor in deployment unit deployment "business-central.war" are as follows:
23:02:24,836 INFO  [AssetMgmt] (http-/ Auto approve for request: org.guvnor.rest.client.CreateOrCloneRepositoryRequest@7b483c8
23:02:25,901 WARN  [org.jbpm.executor.impl.AbstractAvailableJobsExecutor] (EJB default - 3) Error during command org.guvnor.rest.backend.cmd.CreateOrCloneRepositoryCmd error message org.guvnor.rest.client.CreateOrCloneRepositoryRequest from [Module "deployment.kie-server.war:main" from Service Module Loader]: java.lang.ClassNotFoundException: org.guvnor.rest.client.CreateOrCloneRepositoryRequest from [Module "deployment.kie-server.war:main" from Service Module Loader]

My impression is that AvailableJobsExecutor bean is registered twice (from business-central and kie-server) under the same JNDI binding and so the REST business-central request may be (inadvertently) handled by kie-server, which does not have guvnor-rest-client lib.

Version-Release number of selected component (if applicable):

How reproducible:
Some installations are affected, some are not. But once it happens, it happens every time.

Steps to Reproduce:
1. Install BRMS on EAP 6.4.3.GA.
2. Start the server in standalone mode.
3. Run:
> $ curl -s -u '<user>:<password>' -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST -d '{"name":"guvnorng-playground","description":"","userName":"","password":"","requestType":"clone","gitURL":"https://github.com/guvnorngtestuser1/guvnorng-playground.git","organizationalUnitName":"example"}' 'localhost:8080/business-central/rest/repositories/'

Actual results:
The REST job fails due to ClassNotFoundException.

Expected results:
The REST job should complete successfully even when kie-server.war is deployed.

Additional info:
Workaround: do not deploy kie-server together with business-central.
Comment 1 manstis 2015-09-30 08:09:13 EDT
I spoke with Kris and Maciejs about this. 

As you've noted we have two AvailableJobsExecutor's running: one in kie-server and the other in business-central. Both instances share a common queue of pending jobs. When the instance in kie-server attempts to run the jobs created in business-central in response to certain REST operations the ClassLoader issue in the log is encountered.

Maciejs advised that the solution is to ensure kie-server and business-central use distinct queues for their respective AvailableJobsExecutor. This can be achieved by defining an additional DataSource within the container and setting System Property "org.kie.server.persistence.ds" to the new DataSource's JNDI name.

Maciejs also advised he's been speaking to "ksuta" about this issue already. You may want to connect with them too.
Comment 3 Karel Suta 2015-10-26 11:32:43 EDT
Solution from comment 1 checked and seems to work, didn't get CNFE any more, repository seems to be cloned successfully every time.
Comment 4 Marián Macik 2015-10-27 08:13:46 EDT
Moving back to assigned because it needs to be documented properly as said in comment 2.
Comment 9 Marián Macik 2015-11-03 07:53:08 EST
As Radovan noted in comment 2, this note should be present in the docs: the new DataSource for Kie Server should point to a different DB schema than the DataSource used by Business Central. It is not sufficient to have different just data sources. DB schemas must be different as well. Can you add it to docs, please? Just to make it clear. Thanks.
Comment 10 Lukáš Petrovický 2015-11-03 10:26:32 EST
This is a documentation issue now. The problem itself has been fixed, VERIFIED with ER5.

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