Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to the EL-RI (Eclipse Foundation ) #13425

Closed
volosied opened this issue Aug 11, 2020 · 6 comments
Closed

Switch to the EL-RI (Eclipse Foundation ) #13425

volosied opened this issue Aug 11, 2020 · 6 comments

Comments

@volosied
Copy link
Member

volosied commented Aug 11, 2020

See Tom's comment in PR #13275

There are few small API differences between the Eclipse EE4J (Jakarta) & Tomcat APIs, so we decided to enable the Tomcat EL API in Liberty instead.

A number of access control warnings are thrown when using the Jakarta API.

I created this issue in the el-ri project and provided potential patch.

Additionally, there one test that failed in tests and needs to be investigated:

public void testJSP23ResolutionVariableProperties() throws Exception {

This issue is a follow up to pull in the jakarta api later if possible.

Update #1 -- See this comment for addressing FAT failures:

#13425 (comment)

Update #2 -- Issues opened in the EE4J EL API community

https://github.com/eclipse-ee4j/el-ri/pull/174
https://github.com/eclipse-ee4j/el-ri/issues/173

One is regarding the security manager and the other is for varargs handling (which tomcat had recently updated and we pulled in -- #17444)

Once those two issues are resolved and included in a release, I think we can pull the API into Liberty .

@volosied volosied changed the title Switch to the Jakarta EL API from the Eclipse Foundation Switch to the Jakarta EL API (from Eclipse Foundation ) Aug 18, 2020
@volosied
Copy link
Member Author

volosied commented Oct 15, 2021

i compared the tomcat-el-api v10.0.12 and jakarta.el-api v4.0.0 using japicmp. No binary incompatibilities found.
results.zip

@volosied
Copy link
Member Author

volosied commented Oct 15, 2021

I ran the EL 3.0 FULL bucket using the Jakarta EL API. 3 Failures occurred. Two of the tests I added myself, but it matches the other test. They are seem related the parameters of a method.

[RESOLVED] testCatchExeptionOnLessParam_EE9_FEATURES
junit.framework.AssertionFailedError: 2021-10-15-14:09:50:286 The response did not contain "[SUCCESS]". Full output is:"
ERROR: Caught exception attempting to call test method testCatchExeptionOnLessParam on servlet com.ibm.ws.el30.fat.servlets.TestVariousLambdaExpression
java.lang.AssertionError: The exception message did not contain: Only [1] arguments were provided for a lambda expression that requires at least [2] but was: Expected Argument y missing in Lambda Expression

**testEnum_VarargsEnum_EE9_FEATURES**

junit.framework.AssertionFailedError: 2021-10-15-14:11:40:496 The response did not contain "[SUCCESS]". Full output is:"
ERROR: Caught exception attempting to call test method testEnum_VarargsEnum on servlet com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingServlet
jakarta.el.MethodNotFoundException: Unable to find unambiguous method: class com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingTestBean.testMethod(com.ibm.ws.el30.fat.varargstest.EnumBean, com.ibm.ws.el30.fat.varargstest.EnumBean, com.ibm.ws.el30.fat.varargstest.EnumBean)
at jakarta.el.ELUtil.findMostSpecificWrapper(ELUtil.java:389)
at jakarta.el.ELUtil.findWrapper(ELUtil.java:358)
at jakarta.el.ELUtil.findMethod(ELUtil.java:253)
at jakarta.el.ELUtil.findMethod(ELUtil.java:212)
at jakarta.el.BeanELResolver.invoke(BeanELResolver.java:430)
at jakarta.el.CompositeELResolver.invoke(CompositeELResolver.java:198)
at org.apache.el.parser.AstValue.getValue(AstValue.java:158)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
at jakarta.el.ELProcessor.getValue(ELProcessor.java:108)
at jakarta.el.ELProcessor.eval(ELProcessor.java:96)
at com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingServlet.getMethodExpression(EL30VarargsMethodMatchingServlet.java:153)
at com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingServlet.testEnum_VarargsEnum(EL30VarargsMethodMatchingServlet.java:94)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at componenttest.app.FATServlet.doGet(FATServlet.java:71)

**testString_VarargsMultipleEnum_EE9_FEATURES**

junit.framework.AssertionFailedError: 2021-10-15-14:11:40:555 The response did not contain "[SUCCESS]". Full output is:"
ERROR: Caught exception attempting to call test method testString_VarargsMultipleEnum on servlet com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingServlet
jakarta.el.MethodNotFoundException: Unable to find unambiguous method: class com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingTestBean.testMethod(java.lang.String, com.ibm.ws.el30.fat.varargstest.EnumBean, com.ibm.ws.el30.fat.varargstest.EnumBean)
at jakarta.el.ELUtil.findMostSpecificWrapper(ELUtil.java:389)
at jakarta.el.ELUtil.findWrapper(ELUtil.java:358)
at jakarta.el.ELUtil.findMethod(ELUtil.java:253)
at jakarta.el.ELUtil.findMethod(ELUtil.java:212)
at jakarta.el.BeanELResolver.invoke(BeanELResolver.java:430)
at jakarta.el.CompositeELResolver.invoke(CompositeELResolver.java:198)
at org.apache.el.parser.AstValue.getValue(AstValue.java:158)
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
at jakarta.el.ELProcessor.getValue(ELProcessor.java:108)
at jakarta.el.ELProcessor.eval(ELProcessor.java:96)
at com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingServlet.getMethodExpression(EL30VarargsMethodMatchingServlet.java:153)
at com.ibm.ws.el30.fat.varargstest.EL30VarargsMethodMatchingServlet.testString_VarargsMultipleEnum(EL30VarargsMethodMatchingServlet.java:101)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at componenttest.app.FATServlet.doGet(FATServlet.java:71)

@volosied
Copy link
Member Author

volosied commented Oct 15, 2021

I also ran the JSF 2.3 Bucket and found 2 failures.

[RESOLVED] testEL30LambdaExpressions_EE9_FEATURES
2021-10-15-14:23:25:864 The response did not contain: CatchExeptionOnLessParam_EL3.0_Test 4: --> Pass another argument. Only [1] arguments were provided for a lambda expression that requires at least [2]

junit.framework.AssertionFailedError: 2021-10-15-14:23:25:864 The response did not contain: CatchExeptionOnLessParam_EL3.0_Test 4: --> Pass another argument. Only [1] arguments were provided for a lambda expression that requires at least [2]

[RESOLVED] testJSP23ResolutionVariableProperties_EE9_FEATURES
2021-10-15-14:23:35:283 Expected 200 status code was not returned! expected:<200> but was:<500>

junit.framework.AssertionFailedError: 2021-10-15-14:23:35:283 Expected 200 status code was not returned! expected:<200> but was:<500>
Caused by: java.lang.NullPointerException
at com.ibm.ws.jsp23.fat.testel.servlets.ResolutionVariablesPropertiesServlet.checkOrderAndSize(ResolutionVariablesPropertiesServlet.java:148)
at com.ibm.ws.jsp23.fat.testel.servlets.ResolutionVariablesPropertiesServlet.doGet(ResolutionVariablesPropertiesServlet.java:86)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:500)
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:587)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1258)
... 1 more

@volosied
Copy link
Member Author

I think these errors are due to subtle differences between the two APIs. I think it might be best to keep this as they are, but we can reopen this issue at a later point.

@volosied
Copy link
Member Author

volosied commented Oct 20, 2021

Reading more closely, two lambda test look for the following string:

String expectedText = "Only [1] arguments were provided for a lambda expression that requires at least [2]";

The Eclipse EL API just gives a different wording of the error: Expected Argument y missing in Lambda Expression

This new wording applies to both testCatchExeptionOnLessParam and testEL30LambdaExpressions:

"<b>CatchExeptionOnLessParam_EL3.0_Test 4:</b> --> Pass another argument. Only [1] arguments were provided for a lambda expression that requires at least [2]",

As for the Varargs Tests, I think the EL are related to the implementation. Tomcat updated their code recently, but Jakarta EL hasn't. I think this is a valid issue. It also could use spec clarification. I can work with the community to changing varargs handling.

https://github.com/eclipse-ee4j/el-ri/blob/4.0.0/api/src/main/java/jakarta/el/ELUtil.java#L294-L333

testJSP23ResolutionVariableProperties_EE9_FEATURES fails because of a wrong look up

Tomcat has a field called resolvers
Eclipse has a field called elResolvers

@volosied volosied changed the title Switch to the Jakarta EL API (from Eclipse Foundation ) Switch to the EL-RI (Eclipse Foundation ) Nov 15, 2021
@pnicolucci
Copy link
Member

We've decided not to do this. We've always pulled the API and IMPL from Tomcat similar to how we pull the API and IMPL for Faces from Apache MyFaces. Our concern is we'll need a fix for something in the IMPL (fix in the API implementation) and we would not be able to get it from the Eclipse API jar for some reason. I think it is safest to stick with pulling the API and IMPL from the same location for the Expression Language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants