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

JSF throws ClassNotFoundException for o.a.m.el.convert.ValueExpressionToValueBinding #18437

Closed
wtlucy opened this issue Sep 3, 2021 · 1 comment · Fixed by #18432
Closed
Assignees
Labels
in:Web Components release bug This bug is present in a released version of Open Liberty release:210010 team:Sirius

Comments

@wtlucy
Copy link
Contributor

wtlucy commented Sep 3, 2021

Describe the bug
A JSF application using jsf-2.2 or jsf-2.3 can encounter a ClassNotFoundException for the internal MyFaces class ValueExpressionToValueBinding, even if that class isn't directly referenced by the app. This issue occurs because the org.apache.myfaces.el.convert package is not currently made available (by Liberty's jsf-2.2 and jsf-2.3 bundles) to the thread context classloader.

[ERROR   ] SRVE0315E: An exception occurred: java.lang.Throwable: javax.servlet.ServletException: org.apache.myfaces.el.convert.ValueExpressionToValueBinding
        at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:5119)
        at [internal classes]
Caused by: javax.servlet.ServletException: org.apache.myfaces.el.convert.ValueExpressionToValueBinding
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)
        ... 1 more
Caused by: java.lang.ClassNotFoundException: org.apache.myfaces.el.convert.ValueExpressionToValueBinding
        at java.lang.Class.forNameImpl(Native Method)
        at java.lang.Class.forName(Class.java:407)
        at javax.faces.component._ClassUtils.classForName(_ClassUtils.java:145)
        ... 1 more

Steps to Reproduce
Applications with custom tags using Application.createValueBinding(String) deployed with jsf-2.2 or jsf-2.3can hit this:

@FacesComponent(tagName = "valueBindingTag", createTag=true, namespace="http://openliberty.io/jsf")
public class ValueBindingTag extends UIComponentBase {
...
    @Override
    public void encodeBegin(FacesContext context) throws IOException {
        ValueBinding test = getFacesContext().getApplication().createValueBinding("test"); // CNFE here
        this.setValueBinding("test", test);
    }
...

Expected behavior
This ClassNotFoundException should not be thrown

Diagnostic information:

  • OpenLiberty Version: [e.g. 21.0.0.8 - 21.0.0.10]
  • Affected feature(s) jsf-2.2, jsf-2.3

Additional context
N/A

@wtlucy wtlucy added in:Web Components release bug This bug is present in a released version of Open Liberty team:Sirius labels Sep 3, 2021
@wtlucy wtlucy self-assigned this Sep 3, 2021
@wtlucy wtlucy added this to General Issues in Web Tier Team via automation Sep 3, 2021
@wtlucy wtlucy changed the title JSF throws ClassNotFoundException for org.apache.myfaces.el.convert.ValueExpressionToValueBinding JSF throws ClassNotFoundException for o.a.m.el.convert.ValueExpressionToValueBinding Sep 3, 2021
@wtlucy wtlucy closed this as completed Sep 10, 2021
Web Tier Team automation moved this from General Issues to Completed Tasks Sep 10, 2021
@mbroz2
Copy link
Member

mbroz2 commented Sep 29, 2021

@wtlucy please update the description of this release bug so that it follows/conforms to the Bug report template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in:Web Components release bug This bug is present in a released version of Open Liberty release:210010 team:Sirius
Projects
Archived in project
Web Tier Team
  
Completed Tasks
Development

Successfully merging a pull request may close this issue.

3 participants