java.lang.AbstractMethodError: org.apache.xerces.dom.ElementImpl.getTextContent()Ljava/lang/String

java.lang.AbstractMethodError: org.apache.xerces.dom.ElementImpl.getTextContent()Ljava/lang/String; This will happen when there are Xerces JAR files in your WAR’s /WEB-INF/lib (or even JRE’s /lib) which is of an older version than the one internally used by the servletcontainer. The older version, which apparently implements JAXP of Java 1.4.2 or older, is missing the mentioned method which was introduced in JAXP … Read more

JSF: Mojarra vs. OmniFaces @ViewScoped: @PreDestroy called but bean can’t be garbage collected

The cause of this problem seems to be due to strange behaviour JVisualVM when attached to Glassfish/Payara. The test case used for this question is still extremely useful, however the conclusions concerning Garbage Collection in the original post (and images) were based on JVisualVM, and I have since found they are not valid. Use the … Read more

Pass an object between @ViewScoped beans without using GET params

Depends on whether you’re sending a redirect or merely navigating. If you’re sending a redirect, then put it in the flash scope: Faces.setFlashAttribute(“car”, car); This is available in the @PostConstruct of the next bean as: Car car = Faces.getFlashAttribute(“car”); Or, if you’re merely navigating, then put it in the request scope: Faces.setRequestAttribute(“car”, car); This is … Read more