10 Replies Latest reply on May 19, 2010 7:52 PM by Marcelo Nunes

    Birt with seam No application context active

    marcelo gar Newbie
      Hi, sorry for my english.

      I have a birt report, I configured it with viewer, which works fine until i tries to access to data.  If you write code in the same reoprt, to access data, it return a exception, which I think, it cannot access to seam context.

      My birt report:

      <?xml version="1.0" encoding="UTF-8"?>
      <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.17" id="1">
          <property name="createdBy">Eclipse BIRT Designer Version 2.3.2.r232_20090202 Build &lt;2.3.2.v20090218-0730></property>
          <property name="units">in</property>
          <data-sources>
              <script-data-source name="CustomersFavorite" id="2"/>
          </data-sources>
          <data-sets>
              <script-data-set name="Favorite" id="3">
                  <list-property name="resultSetHints">
                      <structure>
                          <property name="position">1</property>
                          <property name="name">Name</property>
                      </structure>
                      <structure>
                          <property name="position">2</property>
                          <property name="name">Id</property>
                      </structure>
                  </list-property>
                  <list-property name="columnHints">
                      <structure>
                          <property name="columnName">Name</property>
                      </structure>
                      <structure>
                          <property name="columnName">Id</property>
                      </structure>
                  </list-property>
                  <structure name="cachedMetaData">
                      <list-property name="resultSet">
                          <structure>
                              <property name="position">1</property>
                              <property name="name">Name</property>
                          </structure>
                          <structure>
                              <property name="position">2</property>
                              <property name="name">Id</property>
                          </structure>
                      </list-property>
                  </structure>
                  <property name="dataSource">CustomersFavorite</property>
                  <method name="open"><![CDATA[var reports = Packages.org.jboss.seam.Component.getInstance("sampleReportList", true);
      reportsIterator = reports.getUserList().listIterator();]]></method>
                  <method name="fetch"><![CDATA[if( !( reportsIterator.hasNext()) ){
              return( false );
      }

      var report = reportsIterator.next();

      row["Name"] = report.name;
      row["Id"] = new Packages.java.lang.Long(report.id);

      return ( true );]]></method>
                  <method name="close"><![CDATA[reportsIterator = null;]]></method>
              </script-data-set>
          </data-sets>
          <page-setup>
              <simple-master-page name="Simple Master Page" id="4">
                  <page-footer>
                      <text id="5">
                          <property name="contentType">html</property>
                          <text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
                      </text>
                  </page-footer>
              </simple-master-page>
          </page-setup>
          <body>
              <label id="46">
                  <property name="backgroundAttachment">scroll</property>
                  <property name="backgroundColor">silver</property>
                  <property name="textAlign">center</property>
                  <text-property name="text">Reportes de usuarios</text-property>
              </label>
              <table id="19">
                  <property name="width">100%</property>
                  <property name="dataSet">Favorite</property>
                  <list-property name="boundDataColumns">
                      <structure>
                          <property name="name">Name</property>
                          <expression name="expression">dataSetRow["Name"]</expression>
                      </structure>
                      <structure>
                          <property name="name">Id</property>
                          <expression name="expression">dataSetRow["Id"]</expression>
                      </structure>
                  </list-property>
                  <property name="pageBreakInterval">50</property>
                  <column id="22">
                      <property name="width">0.7368421053in</property>
                  </column>
                  <column id="20">
                      <property name="width">1.458in</property>
                      <property name="repeat">1</property>
                  </column>
                  <header>
                      <row id="23">
                          <property name="backgroundColor">#FF8040</property>
                          <cell id="28">
                              <label id="29">
                                  <property name="backgroundColor">#FF8040</property>
                                  <property name="textAlign">center</property>
                                  <text-property name="text">Id</text-property>
                              </label>
                          </cell>
                          <cell id="24">
                              <label id="25">
                                  <property name="backgroundColor">#FF8040</property>
                                  <property name="textAlign">center</property>
                                  <text-property name="text">Nombre</text-property>
                              </label>
                          </cell>
                      </row>
                  </header>
                  <detail>
                      <row id="30">
                          <list-property name="highlightRules">
                              <structure>
                                  <property name="operator">eq</property>
                                  <property name="backgroundColor">#E4B07C</property>
                                  <property name="color">#000000</property>
                                  <expression name="testExpr">row[0]%2</expression>
                                  <simple-property-list name="value1">
                                      <value>0</value>
                                  </simple-property-list>
                              </structure>
                          </list-property>
                          <cell id="35">
                              <data id="36">
                                  <property name="resultSetColumn">Id</property>
                              </data>
                          </cell>
                          <cell id="31">
                              <data id="32">
                                  <property name="resultSetColumn">Name</property>
                              </data>
                          </cell>
                      </row>
                  </detail>
                  <footer>
                      <row id="37">
                          <cell id="40"/>
                          <cell id="38"/>
                      </row>
                  </footer>
              </table>
          </body>
      </report>

      The exception:

      21:01:56,663 ERROR [STDERR] 18-may-2009 21:01:56 org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor handleJS
      ADVERTENCIA: A BIRT exception occurred: There are errors evaluating script "__bm_OPEN()":
      Wrapped java.lang.IllegalStateException: No application context active (<inline>#2).. See next exception for more information.
      There are errors evaluating script "__bm_OPEN()":
      Wrapped java.lang.IllegalStateException: No application context active (<inline>#2).
      org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred: There are errors evaluating script "__bm_OPEN()":
      Wrapped java.lang.IllegalStateException: No application context active (<inline>#2).. See next exception for more information.
      There are errors evaluating script "__bm_OPEN()":
      Wrapped java.lang.IllegalStateException: No application context active (<inline>#2).
              at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:118)
              at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:717)
              at org.eclipse.birt.data.engine.script.JSMethodRunner.runScript(JSMethodRunner.java:76)
              at org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor.handleJS(DtEScriptExecutor.java:71)
              at org.eclipse.birt.report.engine.script.internal.DataSetScriptExecutor.handleJS(DataSetScriptExecutor.java:196)
              at org.eclipse.birt.report.engine.script.internal.ScriptDataSetScriptExecutor.handleOpen(ScriptDataSetScriptExecutor.java:77)
              at org.eclipse.birt.data.engine.impl.ScriptDataSetRuntime.open(ScriptDataSetRuntime.java:79)
              at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor$CustomDataSet.open(PreparedScriptDSQuery.java:244)
              at org.eclipse.birt.data.engine.impl.PreparedScriptDSQuery$ScriptDSQueryExecutor.executeOdiQuery(PreparedScriptDSQuery.java:220)
              at org.eclipse.birt.data.engine.impl.QueryExecutor.execute(QueryExecutor.java:945)
              at org.eclipse.birt.data.engine.impl.ServiceForQueryResults.executeQuery(ServiceForQueryResults.java:233)
              at org.eclipse.birt.data.engine.impl.QueryResults.getResultIterator(QueryResults.java:160)
              at org.eclipse.birt.report.engine.data.dte.QueryResultSet.<init>(QueryResultSet.java:92)
              at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:129)
              at org.eclipse.birt.report.engine.data.dte.DataGenerationEngine.doExecuteQuery(DataGenerationEngine.java:79)
              at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:253)
              at org.eclipse.birt.report.engine.executor.ExecutionContext.executeQuery(ExecutionContext.java:1755)
              at org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:77)
              at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62)
              at org.eclipse.birt.report.engine.internal.executor.wrap.WrappedReportItemExecutor.execute(WrappedReportItemExecutor.java:45)
              at org.eclipse.birt.report.engine.internal.executor.emitter.ReportItemEmitterExecutor.execute(ReportItemEmitterExecutor.java:45)
              at org.eclipse.birt.report.engine.internal.executor.dup.SuppressDuplicateItemExecutor.execute(SuppressDuplicateItemExecutor.java:42)
              at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:63)
              at org.eclipse.birt.report.engine.layout.html.HTMLPageLM.layout(HTMLPageLM.java:90)
              at org.eclipse.birt.report.engine.layout.html.HTMLReportLayoutEngine.layout(HTMLReportLayoutEngine.java:101)
              at org.eclipse.birt.report.engine.presentation.ReportDocumentBuilder.build(ReportDocumentBuilder.java:211)
              at org.eclipse.birt.report.engine.api.impl.RunTask.doRun(RunTask.java:237)
              at org.eclipse.birt.report.engine.api.impl.RunTask.run(RunTask.java:90)
              at org.eclipse.birt.report.service.ReportEngineService.runReport(ReportEngineService.java:1246)
              at org.eclipse.birt.report.service.BirtViewerReportService.runReport(BirtViewerReportService.java:155)
              at org.eclipse.birt.report.service.actionhandler.BirtRunReportActionHandler.__execute(BirtRunReportActionHandler.java:81)
              at org.eclipse.birt.report.service.actionhandler.BirtGetPageActionHandler.__checkDocumentExists(BirtGetPageActionHandler.java:58)
              at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.prepareParameters(AbstractGetPageActionHandler.java:119)
              at org.eclipse.birt.report.service.actionhandler.AbstractGetPageActionHandler.__execute(AbstractGetPageActionHandler.java:104)
              at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
              at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
              at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
              at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPage(BirtDocumentProcessor.java:87)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
              at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
              at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
              at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
              at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
              at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
              at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
              at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
              at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
              at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
              at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
              at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
              at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.eclipse.birt.report.filter.ViewerFilter.doFilter(ViewerFilter.java:68)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
              at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
              at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
              at org.ajax4jsf.webapp.BaseFilter.
      21:01:56,665 ERROR [STDERR] doFilter(BaseFilter.java:517)
              at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
              at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
              at java.lang.Thread.run(Thread.java:619)
      Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "__bm_OPEN()":
      Wrapped java.lang.IllegalStateException: No application context active (<inline>#2).
              at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:307)
              at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:268)
              at org.eclipse.birt.data.engine.script.ScriptEvalUtil.evaluateJSAsExpr(ScriptEvalUtil.java:713)
              ... 102 more
      Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.IllegalStateException: No application context active (<inline>#2)
              at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1757)
              at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:170)
              at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
              at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:76)
              at org.mozilla.javascript.gen.c6._c1(<inline>:2)
              at org.mozilla.javascript.gen.c6.call(<inline>)
              at org.mozilla.javascript.optimizer.OptRuntime.callName0(OptRuntime.java:108)
              at org.mozilla.javascript.gen.c7._c0(<inline>:1)
              at org.mozilla.javascript.gen.c7.call(<inline>)
              at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:393)
              at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2834)
              at org.mozilla.javascript.gen.c7.call(<inline>)
              at org.mozilla.javascript.gen.c7.exec(<inline>)
              at org.eclipse.birt.core.script.ScriptContext.eval(ScriptContext.java:302)
              ... 104 more
      Caused by: java.lang.IllegalStateException: No application context active
              at org.jboss.seam.Component.forName(Component.java:1810)
              at org.jboss.seam.Component.getInstance(Component.java:1860)
              at org.jboss.seam.Component.getInstance(Component.java:1843)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
              ... 116 more
      21:01:56,720 ERROR [STDERR] 18-may-2009 21:01:56 org.eclipse.birt.report.engine.script.internal.DtEScriptExecutor handleJS
      ADVERTENCIA: A BIRT exception occurred: There are errors evaluating script "__bm_FETCH()":
      ReferenceError: "reportsIterator" is not defined. (<inline>#2).. See next exception for more information.
      There are errors evaluating script "__bm_FETCH()":
      ReferenceError: "reportsIterator" is not defined. (<inline>#2).
      org.eclipse.birt.data.engine.core.DataException: A BIRT exception occurred: There are errors evaluating script "__bm_FETCH()":
      ReferenceError: "reportsIterator" is not defined. (<inline>#2).. See next exception for more information.
      There are errors evaluating script "__bm_FETCH()":
      ReferenceError: "reportsIterator" is not defined. (<inline>#2).
              at org.eclipse.birt.data.engine.core.DataException.wrap(DataException.java:118)

      Please help!
      Thanks you very much||
      ``
        • 1. Re: Birt with seam No application context active
          Stuart Douglas Master

          Please post the code you are using to run the report.

          • 2. Re: Birt with seam No application context active
            marcelo gar Newbie
            Caller:

            <s:button id="report" value="Report" view="/page/user/userBirt.xhtml" />

            Called:

            <?xml version="1.0" encoding="ISO-8859-1"?>
            <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                                         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib"
                 xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich"
                 xmlns:comp="http://www.yellow.com/facelets/components" xmlns:c="http://java.sun.com/jstl/core"
                 xmlns:a4j="http://richfaces.org/a4j" xmlns:birt="http://jboss.com/products/seam/birt">

                 <birt:birt designType="frameset" designName="sample.rptdesign" title="JBoss Birt Test" />

            </ui:composition>
            • 3. Re: Birt with seam No application context active
              Thiago Matos Newbie

              Estou com o mesmo problema e gostaria de saber se vc conseguiu a solução.

              • 4. Re: Birt with seam No application context active
                Ronald van Kuijk Apprentice

                Luckily for me there are many ways to get this translated on the net. It's close to Spanish, but it isn't: What he says is:


                I'm having the same problem and would like to know if you got the solution.

                • 5. Re: Birt with seam No application context active
                  gonzalad Apprentice

                  Try adding this line in your components.xml file, and restart your webapp :




                  <web:context-filter regex-url-pattern="/frameset.*|/document.*|/download.*|/parameter.*|/extract.*|/run.*|/preview.*|/output.*|/embed.*"/>



                  See also ReplacingServletsWithSeamResources for more detail about web:context-filter.

                  • 6. Re: Birt with seam No application context active
                    Marcelo Nunes Newbie

                    The above technique worked for me with small modifications:


                    components.xml:

                    I used the above line, changing it to a url-pattern instead of the regex one, with absolute paths.


                    <web:context-filter url-pattern="/reports/*|...



                    Now, some more steps:


                    1) Copy the org.jboss.tools.birt.oda jar files to

                    WebContent\WEB-INF\platform\plugins


                    If you installed JBossTools with birt integration you have these jars sitting in eclipse plugin folder.


                    2) Copy the seam jar file to the scriplib folder as defined in web.xml.


                    3) Edit your filter declarations in web.xml (the pdf filter and servlet part) so they appear before the seam filters. This can save you a lot of headache.


                    4) Clean your project, publish, rise your hands and say your prayers!

                    • 7. Re: Birt with seam No application context active
                      Diego Di Newbie

                      Marcelo Nunes wrote on Sep 24, 2009 18:52:


                      The above technique worked for me with small modifications:

                      components.xml:

                      I used the above line, changing it to a url-pattern instead of the regex one, with absolute paths.

                      <web:context-filter url-pattern="/reports/*|...



                      Now, some more steps:

                      1) Copy the org.jboss.tools.birt.oda jar files to
                      WebContent\WEB-INF\platform\plugins


                      If you installed JBossTools with birt integration you have these jars sitting in eclipse plugin folder.

                      2) Copy the seam jar file to the scriplib folder as defined in web.xml.

                      3) Edit your filter declarations in web.xml (the pdf filter and servlet part) so they appear before the seam filters. This can save you a lot of headache.

                      4) Clean your project, publish, rise your hands and say your prayers!


                      Marcelo, could you please post your web.xml and components.xml?
                      I am trying to access seam context from within the BIRT report viewer, and NoApplicationContextActive still appears.


                      Thanks in advance.

                      • 8. Re: Birt with seam No application context active
                        Marcelo Nunes Newbie

                        Sure. Sorry for the delayed response!


                        Web.xml


                        <?xml version="1.0" encoding="UTF-8"?>
                        <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
                          <display-name>base</display-name>
                          <welcome-file-list>
                            <welcome-file>index.html</welcome-file>
                            <welcome-file>index.htm</welcome-file>
                            <welcome-file>index.jsp</welcome-file>
                            <welcome-file>default.html</welcome-file>
                            <welcome-file>default.htm</welcome-file>
                            <welcome-file>default.jsp</welcome-file>
                          </welcome-file-list>
                          <description>Deployment Descriptor for BIRT Viewer. Please check and specify the following settings.</description>
                          <context-param>
                            <description>If usr can only access the reprot resources under working folder. Default is false</description>
                            <param-name>WORKING_FOLDER_ACCESS_ONLY</param-name>
                            <param-value>false</param-value>
                          </context-param>
                          <context-param>
                            <description>The generated document files directory. Default to ${Context Root}/documents</description>
                            <param-name>BIRT_VIEWER_DOCUMENT_FOLDER</param-name>
                            <param-value>documents</param-value>
                          </context-param>
                          <context-param>
                            <description>If turn on the function that supports print on the server side(ON|OFF).Default to on.</description>
                            <param-name>BIRT_VIEWER_PRINT_SERVERSIDE</param-name>
                            <param-value>ON</param-value>
                          </context-param>
                          <context-param>
                            <description>Memory size(MB) for creating cube.</description>
                            <param-name>BIRT_VIEWER_CUBE_MEMORY_SIZE</param-name>
                            <param-value></param-value>
                          </context-param>
                          <context-param>
                            <description>Directory to store all birt report script libraries (JARs). Default to ${Context Root}/scriptlib</description>
                            <param-name>BIRT_VIEWER_SCRIPTLIB_DIR</param-name>
                            <param-value>scriptlib</param-value>
                          </context-param>
                          <context-param>
                            <description>If always overwrite generated document file. Default to true</description>
                            <param-name>BIRT_OVERWRITE_DOCUMENT</param-name>
                            <param-value>true</param-value>
                          </context-param>
                          <context-param>
                            <description>Output images/charts directory. Default to ${Context Root}/report/images</description>
                            <param-name>BIRT_VIEWER_IMAGE_DIR</param-name>
                            <param-value>report/images</param-value>
                          </context-param>
                          <context-param>
                            <description>BIRT viewer extended configuration file</description>
                            <param-name>BIRT_VIEWER_CONFIG_FILE</param-name>
                            <param-value>WEB-INF/viewer.properties</param-value>
                          </context-param>
                          <context-param>
                            <description>Dataset rows limited when preview report. Default to return all rows</description>
                            <param-name>BIRT_VIEWER_MAX_ROWS</param-name>
                            <param-value></param-value>
                          </context-param>
                          <context-param>
                            <description>Cube fetch row levels limited when preview report (Only support to preview a report design file using preview pattern). Default to return all levels</description>
                            <param-name>BIRT_VIEWER_MAX_CUBE_ROWLEVELS</param-name>
                            <param-value></param-value>
                          </context-param>
                          <context-param>
                            <description>Default locale setting</description>
                            <param-name>BIRT_VIEWER_LOCALE</param-name>
                            <param-value>en-US</param-value>
                          </context-param>
                          <context-param>
                            <description>Cube fetch column levels limited when preview report (Only support to preview a report design file using preview pattern). Default to return all levels</description>
                            <param-name>BIRT_VIEWER_MAX_CUBE_COLUMNLEVELS</param-name>
                            <param-value></param-value>
                          </context-param>
                          <context-param>
                            <description>Report resources(design files or document files) directory for preview. Default to ${Context Root}</description>
                            <param-name>BIRT_VIEWER_WORKING_FOLDER</param-name>
                            <param-value></param-value>
                          </context-param>
                          <context-param>
                            <description>Report Engine logs directory. Default to ${Context Root}/logs</description>
                            <param-name>BIRT_VIEWER_LOG_DIR</param-name>
                            <param-value>logs</param-value>
                          </context-param>
                          <context-param>
                            <description>Resource location directory(library files, images files or others). Default to ${Context Root}</description>
                            <param-name>BIRT_RESOURCE_PATH</param-name>
                            <param-value></param-value>
                          </context-param>
                          <context-param>
                            <description>If force optimized HTML output.Default to true</description>
                            <param-name>HTML_ENABLE_AGENTSTYLE_ENGINE</param-name>
                            <param-value>true</param-value>
                          </context-param>
                          <context-param>
                            <description>Report engine log level.( ALL|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST|OFF )</description>
                            <param-name>BIRT_VIEWER_LOG_LEVEL</param-name>
                            <param-value>WARNING</param-value>
                          </context-param>
                          <listener>
                            <listener-class>org.eclipse.birt.report.listener.ViewerHttpSessionListener</listener-class>
                          </listener>
                          <listener>
                            <listener-class>org.eclipse.birt.report.listener.ViewerServletContextListener</listener-class>
                          </listener>
                          <servlet>
                            <servlet-name>EngineServlet</servlet-name>
                            <servlet-class>org.eclipse.birt.report.servlet.BirtEngineServlet</servlet-class>
                            <load-on-startup>1</load-on-startup>
                          </servlet>
                          <servlet>
                            <servlet-name>ViewerServlet</servlet-name>
                            <servlet-class>org.eclipse.birt.report.servlet.ViewerServlet</servlet-class>
                            <load-on-startup>1</load-on-startup>
                          </servlet>
                          <servlet-mapping>
                            <servlet-name>ViewerServlet</servlet-name>
                            <url-pattern>/frameset</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>EngineServlet</servlet-name>
                            <url-pattern>/document</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>EngineServlet</servlet-name>
                            <url-pattern>/download</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>EngineServlet</servlet-name>
                            <url-pattern>/parameter</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>EngineServlet</servlet-name>
                            <url-pattern>/extract</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>ViewerServlet</servlet-name>
                            <url-pattern>/run</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>EngineServlet</servlet-name>
                            <url-pattern>/preview</url-pattern>
                          </servlet-mapping>
                          <servlet-mapping>
                            <servlet-name>EngineServlet</servlet-name>
                            <url-pattern>/output</url-pattern>
                          </servlet-mapping>
                          <filter>
                            <filter-name>ViewerFilter</filter-name>
                            <filter-class>org.eclipse.birt.report.filter.ViewerFilter</filter-class>
                          </filter>
                          <filter-mapping>
                            <filter-name>ViewerFilter</filter-name>
                            <servlet-name>EngineServlet</servlet-name>
                          </filter-mapping>
                          <filter-mapping>
                            <filter-name>ViewerFilter</filter-name>
                            <servlet-name>ViewerServlet</servlet-name>
                          </filter-mapping>
                          <servlet>
                            <servlet-name>Faces Servlet</servlet-name>
                            <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                            <load-on-startup>1</load-on-startup>
                          </servlet>
                          <servlet-mapping>
                            <servlet-name>Faces Servlet</servlet-name>
                            <url-pattern>*.seam</url-pattern>
                          </servlet-mapping>
                          <context-param>
                            <param-name>org.richfaces.SKIN</param-name>
                            <param-value>blueSky</param-value>
                          </context-param>
                          <listener>
                            <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
                          </listener>
                          <filter>
                            <filter-name>Seam Filter</filter-name>
                            <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
                          </filter>
                          <filter-mapping>
                            <filter-name>Seam Filter</filter-name>
                            <url-pattern>/*</url-pattern>
                          </filter-mapping>
                          <servlet>
                            <servlet-name>Seam Resource Servlet</servlet-name>
                            <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
                          </servlet>
                          <servlet-mapping>
                            <servlet-name>Seam Resource Servlet</servlet-name>
                            <url-pattern>/seam/resource/*</url-pattern>
                          </servlet-mapping>
                          <context-param>
                            <param-name>facelets.DEVELOPMENT</param-name>
                            <param-value>true</param-value>
                          </context-param>
                          <context-param>
                            <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                            <param-value>.xhtml</param-value>
                          </context-param>
                          <security-constraint>
                            <display-name>Restrict raw XHTML Documents</display-name>
                            <web-resource-collection>
                              <web-resource-name>XHTML</web-resource-name>
                              <url-pattern>*.xhtml</url-pattern>
                            </web-resource-collection>
                            <auth-constraint/>
                          </security-constraint>
                          <servlet>
                            <servlet-name>JBoss BIRT Servlet</servlet-name>
                            <servlet-class>org.jboss.tools.birt.servlet.JBossBirtServlet</servlet-class>
                          </servlet>
                          <servlet-mapping>
                            <servlet-name>JBoss BIRT Servlet</servlet-name>
                            <url-pattern>/embed</url-pattern>
                          </servlet-mapping>
                        </web-app>
                        


                        • 9. Re: Birt with seam No application context active
                          Marcelo Nunes Newbie

                          And NO modifications to components.xml AFAIK. Here it is, for sake of completeness...


                          <?xml version="1.0" encoding="UTF-8"?>
                          <components xmlns="http://jboss.com/products/seam/components"
                                      xmlns:core="http://jboss.com/products/seam/core"
                                      xmlns:persistence="http://jboss.com/products/seam/persistence"
                                      xmlns:drools="http://jboss.com/products/seam/drools"
                                      xmlns:bpm="http://jboss.com/products/seam/bpm"
                                      xmlns:security="http://jboss.com/products/seam/security"
                                      xmlns:mail="http://jboss.com/products/seam/mail"
                                      xmlns:web="http://jboss.com/products/seam/web"
                                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                                      xsi:schemaLocation=
                                          "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                                           http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                                           http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                                           http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                                           http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                                           http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                                           http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                                           http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">
                          
                             <core:init debug="true" jndi-pattern="@jndiPattern@"/>
                          
                             <core:manager concurrent-request-timeout="500"
                                           conversation-timeout="120000"
                                           conversation-id-parameter="cid"
                                           parent-conversation-id-parameter="pid"/>
                          
                             <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
                             <web:hot-deploy-filter url-pattern="*.seam"/>
                          
                             <persistence:entity-manager-factory name="entityManagerFactory"
                                                persistence-unit-name="base"/>
                          
                             <persistence:managed-persistence-context name="entityManager" auto-create="true"
                                                    entity-manager-factory="#{entityManagerFactory}"/>
                          
                             <drools:rule-base name="securityRules">
                                <drools:rule-files><value>/security.drl</value></drools:rule-files>
                             </drools:rule-base>
                          
                             <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
                          
                             <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
                          
                             <event type="org.jboss.seam.security.notLoggedIn">
                                <action execute="#{redirect.captureCurrentView}"/>
                             </event>
                             <event type="org.jboss.seam.security.loginSuccessful">
                                <action execute="#{redirect.returnToCapturedView}"/>
                             </event>
                          
                             <mail:mail-session host="localhost" port="25"/>
                          
                             <!-- For use with jBPM pageflow or process management -->
                             <!--
                             <bpm:jbpm>
                                <bpm:process-definitions></bpm:process-definitions>
                                <bpm:pageflow-definitions></bpm:pageflow-definitions>
                             </bpm:jbpm>
                             -->
                          
                          </components>
                          



                          • 10. Re: Birt with seam No application context active
                            Marcelo Nunes Newbie

                            These are the general guidelines I usually follow:


                            In Eclipse:


                            Import BIRT runtime
                            
                            Birt sometimes creates the birt folder in "/WebContent/webcontent/birt".
                            Move it to /WebContent/birt.
                            
                            - In web.xml ensure that the birt filters go before the seam filters (See earlier post)
                            
                            - Copy the org.jboss.tools.birt.oda jar files to the WebContent\WEB-INF\platform\plugins folder.
                            You can find them in your eclipse plugins folder after installing jBossTools.
                            
                            - Put the following line in persistence.xml:
                            <property name="hibernate.session_factory_name" value="java:/xxxxxx"/>
                            
                              where 'xxxxxx' is your project name
                            
                            - Insert the following line at the end of platform\configuration\config.ini file:
                            osgi.parentClassloader=fwk (please, without any blank lines at the end, saves the headache)