0 Replies Latest reply on Nov 23, 2010 10:59 AM by ihrytsyuk

    [ClassLoader] Cannot load compiled JasperReport from temp directory


      We use ear deployment with several wars inside it.


      Our report subsystem compiles jasper xml (*.jrxml) into *.jasper format on demand.

      As result we have:

      • initially *.jrxml files are located only in packed war
      • after application is deployed and we requested a report - *.jrxml and *.jasper are availble under JBOSS_HOME/server/default/tmp/


      We suppose compiled subreport should be loaded by next code:




      classLoader = Thread.currentThread().getContextClassLoader();
      if (classLoader != null) {
          url = classLoader.getResource(location);
      if (url == null) {
          classLoader = clazz.getClassLoader();
          if (classLoader == null) {
              url = clazz.getResource("/" + location);
          } else {
              url = classLoader.getResource(location);



      But actually it isn't.

      At the same time corresponding *.jrxml files can be loaded using above code snippet.


      Also we see that Thread.currentThread().getContextClassLoader() returns org.jboss.web.tomcat.service.WebCtxLoader$ENCLoader that has

      file:/home/ihrytsyuk/work/p/jboss/server/default/tmp/3j011-p7kxse-gguq8ayi-1-gguq941n-9r/p.war/WEB-INF/classes (a dir where *.jasper are located) among it's urllist.


      Could onyone suggest us why mentioned ClassLoaders cannot load compiled JasperReport?

      Any ideas how to resolve it?


      Thank you in advance,