Package it.eng.spagobi.utilities.engines

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


        logger.debug("Error type [" + o.getClass().getName()+ "]");
        if(o instanceof EMFInternalError) {
          EMFInternalError error = (EMFInternalError)o;
          Exception e = error.getNativeException();
          if(e instanceof SpagoBIEngineStartupException) {
            SpagoBIEngineStartupException serviceError = (SpagoBIEngineStartupException)e;
            logError(serviceError);
          } else {
            logger.error("Unespected exception",e);   
          }   
        } else {
View Full Code Here


          "It's not possible to execute " + this.getActionName() + " service before having properly created a form template");
     
      setAttribute(FormEngineStartAction.ENGINE_INSTANCE, engineInstance);
     
    } catch(Throwable e) {
      SpagoBIEngineStartupException serviceException = null;
     
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + this.getActionName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getActionName(), message, e);
      }
     
      throw serviceException;
    } finally {     
      logger.debug("OUT");
View Full Code Here

     
      logger.debug("Creating engine instance ...");
      try {
        qbeEngineInstance = QbeEngine.createInstance( getTemplateAsSourceBean(), getEnv() );
      } catch(Throwable t) {
        SpagoBIEngineStartupException serviceException;
        String msg = "Impossible to create engine instance for document [" + getDocumentId() + "].";
        Throwable rootException = t;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        msg += "\nThe root cause of the error is: " + str;
        serviceException = new SpagoBIEngineStartupException(ENGINE_NAME, msg, t);
       
        if(rootException instanceof QbeTemplateParseException) {
          QbeTemplateParseException e = (QbeTemplateParseException)rootException;
          serviceException.setDescription( e.getDescription());
          serviceException.setHints( e.getHints() );
        }
       
        throw serviceException;
      }
      logger.debug("Engine instance succesfully created");
     
      qbeEngineInstance.setAnalysisMetadata( getAnalysisMetadata() );
      if( getAnalysisStateRowData() != null ) {
        logger.debug("Loading subobject [" + qbeEngineInstance.getAnalysisMetadata().getName() + "] ...");
        try {
          analysisState = new QbeEngineAnalysisState( qbeEngineInstance.getDataSource() );
          analysisState.load( getAnalysisStateRowData() );
          qbeEngineInstance.setAnalysisState( analysisState );
        } catch(Throwable t) {
          SpagoBIEngineStartupException serviceException;
          String msg = "Impossible load subobject [" + qbeEngineInstance.getAnalysisMetadata().getName() + "].";
          Throwable rootException = t;
          while(rootException.getCause() != null) {
            rootException = rootException.getCause();
          }
          String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
          msg += "\nThe root cause of the error is: " + str;
          serviceException = new SpagoBIEngineStartupException(ENGINE_NAME, msg, t);
         
          throw serviceException;
        }
        logger.debug("Subobject [" + qbeEngineInstance.getAnalysisMetadata().getName() + "] succesfully loaded");
      }
     
      locale = (Locale)qbeEngineInstance.getEnv().get(EngineConstants.ENV_LOCALE);
     
      setAttributeInSession( ENGINE_INSTANCE, qbeEngineInstance);   
      setAttribute(ENGINE_INSTANCE, qbeEngineInstance);
     
      setAttribute(LANGUAGE, locale.getLanguage());
      setAttribute(COUNTRY, locale.getCountry());
     
     
    } catch (Throwable e) {
      SpagoBIEngineStartupException serviceException = null;
     
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
     
      //throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), qbeEngineInstance, e);
View Full Code Here

     
      logger.debug("Creating engine instance ...");
      try {
        qbeEngineInstance = QbeEngine.createInstance( template, env );
      } catch(Throwable t) {
        SpagoBIEngineStartupException serviceException;
        String msg = "Impossible to create engine instance for datamart [" + datamartName + "].";
        Throwable rootException = t;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        msg += "\nThe root cause of the error is: " + str;
        serviceException = new SpagoBIEngineStartupException(ENGINE_NAME, msg, t);
       
        if(rootException instanceof QbeTemplateParseException) {
          QbeTemplateParseException e = (QbeTemplateParseException)rootException;
          serviceException.setDescription( e.getDescription());
          serviceException.setHints( e.getHints() );
        }
       
        throw serviceException;
      }
      logger.debug("Engine instance succesfully created");
     
      setAttributeInSession( ENGINE_INSTANCE, qbeEngineInstance);   
      setAttribute(ENGINE_INSTANCE, qbeEngineInstance);
     
      locale = (Locale) env.get(EngineConstants.ENV_LOCALE);
      setAttribute(LANGUAGE, locale.getLanguage());
      setAttribute(COUNTRY, locale.getCountry());
     
    } catch (Throwable e) {
      SpagoBIEngineStartupException serviceException = null;
     
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
     
      //throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), qbeEngineInstance, e);
View Full Code Here

      }
     
      serviceResponse.setAttribute(DynamicPublisher.PUBLISHER_NAME, publisherName);
     
    } catch (Throwable e) {
      SpagoBIEngineStartupException serviceException = null;
     
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
    } finally {
      logger.debug("OUT");
View Full Code Here

     
      logger.debug("Creating engine instance ...");
      try {
        qbeEngineInstance = QbeEngine.createInstance(getTemplateAsSourceBean(), getEnv() );
      } catch(Throwable t) {
        SpagoBIEngineStartupException serviceException;
        String msg = "Impossible to create engine instance for document [" + getDocumentId() + "].";
        Throwable rootException = t;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        msg += "\nThe root cause of the error is: " + str;
        serviceException = new SpagoBIEngineStartupException(ENGINE_NAME, msg, t);
       
        if(rootException instanceof QbeTemplateParseException) {
          QbeTemplateParseException e = (QbeTemplateParseException)rootException;
          serviceException.setDescription( e.getDescription());
          serviceException.setHints( e.getHints() );
        }
       
        throw serviceException;
      }
      logger.debug("Engine instance succesfully created");
   
      qbeEngineInstance.setAnalysisMetadata( getAnalysisMetadata() );
 
     
      // initializes form state, if not already initialized (starting a new form definition)
      FormState formState = qbeEngineInstance.getFormState();
      if (formState == null) {
        logger.debug("Initializing a new form state object...");
        formState = new FormState();
        formState.setConf(new JSONObject());
        qbeEngineInstance.setFormState(formState);
      }
      //Integer subObjectId = getAttributeAsInteger("subobjectId");
     
     
      //get the form values saved (if the user has loaded a subobject)
      analysisFormState = new SmartFilterAnalysisState();
      analysisFormState.load( getAnalysisStateRowData() );
      formState.setFormStateValues(analysisFormState.getFormValues());
     
      //save the map id-->field name
      formState.setIdNameMap();
     
      qbeEngineInstance.getEnv().put("TEMPLATE", getTemplateAsSourceBean());
      String docId = this.getAttributeAsString("formDocumentId");
      if(docId != null) qbeEngineInstance.getEnv().put("DOCUMENT", docId);
      else {
        qbeEngineInstance.getEnv().put("DOCUMENT", this.getDocumentId());
      }
     
      locale = (Locale)qbeEngineInstance.getEnv().get(EngineConstants.ENV_LOCALE);
     
      setAttributeInSession( ENGINE_INSTANCE, qbeEngineInstance);   
      setAttribute(ENGINE_INSTANCE, qbeEngineInstance);
     
      setAttribute(LANGUAGE, locale.getLanguage());
      setAttribute(COUNTRY, locale.getCountry());
     
      String publisherName = "VIEW_FORM_ENGINE_PUBLISHER";
     
      String modality = this.getAttributeAsString(PARAM_MODALITY);
      logger.debug("Input " + PARAM_MODALITY + " parameter is " + modality);
      if (modality != null && modality.trim().equalsIgnoreCase("EDIT")) {
        // edit template
        publisherName = "EDIT_FORM_ENGINE_PUBLISHER";
      }
     
      serviceResponse.setAttribute(DynamicPublisher.PUBLISHER_NAME, publisherName);
     
    } catch (Throwable e) {
      SpagoBIEngineStartupException serviceException = null;
     
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
     
      //throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException(getActionName(), qbeEngineInstance, e);
View Full Code Here

     
      logger.debug("Creating engine instance ...");
      try {
        qbeEngineInstance = QbeEngine.createInstance(getTemplateAsSourceBean(), getEnv() );
      } catch(Throwable t) {
        SpagoBIEngineStartupException serviceException;
        String msg = "Impossible to create engine instance for document [" + getDocumentId() + "].";
        Throwable rootException = t;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        msg += "\nThe root cause of the error is: " + str;
        serviceException = new SpagoBIEngineStartupException(ENGINE_NAME, msg, t);
       
        if(rootException instanceof QbeTemplateParseException) {
          QbeTemplateParseException e = (QbeTemplateParseException)rootException;
          serviceException.setDescription( e.getDescription());
          serviceException.setHints( e.getHints() );
        }
       
        throw serviceException;
      }
      logger.debug("Engine instance succesfully created");
     
      qbeEngineInstance.getEnv().put("TEMPLATE", getTemplateAsSourceBean());
     
      locale = (Locale)qbeEngineInstance.getEnv().get(EngineConstants.ENV_LOCALE);
     
      setAttributeInSession( ENGINE_INSTANCE, qbeEngineInstance);   
      setAttribute(ENGINE_INSTANCE, qbeEngineInstance);
     
      setAttribute(LANGUAGE, locale.getLanguage());
      setAttribute(COUNTRY, locale.getCountry());
     
      if(qbeEngineInstance!= null && qbeEngineInstance.getWorkSheetDefinition()!=null && qbeEngineInstance.getWorkSheetDefinition().getWorkSheet()!=null){
        List<WorkSheet> ws = qbeEngineInstance.getWorkSheetDefinition().getWorkSheet();
        for(int i=0; i<ws.size();i++){
          setImageWidth((ws.get(i)).getHeader());
          setImageWidth((ws.get(i)).getFooter());
        }   
      }

     
     
    } catch (Throwable e) {
      SpagoBIEngineStartupException serviceException = null;
     
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
    } finally {
      logger.debug("OUT");
View Full Code Here

     
     
      String id = getAttributeAsString("SBI_EXECUTION_ID");
      setAttributeInSession(GEO_ENGINE_INSTANCE, geoEngineInstance);         
    } catch (Exception e) {
      SpagoBIEngineStartupException serviceException = null;
           
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
    } finally {
      if(hitsByExecutionContext != null) hitsByExecutionContext.stop();
View Full Code Here

      logger.debug("Creating engine instance ...");
     
      try {
        consoleEngineInstance = ConsoleEngine.createInstance( getTemplateAsJSONObject(), getEnv() );
      } catch(Throwable t) {
        SpagoBIEngineStartupException serviceException;
        String msg = "Impossible to create engine instance for document [" + getDocumentId() + "].";
        Throwable rootException = t;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        msg += "\nThe root cause of the error is: " + str;
        serviceException = new SpagoBIEngineStartupException(ENGINE_NAME, msg, t);
       
       
        throw serviceException;
      }
      logger.debug("Engine instance succesfully created");
     
      locale = (Locale)consoleEngineInstance.getEnv().get(EngineConstants.ENV_LOCALE);
     
      setAttributeInSession( ENGINE_INSTANCE, consoleEngineInstance);   
      setAttribute(ENGINE_INSTANCE, consoleEngineInstance);
     
      setAttribute(LANGUAGE, locale.getLanguage());
      setAttribute(COUNTRY, locale.getCountry());

     
    } catch (Exception e) {
      SpagoBIEngineStartupException serviceException = null;
           
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
    } finally {
      monitor.stop();
View Full Code Here

        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
       
        SpagoBIEngineStartupException se = new SpagoBIEngineStartupException(getEngineName(), "Impossible to create engine instance. \nThe root cause of the error is: " + str, t);
        throw se;
      }
     
      geoEngineInstance.setAnalysisMetadata( getAnalysisMetadata() );
     
      analysisStateRowData = getAnalysisStateRowData();
      if(analysisStateRowData != null) {
        logger.debug("AnalysisStateRowData: " + new String(analysisStateRowData));
        analysisState = new GeoEngineAnalysisState( );
        analysisState.load( analysisStateRowData );
        logger.debug("AnalysisState: " + analysisState.toString());
      } else {
        logger.debug("AnalysisStateRowData: NULL");
      }
      if(analysisState != null) {
        geoEngineInstance.setAnalysisState( analysisState );
      }
     
      String selectedMeasureName  = getAttributeAsString("default_kpi");
      logger.debug("Parameter [" + "default_kpi" + "] is equal to [" + selectedMeasureName + "]");
     
      if(!StringUtilities.isEmpty(selectedMeasureName)) {
        geoEngineInstance.getMapRenderer().setSelectedMeasureName(selectedMeasureName);
      }
     
     
      if("TRUE".equalsIgnoreCase(isDocumentCompositionModeActive)){
        setAttribute(DynamicPublisher.PUBLISHER_NAME, "SIMPLE_UI_PUBLISHER");
      } else {
        setAttribute(DynamicPublisher.PUBLISHER_NAME, "AJAX_UI_PUBLISHER");
      }
     
     
      String id = getAttributeAsString("SBI_EXECUTION_ID");
      setAttributeInSession(GEO_ENGINE_INSTANCE, geoEngineInstance);         
    } catch (Exception e) {
      SpagoBIEngineStartupException serviceException = null;
           
      if(e instanceof SpagoBIEngineStartupException) {
        serviceException = (SpagoBIEngineStartupException)e;
      } else {
        Throwable rootException = e;
        while(rootException.getCause() != null) {
          rootException = rootException.getCause();
        }
        String str = rootException.getMessage()!=null? rootException.getMessage(): rootException.getClass().getName();
        String message = "An unpredicted error occurred while executing " + getEngineName() + " service."
                 + "\nThe root cause of the error is: " + str;
       
        serviceException = new SpagoBIEngineStartupException(getEngineName(), message, e);
      }
     
      throw serviceException;
    } finally {
      if(hitsByExecutionContext != null) hitsByExecutionContext.stop();
View Full Code Here

TOP

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

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.