[JBoss JIRA] (WFLY-12650) EL does not handle identifiers as JavaBeans
by Ricardo Martin Camarero (Jira)
[ https://issues.jboss.org/browse/WFLY-12650?page=com.atlassian.jira.plugin... ]
Ricardo Martin Camarero commented on WFLY-12650:
------------------------------------------------
WFLY-6939 introduced an ImportedClassELResolver in order to resolve static fields in classes (like {{Boolean.TRUE}}) but the resolver was added as an app one so the order is not good. New jboss-jsp-api_2.3_spec 2.0.0 also resolves static fields in the last resolver ScopedAttributeELResolver.java (see for example WFLY-12439) so I think that the best way is going back to the spec implementation to resolve static fields.
> EL does not handle identifiers as JavaBeans
> -------------------------------------------
>
> Key: WFLY-12650
> URL: https://issues.jboss.org/browse/WFLY-12650
> Project: WildFly
> Issue Type: Bug
> Components: EE, Web (Undertow)
> Affects Versions: 18.0.0.Final
> Reporter: Ricardo Martin Camarero
> Assignee: Ricardo Martin Camarero
> Priority: Major
> Attachments: ELTest.war
>
>
> Even if defined JavaBeans using <jsp:useBean> in jsp, the EL expression is handled as java Class if that class is already imported in jsp.
> {code:title=EX)test1.jsp|borderStyle=solid}
> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
> <%@page import="test.TestMBean"%>
> <html>
> <head>
> <title>Test1</title>
> </head>
> <body>
> <jsp:useBean id="TestMBean" class="test.TestMBean"/>
> TestMBean.test : ${TestMBean.test} <br/>
> </body>
> </html>
> {code}
> Therefore, the following exceptions may occur:
> {noformat}
> Caused by: javax.el.PropertyNotFoundException: Either 'test' is not a public static field of the class 'test.TestMBean' or field is inacessable
> at javax.el.StaticFieldELResolver.getValue(StaticFieldELResolver.java:107)
> at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
> at com.sun.el.parser.AstValue.getValue(AstValue.java:139)
> at com.sun.el.parser.AstValue.getValue(AstValue.java:203)
> at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
> at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:917)
> at org.apache.jsp.test1_jsp._jspService(test1_jsp.java:107)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
> at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
> ... 46 more
> {noformat}
> According [EL spec|https://download.oracle.com/otn-pub/jcp/el-3_0-fr-eval-spec/EL3.0.FR...], Evaluating of the imported static field should be the last.
> {quote}
> 1.5.1 Evaluating Identifiers
> The steps are used for evaluating an identifier.
> ■ If the identifier is a lambda argument passed to a lambda expression invocation, its value is returned.
> ■ Else if the identifier is a variable, the associated expression is evaluated and returned.
> ■ Else if the identifier is resolved by the ELResolvers, the value returned from the ELResolvers is returned.
> ■ Else if the identifier is an imported static field, its value is returned.
> ■ Else return not resolved.
> One implication of the explicit search order of the identifiers is that an identifier hides other identifiers (of the same name) that come after it in the list.
> {quote}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 7 months
[JBoss JIRA] (WFLY-12650) EL does not handle identifiers as JavaBeans
by Ricardo Martin Camarero (Jira)
[ https://issues.jboss.org/browse/WFLY-12650?page=com.atlassian.jira.plugin... ]
Ricardo Martin Camarero moved JBEAP-17750 to WFLY-12650:
--------------------------------------------------------
Project: WildFly (was: JBoss Enterprise Application Platform)
Key: WFLY-12650 (was: JBEAP-17750)
Workflow: GIT Pull Request workflow (was: CDW with loose statuses v1)
Component/s: EE
Web (Undertow)
(was: EE)
(was: Web (Undertow))
Affects Version/s: 18.0.0.Final
(was: 7.2.4.GA)
> EL does not handle identifiers as JavaBeans
> -------------------------------------------
>
> Key: WFLY-12650
> URL: https://issues.jboss.org/browse/WFLY-12650
> Project: WildFly
> Issue Type: Bug
> Components: EE, Web (Undertow)
> Affects Versions: 18.0.0.Final
> Reporter: Ricardo Martin Camarero
> Assignee: Ricardo Martin Camarero
> Priority: Major
> Attachments: ELTest.war
>
>
> Even if defined JavaBeans using <jsp:useBean> in jsp, the EL expression is handled as java Class if that class is already imported in jsp.
> {code:title=EX)test1.jsp|borderStyle=solid}
> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
> <%@page import="test.TestMBean"%>
> <html>
> <head>
> <title>Test1</title>
> </head>
> <body>
> <jsp:useBean id="TestMBean" class="test.TestMBean"/>
> TestMBean.test : ${TestMBean.test} <br/>
> </body>
> </html>
> {code}
> Therefore, the following exceptions may occur:
> {noformat}
> Caused by: javax.el.PropertyNotFoundException: Either 'test' is not a public static field of the class 'test.TestMBean' or field is inacessable
> at javax.el.StaticFieldELResolver.getValue(StaticFieldELResolver.java:107)
> at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:110)
> at com.sun.el.parser.AstValue.getValue(AstValue.java:139)
> at com.sun.el.parser.AstValue.getValue(AstValue.java:203)
> at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
> at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:917)
> at org.apache.jsp.test1_jsp._jspService(test1_jsp.java:107)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:791)
> at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:433)
> ... 46 more
> {noformat}
> According [EL spec|https://download.oracle.com/otn-pub/jcp/el-3_0-fr-eval-spec/EL3.0.FR...], Evaluating of the imported static field should be the last.
> {quote}
> 1.5.1 Evaluating Identifiers
> The steps are used for evaluating an identifier.
> ■ If the identifier is a lambda argument passed to a lambda expression invocation, its value is returned.
> ■ Else if the identifier is a variable, the associated expression is evaluated and returned.
> ■ Else if the identifier is resolved by the ELResolvers, the value returned from the ELResolvers is returned.
> ■ Else if the identifier is an imported static field, its value is returned.
> ■ Else return not resolved.
> One implication of the explicit search order of the identifiers is that an identifier hides other identifiers (of the same name) that come after it in the list.
> {quote}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 7 months
[JBoss JIRA] (WFLY-12313) Implement MP OpenAPI
by Michael Edgar (Jira)
[ https://issues.jboss.org/browse/WFLY-12313?page=com.atlassian.jira.plugin... ]
Michael Edgar edited comment on WFLY-12313 at 10/7/19 9:51 PM:
---------------------------------------------------------------
[~pferraro], I'll look in to it over the next few days. With that change, it would mean that there may be multiple `/openapi` contexts registered depending on the number of servers and virtual hosts the application(s) define, correct?
---- Update
I researched this a bit and it looks like the server/virtual host names can be retrieved from `JBossWebMetaData` if they have been configured. Otherwise, it would be necessary to get them from `UndertowService`. Is that the way you are suggesting?
was (Author: michael.edgar):
[~pferraro], I'll look in to it over the next few days. With that change, it would mean that there may be multiple `/openapi` contexts registered depending on the number of servers and virtual hosts the application(s) define, correct?
> Implement MP OpenAPI
> --------------------
>
> Key: WFLY-12313
> URL: https://issues.jboss.org/browse/WFLY-12313
> Project: WildFly
> Issue Type: Feature Request
> Reporter: Michael Edgar
> Assignee: Paul Ferraro
> Priority: Major
>
> Please integrate MicroProfile OpenAPI.
> Details about MP OpenAPI:
> https://github.com/eclipse/microprofile-open-api/releases/tag/1.1.2
> Maybe it is possible to use SmallRye implementation:
> https://github.com/smallrye/smallrye-open-api
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 7 months
[JBoss JIRA] (WFLY-12547) Include timer id in timerHasExpired and timerWasCanceled
by Cheng Fang (Jira)
[ https://issues.jboss.org/browse/WFLY-12547?page=com.atlassian.jira.plugin... ]
Cheng Fang commented on WFLY-12547:
-----------------------------------
Testing with an adapted version of [this quickstart sample|https://github.com/jboss-developer/jboss-eap-quickstarts/blob/99ee...] , I was able to see the timer id in log message:
WFLYEJB0330: Timer b38543e2-1e99-4f82-9c86-f1e3dcc2acd6 has expired
{code:java}
diff --git a/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java b/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java
index 782c134a9..674b604ab 100644
--- a/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java
+++ b/ejb-timer/src/main/java/org/jboss/as/quickstarts/ejbTimer/TimeoutExample.java
@@ -41,6 +41,8 @@ public class TimeoutExample {
@Resource
private TimerService timerService;
+ private Timer singleActionTimer;
+
@Timeout
public void scheduler(Timer timer) {
Date currentTime = new Date();
@@ -54,6 +56,7 @@ public class TimeoutExample {
// Set schedule to every 3 seconds (starting at second 0 of every minute).
se.hour("*").minute("*").second("0/3");
timerService.createCalendarTimer(se, new TimerConfig("EJB timer service timeout at ", false));
+ singleActionTimer = timerService.createSingleActionTimer(1, new TimerConfig("single action timer", false));
}
@PreDestroy
@@ -63,5 +66,6 @@ public class TimeoutExample {
System.out.println("Stopping timer: " + timer.getInfo());
timer.cancel();
}
+ singleActionTimer.cancel();
}
}
{code}
> Include timer id in timerHasExpired and timerWasCanceled
> --------------------------------------------------------
>
> Key: WFLY-12547
> URL: https://issues.jboss.org/browse/WFLY-12547
> Project: WildFly
> Issue Type: Enhancement
> Components: EJB
> Affects Versions: 18.0.0.Beta1
> Reporter: Cheng Fang
> Assignee: Cheng Fang
> Priority: Major
>
> need to include timer id in {{timerWasCanceled}} and {{timerHasExpired}} message. Currently the generic message does not tell which time has expired or cancelled.
> {code}
> javax.ejb.NoSuchObjectLocalException: WFLYEJB0330: Timer has expired
> at org.jboss.as.ejb3.timerservice.TimerImpl.assertTimerState(TimerImpl.java:476) [wildfly-ejb3-18.0.0.Final-SNAPSHOT.jar:18.0.0.Final-SNAPSHOT]
> at org.jboss.as.ejb3.timerservice.TimerServiceImpl.cancelTimer(TimerServiceImpl.java:636) [wildfly-ejb3-18.0.0.Final-SNAPSHOT.jar:18.0.0.Final-SNAPSHOT]
> at org.jboss.as.ejb3.timerservice.TimerImpl.cancel(TimerImpl.java:164) [wildfly-ejb3-18.0.0.Final-SNAPSHOT.jar:18.0.0.Final-SNAPSHOT]
> at com.sun.ts.tests.ejb30.timer.common.TimerBeanBaseWithoutTimeOutMethod.cancelTimer(TimerBeanBaseWithoutTimeOutMethod.java:95) [classes:]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_191]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_191]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_191]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_191]
> at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
> at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:422)
> at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:509)
> ...
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
6 years, 7 months