0
votes

I am using Primefaces 6.0 on Weblogic11g,JSF2.0,Servlet 2.5.

My Application was able to render dynamic jpeg images with Primefaces 5.3. Once i migrated to 6.0, my dynamic p:graphicImages are giving NoSuchMethodError related to el.

PrimeExceptionHandler logException
javax.el.ValueExpression.getValueReference(Ljavax/el/ELContext;)Ljavax/el/ValueReference; java.lang.NoSuchMethodError: javax.el.ValueExpression.getValueReference(Ljavax/el/ELContext;)Ljavax/el/ValueReference; at org.primefaces.el.ValueExpressionAnalyzer.toValueReference(ValueExpressionAnalyzer.java:91) at org.primefaces.el.ValueExpressionAnalyzer.getExpression(ValueExpressionAnalyzer.java:44) at org.primefaces.util.DynamicResourceBuilder.build(DynamicResourceBuilder.java:58) at org.primefaces.component.graphicimage.GraphicImageRenderer.getImageSrc(GraphicImageRenderer.java:75) at org.primefaces.component.graphicimage.GraphicImageRenderer.encodeEnd(GraphicImageRenderer.java:41) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:884) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681) at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:854) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:85) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72) e

@ManagedBean(name="filebean")
@RequestScoped


public class FileBean {

private StreamedContent image;

public StreamedContent getImage() {
    try {
        File file = new File("C:/LEAVEMODULEFOLDER/569_q318d09lou9mafbqsdgsqph1ar_cbblogopng.jpg");

        System.out.println(""+file.canRead());
        image = new DefaultStreamedContent(new FileInputStream(file), "image/jpeg");

} catch (Exception e) {
    log.error("Error in ::" + e);
    log.error(Utility.getStackTrace(e));
}



return this.image;
}
}

xhtml code is as follows

<p:graphicImage value="#{filebean.image}" />  
1
Did you check the releasenotes/migration guide?Kukeltje
Yes, i did, but found nothing which was relevent for me except changing the primefaces jar file.ZEE
Any lead that can help ?ZEE

1 Answers

2
votes

According to the API the method in question (ValueExpression.getValueReference()) does only exist since EL 2.2

Since you are using Servlet 2.5, you are most likely using EL 2.1 (see this answer for more information). Therefore the NoSuchMethodError occurs for the EL 2.2 method.

So the only options you seem to have is either staying with PrimeFaces 5.3, upgrading to EL 2.2/Servlet 3.0 or not using p:graphicImage anymore.

Apart from that you could also report this issue to the PrimeFaces devs, because since they seem to support Servlet 2.5 according to their user guide, this might be considered a bug.