Bug 1306309

Summary: REST endpoints do not work on WebLogic 12c R2
Product: [Retired] JBoss BPMS Platform 6 Reporter: Tomas Livora <tlivora>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED WONTFIX QA Contact: Tomas Livora <tlivora>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.3.0CC: ksuta, kverlaen, lpetrovi, mczernek, mswiders, rrajasek, rsynek, smcgowan, tlivora, zkrejcov
Target Milestone: ---Keywords: TestBlocker
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-21 11:49:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
WebLogic Server log
none
WebLogic 12.1 REST response
none
WebLogic 12.1 server log none

Description Tomas Livora 2016-02-10 14:24:54 UTC
Created attachment 1122815 [details]
WebLogic Server log

Description of problem:
It is not possible to access any REST endpoint when you deploy the application on WebLogic 12.2.

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

Steps to Reproduce:
1. Deploy business-central.war on WebLogic 12c R2
2. Try to access any REST endpoint

Actual results:
Not Found

Expected results:
Correct results according to the URL used.

Additional info:
This issue is not only reproducible on BPM Suite 6.3 but can also be found when using 6.2.0 GA. We noticed it when WebLogic was updated from 12.1 to 12.2. It is probably caused by Jersey version update:

https://docs.oracle.com/middleware/1221/wls/NOTES/whatsnew.htm

Comment 1 Maciej Swiderski 2016-02-24 14:44:32 UTC
just by quickly going through log attached this seems to be the root cause:

"HINT: A resource model has ambiguous (sub-)resource method for HTTP method POST and output mime-types as defined by @Produces annotation at Java methods public javax.ws.rs.core.Response org.kie.remote.services.rest.DeploymentResourceImpl.deploy() and public javax.ws.rs.core.Response org.kie.remote.services.rest.DeploymentResourceImpl.deploy(org.kie.services.client.serialization.jaxb.impl.deploy.JaxbDeploymentDescriptor) at matching path pattern /deploy."

although haven't tried it myself as I don't have latest WLS locally yet

Comment 2 Marco Rietveld 2016-03-02 11:53:08 UTC
https://java.net/jira/browse/JERSEY-1116 seems to imply that this *might* be a jersey(/weblogic) issue..

Comment 3 Marco Rietveld 2016-03-02 12:32:01 UTC
Tomas, could you verify that this does *NOT* happen on weblogic 12.1?

Comment 4 Tomas Livora 2016-03-02 14:27:14 UTC
Created attachment 1132356 [details]
WebLogic 12.1 REST response

Marco, I have just tested BPM Suite 6.3.0 DR2 on WebLogic 12.1 and there seems to be an issue caused by Jersey. See the attached exception stack.

Comment 5 Marco Rietveld 2016-03-02 14:31:44 UTC
It looks like the latest issue (12.1 REST response) can be fixed by adding Jersey 1.8 to the war. 

https://blogs.oracle.com/brunoborges/entry/issue_dev_ing_restful_json

Comment 6 Tomas Livora 2016-03-02 14:38:28 UTC
Created attachment 1132357 [details]
WebLogic 12.1 server log

Here you can see incomplete server log.

Comment 7 Marco Rietveld 2016-03-07 14:04:04 UTC
I've submitted a PR for this and BZ-1314445:

https://github.com/droolsjbpm/droolsjbpm-integration/pull/347

However, this PR means that there is a very slight loss of functionality: 
When doing the following REST call, users may now need to set additional parameters depending on the application server used: 

../rest/deployment/{deploymentId}/deploy 

There was a change added in september 2015 that allowed users to use this operation without having to add a header specifying that the (POST) content was empty. 

The fix for this issue is to remove that change. 

*However*, there seem to be additional problems besides this that prevent kie-wb from working well on weblogic 12.2.

Comment 8 Lukáš Petrovický 2016-03-07 14:16:29 UTC
(In reply to Marco Rietveld from comment #7)
> *However*, there seem to be additional problems besides this that prevent
> kie-wb from working well on weblogic 12.2.

Could you please elaborate? Is this something we can still do something about?

Comment 11 Tomas Livora 2016-03-17 13:19:46 UTC
The bug is still present in BPM Suite 6.3.0 ER1. However, I think I have found the root cause. You can see this in the very first server log attached to this BZ:

WARNING: The following warnings have been detected: WARNING: Parameter projectService of type org.guvnor.common.services.project.service.ProjectService<? extends org.guvnor.common.services.project.model.Project> from private org.guvnor.common.services.project.service.ProjectService<? extends org.guvnor.common.services.project.model.Project> org.guvnor.common.services.builder.IncrementalBuilderExecutorManagerFactoryImpl.projectService is not resolvable to a concrete type.

And you can find more similar warnings in the server log. It is a problem we discussed a few weeks ago during our e-mail conversation. Back then somebody suggested wildcard injection points may cause problems on WebSphere but the tests passed on this container and we were all happy. However, it seems that the problematic container is WebLogic instead. And only the latest version 12.2 since the tests passed on 12.1.

Comment 13 Marco Rietveld 2016-03-21 12:01:19 UTC
For the curious: A link to the Oracle documentation about Java EE 7 support in WLS 12.2.1: https://docs.oracle.com/middleware/1221/wls/NOTES/whatsnew.htm#NOTES379