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}" />