Package org.springframework.scripting

Examples of org.springframework.scripting.ScriptCompilationException


        // An instance of the scripted class: let's return it as-is.
        return goo;
      }
    }
    catch (InstantiationException ex) {
      throw new ScriptCompilationException(
          scriptSource, "Could not instantiate Groovy script class: " + scriptClass.getName(), ex);
    }
    catch (IllegalAccessException ex) {
      throw new ScriptCompilationException(
          scriptSource, "Could not access Groovy script constructor: " + scriptClass.getName(), ex);
    }
  }
View Full Code Here


        }
        PythonInterpreter interp = new PythonInterpreter(null, state);
        interp.exec(strScript);
        PyObject getInstance = interp.get("getInstance");
        if (!(getInstance instanceof PyFunction)) {
          throw new ScriptCompilationException("\"getInstance\" is not a function.");
        }
        PyObject _this;
        if (arguments == null) {
          _this = ((PyFunction) getInstance).__call__();
        } else {
          PyObject[] args = new PyObject[arguments.length];
          for (int i=0; i<arguments.length; i++) {
            args[i] = new PyJavaInstance(arguments[i]);
          }
          _this = ((PyFunction) getInstance).__call__(args);
        }
        return _this.__tojava__(scriptInterfaces[0]);
      } catch (Exception ex) {
        logger.error("Error while loading script.", ex);
        if (ex instanceof IOException) {
          // Raise to caller
          throw (IOException) ex;
        } else if (ex instanceof ScriptCompilationException) {
          // Raise to caller
          throw (ScriptCompilationException) ex;
        }
       
        throw new ScriptCompilationException(ex.getMessage());
      }
    }
    logger.error("No scriptInterfaces provided.");
    return null;
  }
View Full Code Here

      // Process re-execution outside of the synchronized block.
      return executeScript(scriptClassToExecute);
    }
    catch (CompilationFailedException ex) {
      throw new ScriptCompilationException(
          "Could not compile Groovy script: " + scriptSource, ex);
    }
  }
View Full Code Here

        // An instance of the scripted class: let's return it as-is.
        return goo;
      }
    }
    catch (InstantiationException ex) {
      throw new ScriptCompilationException(
          "Could not instantiate Groovy script class: " + scriptClass.getName(), ex);
    }
    catch (IllegalAccessException ex) {
      throw new ScriptCompilationException(
          "Could not access Groovy script constructor: " + scriptClass.getName(), ex);
    }
  }
View Full Code Here

    log.debug("Getting scripted object...");
    try {
      return RhinoScriptUtils.createRhinoObject(actualScriptSource
          .getScriptAsString(), actualInterfaces, extendedClass);
    } catch (Exception ex) {
      throw new ScriptCompilationException(
          "Could not compile Rhino script: " + actualScriptSource, ex);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.scripting.ScriptCompilationException

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.