Skip to content

Quarkus Faces Known Issues

Melloware edited this page Apr 21, 2024 · 20 revisions

Production

Unsupported EE Features

Due to Quarkus not being a complete EE server and not being engineered as one, it lacks support for certain functionalities that you might currently rely on in your Faces / CDI configuration.

  • You need to put your views under src/main/resources/META-INF/resources as Quarkus doesn't create a WAR and src/main/webapp is ignored!
  • Session replication / passivation / clustering is not supported by Quarkus
  • CDI Extensions are not supported by Quarkus reference: https://quarkus.io/guides/cdi-reference#build_time_apis

Native Image

When creating a GraalVM Native image you may need to change some of your code to be native friendly and some features may not be available to use in Native mode.

  1. FeedReader not supported. Rome library uses JDOM and I am too lazy to look into what needs to be done for a component that is lightly used.
  2. EL expressions which use reflection may run into issues with things like List size() or Enum name() as they are not bean compliant method names. You might need to change your EL expression or add helper code to achieve what you want.
  3. PDF Exporter / Barcode components use Java AWT you must make sure to include AWT and the .so libraries in your Dockerfile.
    You must also have fonts installs for PDF and AWT to work so this Dockerfile config below properly configures for native mode.
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.9

######################### Set up environment for POI ##########################
RUN microdnf update && microdnf install freetype fontconfig && microdnf clean all
######################### Set up environment for POI ##########################

WORKDIR /work/
RUN chown 1001 /work \
    && chmod "g+rwX" /work \
    && chown 1001:root /work
# Shared objects to be dynamically loaded at runtime as needed,
COPY --chown=1001:root target/*.properties target/*.so /work/
COPY --chown=1001:root target/*-runner /work/application
# Permissions fix for Windows
RUN chmod "ugo+x" /work/application
EXPOSE 8080
USER 1001

CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]

Uber Jar

When compiling the final artifact of your application, make sure in your application.properties file NOT to include the following line:

quarkus.package.type=uber-jar

The Myfaces Quarkus extension does not support uber-jar packaging at the moment, you can track the issue here: https://issues.apache.org/jira/browse/MYFACES-4427

HV000250: Uninitialized locale

If you see the error HV000250: Uninitialized locale: en_US. Please register your locale as a locale to initialize when initializing your ValidatorFactory. then you need to add these lines to your application.properties to register the Hibernate Validator languages.

# default bean validation locale
quarkus.default-locale=en
# The list of all the supported MyFaces locales
quarkus.locales=ar,ca,cs,de,en,es,fr,it,ja,mt,nl,pl,pt,pt_BR,ru,sk,uk,zh_CN,zh_HK,zh_TW

Dev mode mvn quarkus:dev

Running mvn quarkus:dev can have the following issues especially after triggering a hot reload.

Slowness

While running your application in dev mode you might notice it feels slower in certain cases. Things like changing pages in datatables, opening dialogs, and other cases. This is normal, HTTP requests in dev mode are usually slower, but its nothing to worry about, when running in production this does not happen.

<p:dataExporter/> exports multiple duplicate files

sometimes you may notice that when you click on a button/link that uses a p:dataExporter, multiple duplicate files will be exported. This issue does not always happen, it only happens when you make a change to your code that causes Quarkus' live reload feature to trigger. For example if during development your application reloads 5 times (through the Quarkus live reload feature), then whenever you click a button/link with a p:dataExporter, you will get 5 duplicate files, if your application was reloaded 10 times, then you will get 10 duplicate files and so on. It's unclear at this point whether this is a Primefaces bug or Myfaces bug, but since Quarkus' live reload feature only exists in dev mode, this issue doesn't happen in production.

PrimeFaces.current().executeScript()

JS code executed from the bean the using PrimeFaces.current().executeScript() runs multiple times - Just like the issue with the <p:dataExporter>, this only happens in dev mode and the amount of times the JS code runs is equal to the amount of times your application was reloaded by quarkus live reload.

Occasional ViewExpiredException

Occasional "ViewExpiredException: View "page.xhtml" could not be restored" when you make a change to your code that causes Quarkus' live reload feature to reload your application, pages that you have opened on browser will have expired, which is normal and that is what this message means. However, under some rare scenarios (unclear which ones at this point), sometimes right after your application is done being reloaded after you refresh the page you have opened in the browser, you may get this same exception again a few moments later. This doesn't happen very often and the reason behind it is unclear (also does not happen in production)

Occasional java.util.concurrent.RejectedExecutionException

This issue also seems to be rare. But usually happens after a reload is made and you refresh an expired page you have open in the browser. It's unclear what causes it, but refreshing the page again fixes the issue. Since Quarkus' live reload feature only exists in dev mode, this issue doesn't happen in production.

Occasional NullPointerException

NullPointerException: Cannot invoke "javax.enterprise.inject.spi.BeanManager.getBeans(java.lang.reflect.Type, java.lang.annotation.Annotation[])" because "bm" is null at org.apache.myfaces.cdi.util.CDIUtils.get(CDIUtils.java:49) Same as the error above, happens under rare cases after a reload is made and you refresh an expired page you have open in the browser. Refreshing the page again fixes the issue. Since Quarkus' live reload feature only exists in dev mode, this issue doesn't happen in production.


Clone this wiki locally