8 Replies Latest reply on Feb 18, 2013 5:56 PM by Pedro Hernán Quevedo Reyes

    trouble integrating jasperreports in jboss as 7

    Sascha Janz Master

      i tried to migrate my jboss seam 2.2 application to run on jboss as 7

       

      so far everything is running, despite of jasperreports which are compiled at  runtime, then i got the error package net.sf.jasperreports.engine does not exist

      in my depleoyed ear list i got  jasper*.jar , itext*.jar , jdt*.jar

       

      complete stacktrace is

       

       

      ) [rt.jar:1.6.0_26]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]

      at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.core.SynchronizationInterceptor.aroundInvoke(SynchronizationInterceptor.java:32) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103) [jboss-seam.jar:2.2.1.Final]

      at de.myapp.core.modules.anordnung.AnordnungView_$$_javassist_seam_17.getfile(AnordnungView_$$_javassist_seam_17.java) [workflow.jar:]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_26]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_26]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_26]

      at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_26]

      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:335) [jboss-el.jar:1.0_02.CR5]

      at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:348) [jboss-el.jar:1.0_02.CR5]

      at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58) [jboss-el.jar:1.0_02.CR5]

      at org.jboss.el.parser.AstValue.invoke(AstValue.java:96) [jboss-el.jar:1.0_02.CR5]

      at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) [jboss-el.jar:1.0_02.CR5]

      at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.navigation.Pages.callAction(Pages.java:704) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.navigation.Pages.preRender(Pages.java:331) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.jsf.SeamPhaseListener.preRenderPage(SeamPhaseListener.java:560) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.jsf.SeamPhaseListener.beforeRenderResponse(SeamPhaseListener.java:471) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:147) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:117) [jboss-seam.jar:2.2.1.Final]

      at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:214) [jsf-impl.jar:1.2_12-b01-FCS]

      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:96) [jsf-impl.jar:1.2_12-b01-FCS]

      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [jsf-impl.jar:1.2_12-b01-FCS]

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266) [jsf-api.jar:1.2_12-b01-FCS]

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.1.Final]

      at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]

      at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]

      at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]

      at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515) [richfaces-impl-3.3.3.Final.jar:3.3.3.Final]

      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) [jboss-seam.jar:2.2.1.Final]

      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) [jboss-seam.jar:2.2.1.Final]

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:397) [jbossweb-7.0.13.Final.jar:]

      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

      at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

      Caused by: net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:

      L:\Programme\Server\jboss-as-7.1.1.Final\bin\Anordnung_1332934449376_26918.java:4: package net.sf.jasperreports.engine does not exist

      import net.sf.jasperreports.engine.*;

      ^

        • 1. Re: trouble integrating jasperreports in jboss as 7
          Sascha Janz Master

          it seems to be a classloader problem.

           

          the error occurs when jdt-compiler.jar is missing

           

          so i defined module like

           


          <module xmlns="urn:jboss:module:1.1" name="net.sf.jasperreports">
              <properties>
                  <property name="jboss.api" value="private"/>
              </properties>

              <resources>
                  <resource-root path="jasperreports-3.6.0.jar"/>
                  <resource-root path="commons-digester-1.8.jar"/>
                  <resource-root path="itext.jar"/>
                   <!-- Insert resources here -->
              </resources>

              <dependencies>
                  <module name="org.apache.xerces"/>
                  <module name="org.apache.commons.collections"/>
                  <module name="org.apache.commons.logging"/>
                  <module name="org.apache.commons.beanutils"/>
                  <module name="org.eclipse.jdt"/>
                  <module name="sun.jdk" />
                 
              </dependencies>
          </module>

           

           

          and dependency

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

          <

           

           

          jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"

          >

           

           

          <deployment

          >

           

           

          <exclusions

          >

           

           

          <module name="org.hibernate" slot="main"

          />

           

           

          </exclusions

          >

           

           

          <dependencies>

           

          <module name="org.apache.log4j" export="true"

          />

           

           

          <module name="org.dom4j" export="true"

          />

           

           

          <module name="org.apache.commons.logging" export="true"

          />

           

           

          <module name="org.apache.commons.collections" export="true"

          />

           

           

          <module name="javax.faces.api" slot="1.2.12" export="true"

          />

           

           

          <module name="com.sun.jsf-impl" slot="1.2.12" export="true"/>

           

          <module name="org.slf4j" export="true"

          />

           

           

          <module name="sun.jdk" export="true"

          />

           

           

          <module name="org.eclipse.jdt" export="true"

          />

           

           

          <module name="net.sf.jasperreports" export="true"

          />

           

           

          </dependencies

          >

           

           

          </deployment

          >

           

           

          <sub-deployment name="2csoaworkflow.war">

           

           

          <exclusions

          >

           

           

           

          <module name="javax.faces.api" slot="main"

          />

           

           

           

          <module name="com.sun.jsf-impl" slot="main"

          />

           

           

           

          </exclusions

          >

           

           

           

          <dependencies

          >

           

           

           

          <module name="javax.faces.api" slot="1.2.12"

          />

           

           

           

          <module name="com.sun.jsf-impl" slot="1.2.12"

          />

           

           

          <module name="net.sf.jasperreports" export="true"

          />

           

           

          <module name="org.eclipse.jdt" export="true"

          />

           

           

          </dependencies

          >

           

           

          </sub-deployment>

           

          <sub-deployment name="2csoaworkflow.jar"

          >

           

           

          <exclusions

          >

           

           

          <module name="org.hibernate" slot="main"

          />

           

           

          </exclusions

          >

           

           

          <dependencies

          >

           

           

          <module name="net.sf.jasperreports" export="true"

          />

           

           

          <module name="org.eclipse.jdt" export="true"

          />

           

           

          </dependencies

          >

           

           

          </sub-deployment

          >

          </

           

          jboss-deployment-structure

          >

           

            

           

          but still the same....

          • 2. Re: trouble integrating jasperreports in jboss as 7
            Sascha Janz Master

            i tried  to make the jdt-compiler.jar availiable as a global module by adding

             

                    <subsystem xmlns="urn:jboss:domain:ee:1.0">
                        <global-modules>
                            <module name="org.eclipse.jdt" slot="main"/>
                        </global-modules>
                    </subsystem>

            to standalone.xml

             

            but still got the same error

            • 3. Re: trouble integrating jasperreports in jboss as 7
              Wolfgang Knauf Master

              Hi Sascha,

               

              would it help to pre-compile the JasperReports and just deloy the ".jasper" files to JBoss?  This way, you would avoid the current problem, and performance should be better ;-)

               

              Best regards

               

              Wolfgang

              • 4. Re: trouble integrating jasperreports in jboss as 7
                Newbie

                I have the same problem.

                Someone has solution ?

                • 5. Re: trouble integrating jasperreports in jboss as 7
                  Wolfgang Knauf Master

                  Hi Erenildo Rios,

                   

                  did you try the "precompile" approach?

                   

                  Best regards

                   

                  Wolfgang

                  • 6. Re: trouble integrating jasperreports in jboss as 7
                    Vladimir Zhuravlevich Newbie

                    Hi,

                     

                    After the adding jboss module with jasperreports jar I have seen that JasperCompileManager tries to use only this classpath: 'JBOSS_HOME/jboss-modules.jar'

                    I fixed this via appending to classpath full path to jasperreports jar that was defined through jboss module.

                     

                    Here is a sample how it could be done:

                         .....

                         final JasperReportsContext jasperReportsContext = DefaultJasperReportsContext.getInstance();

                         final String compilerClassPath = jasperReportsContext.getProperty(JRCompiler.COMPILER_CLASSPATH);

                         final String jasperreportsJar = jasperReportsContext.getClass().getProtectionDomain().getCodeSource().getLocation().getPath().replaceAll("file:", "").replace("!/", "");

                     

                         if (compilerClassPath.indexOf(jasperreportsJar) < 0){

                            jasperReportsContext.setProperty(JRCompiler.COMPILER_CLASSPATH, compilerClassPath + File.pathSeparator + jasperreportsJar);

                         }

                     

                         JasperCompileManager.compileReportToFile....

                    • 7. Re: trouble integrating jasperreports in jboss as 7
                      ziul Newbie

                      I got jasper 4.0.2 as a module working like this:

                       

                      <module xmlns="urn:jboss:module:1.1" name="net.sourceforge.jasperreports">

                          <resources>

                              <resource-root path="commons-javaflow-20060411.jar"/>

                              <resource-root path="iText-2.1.0.jar"/>

                              <resource-root path="jasperreports-4.0.2.jar"/>

                              <resource-root path="jcommon-1.0.15.jar"/>

                              <resource-root path="jfreechart-1.0.14.jar"/>

                          </resources>

                          <dependencies>

                              <module name="javax.api"/>

                              <module name="org.apache.commons.beanutils"/>

                              <module name="org.apache.commons.collections"/>

                              <module name="org.apache.commons.digester" slot="1.7"/>

                              <module name="org.apache.commons.logging"/>

                          </dependencies>

                      </module>

                      • 8. Re: trouble integrating jasperreports in jboss as 7
                        Pedro Hernán Quevedo Reyes Newbie

                        I need help to install the following:
                        JBoss AS 7
                        JasperReport Server (Integrate Jboss)
                        Oracle 11g Data Store and Mysql
                        Centos 6.3 OS
                        Migrating to new server from:
                        JBoss 4.2 JasperReport

                        Maybe remote access or I follow the steps that I suggest.
                        I have already installed JBoss AS 7 with datastore for Oracle and Mysql
                        Now I have to install and integrate JasperReport Server to JBoss AS 7 and migrate what is on a server before the new installation on another server.
                        I have not much $, but could reach an agreement