Package it.eng.spagobi.utilities.engines

Examples of it.eng.spagobi.utilities.engines.SpagoBIEngineServiceException


        try {
          dataStore = TemporaryTableManager.queryTemporaryTable(userProfile, sqlStatement, sqlQuery, dataSource);
        } catch (Exception e) {
          logger.debug("Query execution aborted because of an internal exception");
          String message = "An error occurred in " + getActionName() + " service while querying temporary table";       
          SpagoBIEngineServiceException exception = new SpagoBIEngineServiceException(getActionName(), message, e);
          exception.addHint("Check if the base query is properly formed: [" + statement.getQueryString() + "]");
          exception.addHint("Check if the crosstab's query is properly formed: [" + sqlStatement + "]");
          exception.addHint("Check connection configuration: connection's user must have DROP and CREATE privileges");
         
          throw exception;
        }
      }

      Assert.assertNotNull(dataStore, "The dataStore cannot be null");
      logger.debug("Query executed succesfully");
     
      resultNumber = (Integer)dataStore.getMetaData().getProperty("resultNumber");
      Assert.assertNotNull(resultNumber, "property [resultNumber] of the dataStore returned by queryTemporaryTable method of the class [" + TemporaryTableManager.class.getName()+ "] cannot be null");
      logger.debug("Total records: " + resultNumber);     
     
     
      boolean overflow = maxSize != null && resultNumber >= maxSize;
      if (overflow) {
        logger.warn("Query results number [" + resultNumber + "] exceeds max result limit that is [" + maxSize + "]");
        auditlogger.info("[" + userProfile.getUserId() + "]:: max result limit [" + maxSize + "] exceeded with SQL: " + sqlQuery);
      }
     
      CrossTab crossTab = new CrossTab(dataStore, crosstabDefinition);
      JSONObject crossTabDefinition = crossTab.getJSONCrossTab();
     
      try {
        writeBackToClient( new JSONSuccess(crossTabDefinition) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      errorHitsMonitor = MonitorFactory.start("QbeEngine.errorHits");
      errorHitsMonitor.stop();
View Full Code Here


      }
     
      try {
        writeBackToClient( new JSONAcknowledge() );
      } catch (IOException e) {
        throw new SpagoBIEngineServiceException(getActionName(), "Impossible to write back the responce to the client", e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {     
View Full Code Here

     
      // serialize query
      try {
        queryJSON = (JSONObject)SerializerFactory.getSerializer("application/json").serialize(query, getEngineInstance().getDataSource(), getLocale());
      } catch (SerializationException e) {
        throw new SpagoBIEngineServiceException(getActionName(), "Cannot serialize query [" + query.getId() + "]", e);
      }
     
     
      fieldsJSON = queryJSON.getJSONArray(QuerySerializationConstants.FIELDS);     
      resultsJSON = new JSONObject();
      resultsJSON.put("results", fieldsJSON);
     
      try {
        writeBackToClient( new JSONSuccess( resultsJSON ) );
      } catch (IOException e) {
        throw new SpagoBIEngineServiceException(getActionName(), "Impossible to write back the responce to the client [" + resultsJSON.toString(2)+ "]", e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {     
View Full Code Here

        dataSet.setQuery(sqlQuery);
        dataSet.loadData(start, limit, -1);
        dataStore = dataSet.getDataStore();
      } catch (Exception e) {
        logger.debug("Query execution aborted because of an internal exceptian");
        SpagoBIEngineServiceException exception;
        String message;
       
        message = "An error occurred in " + getActionName() + " service while executing query: [" +  statement.getQueryString() + "]";       
        exception = new SpagoBIEngineServiceException(getActionName(), message, e);
        exception.addHint("Check if the query is properly formed: [" + statement.getQueryString() + "]");
        exception.addHint("Check connection configuration");
        exception.addHint("Check the qbe jar file");
       
        throw exception;
      }
      logger.debug("Query executed succesfully");
     
     
      //dataStore.getMetaData().setProperty("resultNumber", new Integer( (int)dataStore.getRecordsCount() ));
     
      resultNumber = (Integer)dataStore.getMetaData().getProperty("resultNumber");
      Assert.assertNotNull(resultNumber, "property [resultNumber] of the dataStore returned by loadData method of the class [" + dataSet.getClass().getName()+ "] cannot be null");
      logger.debug("Total records: " + resultNumber);     
     
     
      boolean overflow = maxSize != null && resultNumber >= maxSize;
      if (overflow) {
        logger.warn("Query results number [" + resultNumber + "] exceeds max result limit that is [" + maxSize + "]");
        auditlogger.info("[" + userProfile.getUserId() + "]:: max result limit [" + maxSize + "] exceeded with SQL: " + sqlQuery);
      }
           
      dataSetWriter = new JSONDataWriter();
      gridDataFeed = (JSONObject)dataSetWriter.write(dataStore);
     
      try {
        writeBackToClient( new JSONSuccess(gridDataFeed) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      errorHitsMonitor = MonitorFactory.start("QbeEngine.errorHits");
      errorHitsMonitor.stop();
View Full Code Here

      engineInstance.getFormState().setConf(formJson);
     
      try {
        writeBackToClient( new JSONAcknowledge() );
      } catch (IOException e) {
        throw new SpagoBIEngineServiceException(getActionName(), "Impossible to write back the responce to the client", e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {     
View Full Code Here

     
      try {
        writeBackToClient( new JSONSuccess(nodes) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
View Full Code Here

        logger.debug("Error type [" + o.getClass().getName()+ "]");
        if(o instanceof EMFInternalError) {
          EMFInternalError error = (EMFInternalError)o;
          Exception e = error.getNativeException();
          if(e instanceof SpagoBIEngineServiceException) {
            SpagoBIEngineServiceException serviceError = (SpagoBIEngineServiceException)e;
            logError(serviceError);
           
            try {
              writeBackToClient( new JSONFailure( serviceError ) );
            } catch (IOException ioe) {
              String message = "Impossible to write back the responce to the client";
              throw new SpagoBIEngineServiceException(getActionName(), message, e);
            } catch (JSONException je) {
              String message = "Error while serializing error into JSON object";
              throw new SpagoBIEngineServiceException(getActionName(), message, je);
            }
          } else {
            logger.error("Unespected exception",e);   
          }
        } else {
View Full Code Here

     
      try {
        writeBackToClient( new JSONSuccess(toReturn) );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {     
View Full Code Here

     
      try {
        writeBackToClient( new JSONAcknowledge() );
      } catch (IOException e) {
        String message = "Impossible to write back the responce to the client";
        throw new SpagoBIEngineServiceException(getActionName(), message, e);
      }
     
    } catch(Throwable t) {
      throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), getEngineInstance(), t);
    } finally {
View Full Code Here

      type = fieldClaculationDescriptor.getString(QuerySerializationConstants.FIELD_TYPE);
      expression = fieldClaculationDescriptor.getString(QuerySerializationConstants.FIELD_EXPRESSION);
     
      field = new ModelCalculatedField(alias, type, expression);
    } catch (Throwable t) {
      throw new SpagoBIEngineServiceException(getActionName(), "impossible to deserialize calculated field [" + fieldJSON.toString() + "]", t);
    }         
   
   
    return field;
  }
View Full Code Here

TOP

Related Classes of it.eng.spagobi.utilities.engines.SpagoBIEngineServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.