OmniFaces graphicImage method throws IllegalArgumentException

醉酒当歌 提交于 2019-12-12 05:09:21

问题


as already covered in this SO post I was successfully creating an h:outputLink with of:graphicImageURL('imageBean.getFirstImage(Long id, boolean thumbnail)'). This works fine on my local machine. However, when I deploy it on one of my production servers (two instances of the software, both sharing the exact same Java Code, runs perfectly fine on Server A but not on Server B), it throws the following exception:

Caused by: java.lang.IllegalArgumentException: argument type mismatch
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.omnifaces.resourcehandler.GraphicResource.getInputStream(GraphicResource.java:259)
    at com.sun.faces.application.resource.ResourceHandlerImpl.handleResourceRequest(ResourceHandlerImpl.java:335)
    at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:153)
    at org.primefaces.application.resource.PrimeResourceHandler.handleResourceRequest(PrimeResourceHandler.java:87)
    at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:153)
    at javax.faces.application.ResourceHandlerWrapper.handleResourceRequest(ResourceHandlerWrapper.java:153)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:655)
    ... 32 more

To make it a little bit weirder, it worked fine after changing the method to imageBean.getImage(Long id, int index, Boolean thumbnail). (The index param indicates, which picture of an array of pictures to retrieve). BalusC mentioned in a comment that it might be due to concurring libraries in the /WEB-INF/lib-Folder, so here it is:

As application-server I'm using Wildfly 9.0.2. What's so confusing to me is the fact, that both instances of the software share the same code base and have the same setup but while it's working on Server A (and also on my local machine) it isn't on Server B. Any clues?

来源:https://stackoverflow.com/questions/39918403/omnifaces-graphicimage-method-throws-illegalargumentexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!