OmniFaces graphicImage method throws IllegalArgume

2019-09-10 09:28发布

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: lib-content

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?

0条回答
登录 后发表回答