WebSphere Traditional scans application library jars. WebSphere Liberty does not scan application library jars. #30719
Labels
design-issue
regression
This bug is for something that worked in a past release, but no longer does
release bug
This bug is present in a released version of Open Liberty
Problem Statement
There is an inconsistency in the scanning of enterprise application library jars between WebSphere Traditional and WebSphere Liberty:
(Detection of other annotations, in particular, component defining annotations, is also impacted.)
Changing the Liberty scan behavior is possible, however, this is a change of behavior to existing Liberty application installations. That leads to two questions:
For example:
As-Is:
<applicationManager autoExpand="true"/>
To-Be:
<applicationManager autoExpand="true" enableLibraryScans="true"/>
As-Is:
<application location="helloworld.ear"/>
To-Be:
<application location="helloworld.ear" enableLibraryScans="true"/>
Proposed Resolution
The proposal is to add code which performs scans of application library archives, to add configuration options to the application manager and application which are used to enable the new scanning code, and to have the new scans be disabled by default.
A capability to perform scans on application library JARS should be added.
The capability should be enabled via a new element of the application manager and application configuration elements.
The default should be current behavior, which is to not perform application library scans. Changing behavior is preferred, but not possible due to impacts to existing Liberty application installations.
Background
Sample
For example, test jar "SpringAnnoTest.jar", with "JarInit.java", which is a web application initializer with an "onStartup" method, is not located when "SpringAnnoTest.jar" is an EAR library jar. This initializer is located in TWAS and is not located in Liberty:
The problem is specific to applications packaged as enterprise applications. That is to say, which are packaged using an Enterprise Application Archive (EAR file), which may contain java archives (JAR files) under an application library folder. This problem does not occur for applications which are packaged as Web Module Archives (WAR files). The "WEB-INF/lib" folder of WAR files is not the same as the "lib" folder of EAR files.
Customer Impact
This behavior difference has been noted by a customer migrating / modernizing applications from WebSphere Traditional to WebSphere Liberty. (A case is active.)
Changing the Liberty behavior will have two impacts to existing Liberty application deployments:
To date, no Liberty application installation has noted the difference in scan behavior.
The problem scenario will be seen with an increased likelihood as a consequence of ongoing WebSphere development projects which directly enable the deployment of applications from WebSphere Traditional to WebSphere Liberty.
Reproducibility
The problem is easily reproduceable in Liberty. See open-liberty pull request 30592 (https://github.com/OpenLiberty/open-liberty/pull/30592/files), and run the new fat test without the other code changes.
Noted on the case, the sample application deploys on WebLogic and Apache TomEE.
Specification
The JavaEE v7 specification has:
Code Updates
The problem has a relatively small fix. This is also provided in the open-liberty pull request 30592 (https://github.com/OpenLiberty/open-liberty/pull/30592/files). Application library information is readily available and may be used to add library jars for scanning. See, in particular, the update to "com.ibm.ws.container.service.annocache.internal.WebAnnotationsImpl.java" in the pull request (https://github.com/OpenLiberty/open-liberty/pull/30592/files#diff-7ea24aacd210af7cd669109121db148f1cb75872fd5a4ae3f00bc34d701b747c).
Notes
The JavaEE specification notwithstanding, no cases have been opened against WebSphere Liberty in regards to scans of application library jars.
WebSphere Liberty does scan referenced classes in application library jars.
Design Call Notes
Need to review behavior changes with respect to CDI. Followup w/Ben and Emily and the CDI team.
Does this same problem exist for shared libraries? If so, the setting for shared libraries should be unified with the setting for application libraries. (Not mentioned on the call: Does this problem exist for manifest class path jars?)
Given the lack of reported problems, having the current behavior as the default seems preferred. The preference is to add an attribute to the application element.
Adding an attribute to the application manager element would be necessary to enable the behavior for dropins applications. However, the preference was to not add an application manager element.
See the recently added setting for configuring application classloading behavior for consistency with TWAS. See issue #28110.
A UFO is recommended, since this is a design change.
Having a UFO will mean a POC call will not be needed. An UFO will provide a place to remark that for migration scenarios the setting might be set to true.
The text was updated successfully, but these errors were encountered: