Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

java:comp/env getting appended to Datasource

2007-10-05
2013-04-29
  • pdkshirsagar
    pdkshirsagar
    2007-10-05

    Hi there,

    I am using mondrian query to generate my analysis. For generating the analysis, I am passing dataSource as defined in below tag.

    <jp:mondrianQuery dataSource="jdbc/MyDataSource"

    for generating my analysis. I am using Pramati server.

    Its appending java:comp/env/ to the datasource name (java:comp/env/jdbc/MyDataSource) which is not being found in context. It throws Datasource not found exception.

    As per my observation, its appending java:comp/env/ in makeConnectString() method of MondrianModelFactory class.

    Please help me out in resolving this.

     
    • pdkshirsagar
      pdkshirsagar
      2007-10-25

      To add more explanation,

      If you check the makeConnectString() method of MondrianModelFactory class, it is appending datasource to the connectStringURL using below code in which it appends java:comp/env/

      else if (cfg.getDataSource() != null) {
            sb.append(";DataSource=java:comp/env/").append(cfg.getDataSource());
            testDataSource(cfg.getDataSource());
          }

      Also if you set the external datasource in session, then check the findDataSource() method of static inner class Config which sets the dataSource to null as mentioned in below code.

      if (obj instanceof DataSource) {
              logger.info("using app dataSource " + dataSource);
              this.dataSource = null;
              this.externalDataSource = (DataSource) obj;
      }

      So if we set the datasource into session, it will work to generate the analysis, But it will not work for drillthrough from same analysis as it checks for dataSource which is set to null now. Check the code in getConnection()method of MondrianDrillThroughTableModel class. And we will get following exception,

      j2eeadmin@portalServer> java.lang.RuntimeException: Mondrian Connect string '' must contain either 'Jdbc' or 'DataSource'
              at com.tonbeller.jpivot.mondrian.MondrianDrillThroughTableModel.getConnection(MondrianDrillThroughTableModel.java:184)
              at com.tonbeller.jpivot.mondrian.MondrianDrillThroughTableModel.executeQuery(MondrianDrillThroughTableModel.java:129)
              at com.tonbeller.jpivot.mondrian.MondrianDrillThroughTableModel.getColumnCount(MondrianDrillThroughTableModel.java:110)
              at com.tonbeller.wcf.table.TableComponent.setModel(TableComponent.java:253)
              at com.tonbeller.jpivot.table.navi.DrillThroughUI$DrillThroughHandler.request(DrillThroughUI.java:125)
              at com.tonbeller.wcf.controller.DispatcherSupport.request(DispatcherSupport.java:167)
              at com.tonbeller.wcf.controller.DispatcherSupport.request(DispatcherSupport.java:167)
              at com.tonbeller.wcf.component.ComponentSupport.request(ComponentSupport.java:104)
              at com.tonbeller.jpivot.table.TableComponent.request(TableComponent.java:180)
              at com.tonbeller.wcf.controller.WcfController.request(WcfController.java:71)
              at com.tonbeller.wcf.controller.RequestFilter$MyHandler.normalRequest(RequestFilter.java:119)
              at com.tonbeller.wcf.controller.RequestSynchronizer.handleRequest(RequestSynchronizer.java:129)
              at com.tonbeller.wcf.controller.RequestFilter.doFilter(RequestFilter.java:263)
              at com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter(PramatiFilterChainImpl.java:94)
              at com.savvion.sbm.bpmportal.bizpass.DomainFilter.doFilter(Unknown Source)
              at com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter(PramatiFilterChainImpl.java:94)
              at com.pramati.web.servlet.core.PramatiFilterChainImpl.processFilters(PramatiFilterChainImpl.java:62)
              at com.pramati.web.servlet.core.PramatiFilterChainImpl.startDoFilter(PramatiFilterChainImpl.java:57)
              at com.pramati.web.interceptors.FilterInterceptor.process(FilterInterceptor.java:83)
              at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
              at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
              at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
              at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
              at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
              at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
              at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
              at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
              at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
              at com.pramati.web.interceptors.core.DefaultProcessContainer.process(DefaultProcessContainer.java:92)
              at com.pramati.web.core.WorkerThread.processConnection(WorkerThread.java:331)
              at com.pramati.web.core.WorkerThread.processConnection(WorkerThread.java:302)
              at com.pramati.web.core.WorkerThread.run(WorkerThread.java:129)