0 Replies Latest reply on Sep 3, 2006 9:53 AM by peter

    report portlet and ServletContext

    peter Apprentice

      Hi

      I am trying to using eclipse BIRT report engine to implement my own ReportPortlet.

      In the init() method of the portlet,

       public void init() {
       log.debug("init() is called");
       if (birtEngine == null) {
       EngineConfig config = new EngineConfig();
       log.debug("config="+config);
       IPlatformContext context = new PlatformServletContext(
       new JBossServletContextProvider().getServletContext(this));
       log.debug("context="+context);
       config.setPlatformContext(context);
       try {
       Platform.startup(config);
       } catch (BirtException e) {
       e.printStackTrace();
       }
       IReportEngineFactory factory = (IReportEngineFactory) Platform
       .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
       log.debug("factory="+factory);
       birtEngine = factory.createReportEngine(config);
       log.debug("birtEngine="+birtEngine);
       }
       }
      

      ServetContext is accessed by using JBossServletContextProvider.

      However, when i deploy the portlet, the following error happen:


      Caused by: java.lang.IllegalStateException: No bridge set
      at org.jboss.portal.bridge.JBossServletContextProvider.getServletContext(JBossServletContextProvider.java:65)
      at com.ternary.wirelessthermometer.portlet.ReportPortlet.init(Unknown Source)
      at javax.portlet.GenericPortlet.init(GenericPortlet.java:355)
      at org.jboss.portal.portlet.PortletContainer.initPortlet(PortletContainer.java:368)
      at org.jboss.portal.portlet.PortletContainer.start(PortletContainer.java:229)
      ... 106 more


      I went through the bridge related posts, and cannot find the solution.

      (1)Do i need to configure the bridge interceptor myself? Or the default jboss portal 2.2.1 already configures the bridge interceptor for all portlet deployment?

      (2)If need myself to configure, how to? Which configure file need to be configured?

      Thanks
      yang