Skip to content
New issue

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

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

Already on GitHub? # to your account

Varargs: jakarta.el.MethodNotFoundException #173

Closed
volosied opened this issue Oct 26, 2021 · 2 comments
Closed

Varargs: jakarta.el.MethodNotFoundException #173

volosied opened this issue Oct 26, 2021 · 2 comments
Labels
Component: Impl Only affects this implementation

Comments

@volosied
Copy link
Contributor

I encountered the following exception when testing the code below on Wildfly 24."

Tomcat had updated their varargs handling in BZ 65358, and I'm wondering if this API could have something similar applied?

However, I understand this might also be due to vagueness in the spec? Enum could be coerce to a string? I appreciate any assistance. Thanks!

Caused by: javax.el.MethodNotFoundException: Unable to find unambiguous method: class com.test.TestBean.testMethod(com.test.Level, com.test.Level, com.test.Level)
	at javax.el.ELUtil.findMostSpecificWrapper(ELUtil.java:407)
	at javax.el.ELUtil.findWrapper(ELUtil.java:376)
	at javax.el.ELUtil.findMethod(ELUtil.java:271)
	at javax.el.ELUtil.findMethod(ELUtil.java:230)
	at javax.el.BeanELResolver.invoke(BeanELResolver.java:327)
	at org.apache.jasper.el.JasperELResolver.invoke(JasperELResolver.java:147)

public enum Level {
    LOW   (1);

    private final int levelCode;

    private Level(int levelCode) {
        this.levelCode = levelCode;
    }
}
public class TestBean {

    public Level getLevel() {
        return Level.LOW;
    }
    
    public String testMethod(Level level1, Level... level2) {
        return "(Level level1, Level... level2)";
    }

    public String testMethod(String param1, Level... level2) {
        return "(String param1, Level... level2)";
    }
}

EL Expression:
${testBean.testMethod(testBean.getLevel(), testBean.getLevel(), testBean.getLevel())}

@markt-asf markt-asf added the Component: Impl Only affects this implementation label Oct 27, 2021
@markt-asf
Copy link
Contributor

The method mapping was updating for EL 5.0 as part of #159. Once the implementation is updated for #159 (I haven't seen any activity from the Glassfish team along those lines) this issue should be addressed.

@arjantijms
Copy link
Contributor

Done from an API perspective. See eclipse-ee4j/expressly#3 to track the implementation in GlassFish.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Component: Impl Only affects this implementation
Projects
None yet
Development

No branches or pull requests

3 participants