Discussions

General J2EE: Problem in BIRT (Report ) when run in weblogic error is " org.mo

  1. hello everybody,
      I am facing a problem In BIRT a reporting tool I am wrote one jsp for display a report in pdf formate on web.
    when i run this jsp wblogic server gives a error ==
      "Org.mozilla.javascript.ImporterTopLevel.initStandardObjects(Lorg/mozilla/javascript/Context;Z)V "I am using a weblogic server. I attech my jsp code also, plz help me if any one know the solution

    and error show in weblogic console is

    java.lang.NoSuchMethodError: org.mozilla.javascript.ImporterTopLevel.initStandar
    dObjects(Lorg/mozilla/javascript/Context;Z)V
            at org.eclipse.birt.core.script.ScriptContext.<init>(ScriptContext.java:
    81)
            at org.eclipse.birt.report.engine.executor.ExecutionContext.<init>(Execu
    tionContext.java:248)
            at org.eclipse.birt.report.engine.api.impl.EngineTask.<init>(EngineTask.
    java:118)
            at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.<init>(RunAn
    dRenderTask.java:54)
            at org.eclipse.birt.report.engine.api.impl.ReportEngineHelper.createRunA
    ndRenderTask(ReportEngineHelper.java:215)
            at org.eclipse.birt.report.engine.api.ReportEngine.createRunAndRenderTas
    k(ReportEngine.java:258)
            at resources.jsp.Pdf.run(Pdf.java:81)
            at jsp_servlet._resources._jsp.__test._jspService(Test.jsp:123)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
            at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
    (ServletStubImpl.java:1006)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:419)
            at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
    pl.java:463)
            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
            at com.bea.wlw.netui.pageflow.PageFlowJspFilter.doFilter(PageFlowJspFilt
    er.java:261)
            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
    va:27)
            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
    n.run(WebAppServletContext.java:6724)
            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
    dSubject.java:321)
            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
    121)
            at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
    rvletContext.java:3764)
            at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
    pl.java:2644)
            at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    >



    ReportBIRT.jsp




        
       

     public void returnFile(String filename, OutputStream fout)
    throws FileNotFoundException, IOException
    {
    InputStream in = null;
    try
    {
    in = new BufferedInputStream(new FileInputStream(filename));
    byte[ ] buf = new byte[4 * 1024]; // 4K buffer
    int bytesRead;
    while ((bytesRead = in.read(buf)) != -1)
    {
    fout.write(buf, 0, bytesRead);
    }
    }
    finally
    {
    if (in != null) in.close( );
    }
    }


        
        
       
        response.setContentType("text/html");
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);


    HttpSession mysession=request.getSession(true);
    OutputStream out_frame = response.getOutputStream( );


    /*String reportName = request.getParameter("selectreport");
    System.out.println("reportName=="+reportName);
    String reportType = request.getParameter("selecttype");
    System.out.println("reportType=="+reportType);
    */

         String reportName = "C:/Documents and Settings/Administrator/workspace/My First Report/SubReport.rptdesign";
         String reportType ="PDF";
         
         InputStream fin = new FileInputStream(reportName);
         /*
    Vector reportFile = ReportEngineDatabaseLayer.downrpt(reportName);
    InputStream in=null;
    if (reportFile != null) {
    for(int j=0;j<reportFile.size();j++){
    Vector vModule = (Vector)reportFile.elementAt(j);
    in = (InputStream)vModule.elementAt(1);
    }
    }
    */

    boolean showInfo = false;
    HashMap params = new HashMap();
    String tfor = new String();
    String format ="";
    if(reportType.equals("HTML"))
    {
    format="html";
    System.out.println("HTML File");
    }

    else{
    format="pdf";
    response.setContentType("application/pdf");

    }

    Pdf.run( fin, params, format, showInfo);

    response.setContentType("application/pdf");

    String mmm="C:/diwakar.pdf";
    returnFile(mmm,out_frame);
  2. An alternative is...[ Go to top ]

    Hi;

    If you can't get BIRT working please take a look at Windward Reports

    thanks - dave