<p>I'm new to BIRT and I'm trying to make the Report Engine running. I'm using the code snippets provided in <a href="http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php" rel="nofollow noreferrer">http://www.eclipse.org/birt/phoenix/deploy/reportEngineAPI.php</a></p>

<p>But I have a strange exception:</p>

<blockquote>
  <p>java.lang.AssertionError
      at org.eclipse.birt.core.framework.Platform.startup(Platform.java:86)</p>
</blockquote>

<p>and nothing in the log file.</p>

<p>Maybe I missed something in the configuration? Could somebody give me a hint about what I can try to make it running?</p>

<p>Here is the code I'm using:</p>

<pre><code>public static void executeReport()
    {

        IReportEngine engine=null;
        EngineConfig config = null;

        try{
            config = new EngineConfig( );           
            config.setBIRTHome("D:\\birt-runtime-2_3_0\\ReportEngine");
            config.setLogConfig("d:/temp", Level.FINEST);
            Platform.startup( config );
            IReportEngineFactory factory = (IReportEngineFactory) Platform
            .createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
            engine = factory.createReportEngine( config );      

            IReportRunnable design = null;
            //Open the report design
            design = engine.openReportDesign("D:\\birt-runtime-2_3_0\\ReportEngine\\samples\\hello_world.rptdesign"); 
            IRunAndRenderTask task = engine.createRunAndRenderTask(design);         

            HTMLRenderOption options = new HTMLRenderOption();      
            options.setOutputFileName("output/resample/Parmdisp.html");
            options.setOutputFormat("html");

            task.setRenderOption(options);
            task.run();
            task.close();
            engine.destroy();
        }catch( Exception ex){
            ex.printStackTrace();
        }       
        finally
        {
            Platform.shutdown( );
        }
    }
</code></pre>

[{'answer_id': 82229, 'author': 'cH1cK3n', 'author_id': 15615, 'author_profile': 'https://Stackoverflow.com/users/15615', 'pm_score': 2, 'selected': False, 'text': '<p>I had the same mistake a couple of month ago. I\'m not quite sure what actually fixed it but my code looks like the following:</p>\n\n<pre><code>        IDesignEngine engine = null;\n    DesignConfig dConfig = new DesignConfig();\n    EngineConfig config = new EngineConfig();\n    IDesignEngineFactory factory = null;\n    config.setLogConfig(LOG_DIRECTORY, Level.FINE);\n    HttpServletRequest servletRequest = (HttpServletRequest) FacesContext.getCurrentInstance()\n     .getExternalContext().getRequest();\n\n    String u = servletRequest.getSession().getServletContext().getRealPath("/");\n    File f = new File(u + PATH_TO_ENGINE_HOME);\n\n    log.debug("setting engine home to:"+f.getAbsolutePath());\n    config.setEngineHome(f.getAbsolutePath());\n\n    Platform.startup(config);\n    factory = (IDesignEngineFactory) Platform.createFactoryObject(IDesignEngineFactory.EXTENSION_DESIGN_ENGINE_FACTORY);\n    engine = factory.createDesignEngine(dConfig);\n    SessionHandle session = engine.newSessionHandle(null);\n\n    this.design = session.openDesign(u + PATH_TO_MAIN_DESIGN);\n</code></pre>\n\n<p>Perhaps you can solve your problem by comparing this code snippet and your own code. btw my PATH_TO_ENGINE_HOME is "/WEB-INF/platform". [edit]I used the complete "platform"-folder from the WebViewerExample of the birt-runtime-2_1_1. atm birt-runtime-2_3_0 is actual.[/edit]</p>\n\n<p>If this doesn\'t help please give a few more details (for example a code snippet).</p>\n'}, {'answer_id': 93278, 'author': 'Scott Rosenbaum', 'author_id': 5412, 'author_profile': 'https://Stackoverflow.com/users/5412', 'pm_score': 2, 'selected': True, 'text': '<p>Just a thought, but I wonder if your use of a forward slash when setting the logger is causing a problem? instead of</p>\n\n<pre><code>config.setLogConfig("d:/temp", Level.FINEST);\n</code></pre>\n\n<p>you should use </p>\n\n<pre><code> config.setLogConfig("/temp", Level.FINEST);\n</code></pre>\n\n<p>or</p>\n\n<pre><code>  config.setLogConfig("d:\\\\temp", Level.FINEST);\n</code></pre>\n\n<p>Finally, I realize that this is just some sample code, but you will certainly want to split your platform startup code out from your run and render task.  The platform startup is very expensive and should only be done once per session.  </p>\n\n<p>I have a couple of Eclipse projects that are setup in a Subversion server that demonstrate how to use the Report Engine API (REAPI) and the Design Engine API (DEAPI) that you may find useful as your code gets more complicated.  </p>\n\n<p>To get the examples you will need either the Subclipse or the Subversive plugins and then you will need to connect to the following repository:</p>\n\n<pre><code>http://longlake.minnovent.com/repos/birt_example\n</code></pre>\n\n<p>The projects that you need are:</p>\n\n<pre><code>birt_api_example\nbirt_runtime_lib\nscript.lib\n</code></pre>\n\n<p>You may need to adjust some of the file locations in the BirtUtil class, but I think that most file locations are relative path.  There is more information about how to use the examples projects on my blog at http:/birtworld.blogspot.com.  In particular this article should help: <a href="http://birtworld.blogspot.com/2008/04/testing-and-debug-of-reports.html" rel="nofollow noreferrer">Testing And Debug of Reports</a></p>\n'}]
['https://Stackoverflow.com/questions/82123', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/446104/']