[JBoss] JasperReport cannot find symbol JREvaluator in WildFly, works without server

Discussão em 'StackOverflow' iniciado por Stack, Novembro 10, 2024.

  1. Stack

    Stack Membro Participativo

    Recently I've been working on report generation with Jasper. I have created a simple program to test it and when running it via IDE it did work fine.

    Then I moved the (very short) class to WildFly sever application and despite having the exact same code and library generation fails with cannot find symbol. Those symbols it cannot find are JREvaluator, JRFillVariable as well as packages such as net.sf.jasperreports.engine

    In so far I have confirmed that:

    • Project builds (meaning those classes are visible for javac, but not jvm)
    • jasperreports-6.13.0.jar is added to war (it's present in /WEB-INF/lib folder alongside other libraries, like gson and hibernate
    • jasperreports-6.13.0.jar contains the missing classes

    It looks to me like the problem doesn't lie in library not being loaded or missing classes (because in testing environment it works), but like something was preventing JBoss class loader from loading those classes

    Attempted (and failed) solutions


    • Clean and Build


    • Adding -Djava.awt.headless=true to VM options - this did not changed anything


    • Adding -Djava.awt.headless=false to VM options - also didn't change a thing, but once caused NullPointerException inside jasperreport library. For testing program - worked in both cases


    • Adding commons-beanutils-1.9.4.jar, commons-digester-2.1.jar, commons-collections4-4.4.jar and commons-loggin-1.2.jar - with no changes


    • Adding jasper-compiler-jdt-5.5.23.jar - this caused a different error, namely NoSuchMethodError for org.eclipse.jdt.internal.compiler.ICompilerRequestor and few others. This library however should not be necessary as - from what I understand - jasperreport-6.13.0.jar already contains it's compiler and separate library for compiler is not required since a long time.

    What has not been attempted:


    Update: after looking at this answer and applying the suggestion the missing class was different. Which suggests that the dependencies inside jasperreport.jar are not being loaded properly

    Continue reading...

Compartilhe esta Página