0

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?

Community
  • 1
  • 1
Jonas Bausch
  • 185
  • 3
  • 12
  • Server-provided libraries doesn't belong in /WEB-INF/lib folder. A lot of the listed libraries are already provided by the server. Remove them all and retry. It are at least hibernate* (and its deps such as geronimo and javassist and perhaps commons/dom4j/xmlbeans if you don't use those internally), javax*, jboss*, jta*. Here are related readings: http://stackoverflow.com/documentation/jsf/916/introduction-to-jsf/3036/installing-jsf#t=201610071352577719515 and http://stackoverflow.com/questions/8081234/how-to-properly-install-and-configure-jsf-libraries-via-maven – BalusC Oct 07 '16 at 13:51
  • this cleanup has been on my todo-list for ages. It's from when I used Tomcat at the beginning. But I couldn't remove `hibernate-core-5.0.7.jar` though, that caused compiler errors. Anyway, it doesn't explain why it works on one server and not on the other, since they're both the exact same – Jonas Bausch Oct 07 '16 at 16:17
  • JVM and hardware architecture also plays a role. – BalusC Oct 07 '16 at 16:47
  • The one where it wasn't working has Java 1.7.0_111 whereas the other one is running Java 1.7.0_95. Hardware should both be the exact same according to the vendor running both a Debian-83-jessie-64-LAMP OS – Jonas Bausch Oct 07 '16 at 18:54

0 Answers0