Hitachi Vantara Pentaho Community Forums
Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Dashboard integration with webapp

  1. #1
    Join Date
    Mar 2007
    Posts
    19

    Default Dashboard integration with webapp

    Hi,

    I have a web application that I would like to add pentaho dashboard functionality to, but rather than accessing this functionality from http://localhost/pentaho, I would like to see it seemlessly embedded in my own application.

    How can I go about doing this? I have a struts based application utilising tiles for layout running on jboss 4. I would like the dashboards to appear in the main section of the web page surrounded by the menu and header section of the page.

    Will I need to deploy certain elements of pentaho directly in to my web app, or can I create tiles definitions that link to jsp pages defined in the solutions folder via the pentaho ear deployment. Would portlets be necessary to achieve this?

    thanks!

    Mark

  2. #2
    gmoran Guest

    Default

    Here's the short of it - your best route is to embed Pentaho along with your app. Going the "link to .jsp" route can and probably will leave you with URL issues between web apps. So our best advice is to embed Pentaho and use the Pentaho API to do the dashboarding within your Struts application. You can check out the SampleDashboard.jsp that comes with the PCI demo to see the classes that facilitate this.

    Also, if you look at our portlet implementation, you will see that they rely on the same API. So whether you use portlets or the API directly, it would be an embedding exercise.

  3. #3
    Join Date
    Mar 2007
    Posts
    19

    Default Dashboard integration with webapp

    Thanks Gretchen, is there any documentation or tips on this?

    I'd like to try to start with the bare minimum required for what I want to start with and add more libraries as I need more pentaho functionality. I'll probably just start with some basic libraries and figure out classpath exceptions.

    thanks!

    Mark

  4. #4
    Join Date
    Jan 2007
    Posts
    14

    Default “Dashboard Integration with WebApp”

    Hello Gretchen,

    I read your answer to Mark about “Dashboard Integration with WebApp” on 03-16-2007. I tried to understand it because I have a very similar situation using Jakarta Tomcat 5.0 with Struts and Tiles. However, I would like to ask you what is the meaning of “to embed Pentaho and use the Pentaho API to do the dashboarding within your Struts application”

    It would mean that I could insert Pentaho file directory inside the file directory of my web application. For instance, I have now the following configuration:




    \jakarta-tomcat-5.0.30
    |____\webapps
    |______\pentaho
    |______\estadisticas

    Where \estadisticas is associated with my webapp and \pentaho corresponds to Pentaho solution. Then, I may suggest the following configuration

    \jakarta-tomcat-5.0.30
    |____\webapps
    |______\estadisticas
    |______\pentaho


    Is this the right way to understand your proposal???

    Your insight to this issue will be helpful.

    Thanks and all the best
    Forward Message

  5. #5
    Join Date
    Mar 2007
    Posts
    19

    Default

    Hi,

    You may have to embed your pentaho further in to your web application.

    If estadisticas is your web app, you will need to place the required pentaho libraries in your lib folder for this app. The estadisticas/WEB-INF/web.xml will also need to contain the required pentaho servlets, listeners and filters.

    I worked through mine by trial and error, I knew I wasn't going to need all the pentaho functionality, so I only added libraries where I had ClassNotFoundExceptions when trying to get the dashboard functionality working.

    The other configuration property in web.xml you'll need to consider is where to place you pentaho-solutions folder. I placed this directly below my jboss installation folder and configured web.xml to look here for xactions etc.

    Hope that helps!

    Mark

  6. #6

    Question how to configure web.xml to look for xactions

    Hello,

    I refer to the suggestion made by mstacey:

    "The other configuration property in web.xml you'll need to consider is where to place you pentaho-solutions folder. I placed this directly below my jboss installation folder and configured web.xml to look here for xactions etc."

    I want to embed Pentaho dashboard functionality in my own webapplication, but I don't know how to configure web.xml to look for xactions?


    Thanks for helping
    noris


    Ok, thats how one has to define the location of the solution folder in web.xml:

    <context-param>
    <param-name>solution-path</param-name>
    <param-value>c:\pentaho-solutions\</param-value>
    </context-param>

    noris
    Last edited by noris; 05-24-2007 at 03:01 AM. Reason: Problem solved

  7. #7

    Question How to integrate Pentaho's Dashboard functionality into a webapp?

    Hello,

    could anyone please provide me with the essential libs, changes to web.xml neccesary to embed Pentaho's dashboard functionality into another webapplication?

    Is there a documentation on how to integrate Pentaho's dashboard functionality into another webapplication?

    thanks
    noris

  8. #8
    Join Date
    Mar 2007
    Posts
    19

    Default

    Hi noris,

    The web.xml file in

    pentaho_j2ee_deployments-1.2.0.534-GA\pentaho-webapp\WEB-INF

    is where you will find what to merge with your own web.xml file, and the libraries in

    pentaho_j2ee_deployments-1.2.0.534-GA\pentaho-third-party

    are what will go in your web application lib folder. You'll probably end up having to resolve classpath dependencies and the like, but at least you'll have a starting point!

    Mark

  9. #9

    Question

    Hi Mark,

    thanks for replying!

    What about the JARs in pentaho_j2ee_deployments-1.2.1.625-GA\pentaho-jars like pentaho-core-1.2.1.jar, pentaho-ui-1.2.1.jar etc.?
    They are imported e.g. into SampleDashboard.jsp of the Pentaho demo, so they are needed to make a dashboard work! Am I right?

    Thats what I did:

    1. I put the libraries in
    pentaho_j2ee_deployments-1.2.0.534-GA\pentaho-third-party and pentaho_j2ee_deployments-1.2.1.625-GA\pentaho-jars into my web application lib folder.

    2. From the web.xml file in
    pentaho_j2ee_deployments-1.2.0.534-GA\pentaho-webapp\WEB-INF
    I took the following filters, listeners and servlets and put them into my waebapp's web.xml:

    Code:
            <filter>
              <filter-name>SystemStatusFilter</filter-name>
              <filter-class>org.pentaho.core.system.SystemStatusFilter</filter-class>
              <init-param>
                <param-name>initFailurePage</param-name>
                <param-value>InitFailure</param-value>
                <description>This page is displayed if the PentahoSystem fails to properly initialize.</description>
              </init-param>
            </filter>
    
            <filter-mapping>
              <filter-name>SystemStatusFilter</filter-name>
              <url-pattern>/*</url-pattern>
            </filter-mapping>
    
        <listener>
            <listener-class>org.pentaho.core.session.PentahoHttpSessionListener</listener-class>
        </listener>
    
    
        <listener>
            <listener-class>org.pentaho.core.system.SolutionContextListener</listener-class>
        </listener>
    
        
    <servlet>
          <servlet-name>SampleDashboard</servlet-name>
          <jsp-file>/jsp/SampleDashboard.jsp</jsp-file>
        </servlet>
    
     <servlet-mapping>
          <servlet-name>SampleDashboard</servlet-name>
          <url-pattern>/SampleDashboard</url-pattern>
       </servlet-mapping>
    3. Then I defined a datasource in the web.xml and jboss-web.xml and put mydatasource-ds.xml into the deploy folder of Jboss.

    But when running Jboss I get the following Exception:
    Code:
      [exec] 11:24:32,870 ERROR [org.quartz.utils.JNDIConnectionProvider] Error looking up datasource: Quartz not bound
         [exec] javax.naming.NameNotFoundException: Quartz not bound
         [exec] at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
         [exec] at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
         [exec] at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
         [exec] at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
         [exec] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
         [exec] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
         [exec] at javax.naming.InitialContext.lookup(InitialContext.java:347)
         [exec] at org.quartz.utils.JNDIConnectionProvider.init(JNDIConnectionProvider.java:127)
         [exec] at org.quartz.utils.JNDIConnectionProvider.<init>(JNDIConnectionProvider.java:103)
    So I added quartz-ds.xml to my deploy folder and jboss startet. But when trying to execute the SampleDashboard.jsp I get the following Exception:
    Code:
        [exec] 11:30:20,923 ERROR [org.pentaho.repository.HibernateUtil] HIBUTIL.ERROR_0006 - Building SessionFactory failed.
         [exec] org.hibernate.HibernateException: /hibernate.cfg.xml not found
         [exec] at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
         [exec] at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1287)
         [exec] at org.hibernate.cfg.Configuration.configure(Configuration.java:1309)
         [exec] at org.hibernate.cfg.Configuration.configure(Configuration.java:1296)
         [exec] at org.pentaho.repository.HibernateUtil.initialize(HibernateUtil.java:117)
         [exec] at org.pentaho.repository.HibernateUtil.<clinit>(HibernateUtil.java:83)
         [exec] at org.pentaho.repository.runtime.RuntimeRepository.setSession(RuntimeRepository.java:74)
         [exec] at org.pentaho.core.system.PentahoSystem.getRuntimeRepository(PentahoSystem.java:1016)
         [exec] at org.pentaho.core.solution.SolutionEngine.execute(SolutionEngine.java:178)
         [exec] at org.pentaho.ui.component.charting.AbstractChartComponent.getActionData(AbstractChartComponent.java:162)
         [exec] at org.pentaho.ui.component.charting.PieDatasetChartComponent.createChart(PieDatasetChartComponent.java:78)
         [exec] at org.pentaho.ui.component.charting.PieDatasetChartComponent.getXmlContent(PieDatasetChartComponent.java:162)
         [exec] at org.pentaho.ui.XmlComponent.getContent(XmlComponent.java:41)
         [exec] at org.pentaho.ui.ChartHelper.doPieChart(ChartHelper.java:125)
         [exec] at org.apache.jsp.jsp.SampleDashboard_jsp._jspService(SampleDashboard_jsp.java:139)
         [exec] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         [exec] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         [exec] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         [exec] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         [exec] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         [exec] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         [exec] at org.pentaho.core.system.SystemStatusFilter.doFilter(SystemStatusFilter.java:53)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         [exec] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         [exec] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         [exec] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         [exec] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         [exec] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         [exec] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         [exec] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         [exec] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         [exec] at java.lang.Thread.run(Thread.java:534)
         [exec] 11:30:20,954 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[SampleDashboard]: Servlet.service() for servlet SampleDashboard threw exception
         [exec] java.lang.ExceptionInInitializerError
         [exec] at org.pentaho.repository.HibernateUtil.initialize(HibernateUtil.java:155)
         [exec] at org.pentaho.repository.HibernateUtil.<clinit>(HibernateUtil.java:83)
         [exec] at org.pentaho.repository.runtime.RuntimeRepository.setSession(RuntimeRepository.java:74)
         [exec] at org.pentaho.core.system.PentahoSystem.getRuntimeRepository(PentahoSystem.java:1016)
         [exec] at org.pentaho.core.solution.SolutionEngine.execute(SolutionEngine.java:178)
         [exec] at org.pentaho.ui.component.charting.AbstractChartComponent.getActionData(AbstractChartComponent.java:162)
         [exec] at org.pentaho.ui.component.charting.PieDatasetChartComponent.createChart(PieDatasetChartComponent.java:78)
         [exec] at org.pentaho.ui.component.charting.PieDatasetChartComponent.getXmlContent(PieDatasetChartComponent.java:162)
         [exec] at org.pentaho.ui.XmlComponent.getContent(XmlComponent.java:41)
         [exec] at org.pentaho.ui.ChartHelper.doPieChart(ChartHelper.java:125)
         [exec] at org.apache.jsp.jsp.SampleDashboard_jsp._jspService(SampleDashboard_jsp.java:139)
         [exec] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         [exec] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         [exec] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         [exec] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         [exec] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         [exec] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         [exec] at org.pentaho.core.system.SystemStatusFilter.doFilter(SystemStatusFilter.java:53)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         [exec] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
         [exec] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         [exec] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
         [exec] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:66)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:150)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:54)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         [exec] at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
         [exec] at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
         [exec] at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
         [exec] at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
         [exec] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
         [exec] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
         [exec] at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
         [exec] at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         [exec] at java.lang.Thread.run(Thread.java:534)
         [exec] Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
         [exec] at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
         [exec] at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1287)
         [exec] at org.hibernate.cfg.Configuration.configure(Configuration.java:1309)
         [exec] at org.hibernate.cfg.Configuration.configure(Configuration.java:1296)
         [exec] at org.pentaho.repository.HibernateUtil.initialize(HibernateUtil.java:117)
         [exec] ... 52 more
         [exec] 11:38:09,245 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[SampleDashboard]: Servlet.service() for servlet SampleDashboard threw exception
         [exec] java.lang.NoClassDefFoundError
         [exec] at org.pentaho.repository.runtime.RuntimeRepository.setSession(RuntimeRepository.java:74)
         [exec] at org.pentaho.core.system.PentahoSystem.getRuntimeRepository(PentahoSystem.java:1016)
         [exec] at org.pentaho.core.solution.SolutionEngine.execute(SolutionEngine.java:178)
    
    Obviously my webapp tries use hibernate which ships configured with the pentaho-demo to use hypersonic!?

    DO I need Quartz or Hibernate to make a Dashboard work? How can I get rid of that? Do I have to apply changes to pentaho-solutions/system/pentaho.xml?


    Thanks
    noris
    Last edited by noris; 05-25-2007 at 09:39 AM.

  10. #10
    Join Date
    Mar 2007
    Posts
    19

    Default

    Actually, I haven't upgraded to pentaho 1.2.1 yet, but I think there was a pentaho-core.jar in both those locations? Do you have two versions of this file (and others) around?

    I think you need a lot more in the web.xml file - I merged in all of the servlets that are used, such as DisplayChart, GetChart, GetImage as an example. I don't need all of them but I'll remove the ones I don't need later.

    I don't need Quartz either, so I removed those datasources and references. In terms of your hibernate error you will need to have the .hbm.xml files available on your classpath (like ContentItem.hbml.xml) and you will need to tell pentaho that you are using App Server managed datasources, see references to hibernateManaged and hibernateConfigPath in the web.xml file.

    I suppose a lot depends on what you are trying to achieve, do you want to run all the pentaho demos using your app or do you just want to run the dashboard and use a few of the pentaho functional areas? I only need the dashboard for the moment, so I'm not worried about mondrian, kettle, scheduling, etc, so I haven't included the jar files until necessary. Have a look back over the installation documentation now that you are more familiar with the pentaho set up. It might help clear a few things up.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.