Closed TrevCraw closed 2 years ago
After further investigation, we do not need to call the binary scanner twice in the cases where we are already optimizing and we are not passing any user specified features. This is covered with https://github.com/OpenLiberty/ci.common/pull/362.
Then the binary scanner is returning a FeatureModifiedException
because the app is using conflicting features:
FeatureModifiedException: com.ibm.websphere.binary.cmdline.exceptions.RequiredFeatureModifiedException:
CWMIG12127W: The jpa-2.0 features are required by the application but conflicts with other features. The features were
replaced with a different version to create a valid feature list. The application might need updates to run with the generated
feature list.
Modified list returned from the binary scanner: [ejbLite-3.2, servlet-3.1, beanValidation-1.1, jndi-1.0, jaxws-2.2, jms-2.0, samlWeb-2.0, appSecurity-2.0, jaxrs-2.0, socialLogin-1.0, ejbRemote-3.2, jaxb-2.2, openidConnectServer-1.0, mdb-3.2, cdi-1.2, jpa-2.1]
Then, should we be still generating the feature list (using the modified list returned from the binary scanner) and displaying a warning to users that we detected jpa-2.0 in their application but had to modify it to jpa-2.1. Or should we be displaying an error with the above message?
The current behaviour is to generate the modified feature list and no warning or error is displayed to users.
Let's go with generating the modified feature list and displaying the warning. This is the case where user specified features have not been modified.
Using https://github.ibm.com/was-svt/acme-ee Most attempts to generate features result in two calls to the binary scanner and a FeatureModifiedException. This especially does not make sense for the initial call to the binary scanner as there are no current features passed to the binary scanner. And on calls made afterwards, the current features were all determined by binary scanner from the initial call. Below is some debug output from running
mvn liberty:dev
(including changes from https://github.com/OpenLiberty/ci.common/pull/361 - also confirmed this error occurs without these changes)Initial generate features on startup
Generate features after change to
acme-ee-main\AcmeCommon\src\main\java\com\ibm\wssvt\acme\common\bean\StringConfigrable.java
FeatureModifiedException did not occur in this instanceGenerate features after change to
acme-ee-main\AcmeAnnuityJAXRSCommon\src\main\java\com\ibm\wssvt\acme\annuity\common\business\jaxrs\MyJAXBResolver.java
Generate features after change to
acme-ee-main\AcmeAnnuityJAXRSWSes_jaxrs20\src\main\java\com\ibm\wssvt\acme\annuity\business\impl\jaxrs\AnnuityMgmtSvcJAXRS.java
Full debug output: debugOutput.txt