Package javax.script

Examples of javax.script.ScriptException


                return callGlobal(name, args);
            }
        } catch (MissingMethodException mme) {
            throw new NoSuchMethodException(mme.getMessage());
        } catch (Exception e) {
            throw new ScriptException(e);
        }
    }
View Full Code Here


        try {
            while ((numChars = reader.read(arr, 0, arr.length)) > 0) {
                buf.append(arr, 0, numChars);
            }
        } catch (IOException exp) {
            throw new ScriptException(exp);
        }
        return buf.toString();
    }
View Full Code Here

            // re-throw
            throw e;
        }
        catch (Exception ex)
        {
            throw new ScriptException(ex);
        }
        return result;
    }
View Full Code Here

        try {
            response = ((Invocable)scriptEngine).invokeFunction(oper.getName(), objects);
        } catch (ScriptException e) {
            throw e;
        } catch (Exception e) {
            throw new ScriptException(e);
        }

        if (xmlHelper != null) {
            response = xmlHelper.toOMElement(response);
        }
View Full Code Here

            }
        }
       
        if (scriptEngine == null)
        {
            throw new ScriptException("Cannot create script engine. { scriptEngineName: " + scriptEngineName + ", scriptSource: " + scriptSource);
        }
       
        return scriptEngine;
    }
View Full Code Here

                evaledObject = ret;
            }
           
            if (evaledObject == null)
            {
                throw new ScriptException("The evaluated object is null. (" + evalKey + ")");
            }
        }
        finally
        {
            if (br != null)
View Full Code Here

                    Class<? extends Portlet> scriptPortletClass = (Class<? extends Portlet>) evalPortlet;
                    tempScriptPortletInstance = (Portlet) scriptPortletClass.newInstance();
                }
                else
                {
                    throw new ScriptException("The evaluated return is neither class nor instance of javax.portlet.Portlet. " + evalPortlet);
                }
               
                scriptGenericPortletInstance = null;
                portletDoEditMethod = null;
               
View Full Code Here

                    Class<? extends PreferencesValidator> validatorClass = (Class<? extends PreferencesValidator>) evalPortlet;
                    tempValidatorInstance = (PreferencesValidator) validatorClass.newInstance();
                }
                else
                {
                    throw new ScriptException("The evaluated return is neither class nor instance of javax.portlet.PreferencesValidator. " + evalPortlet);
                }
               
                validatorInstance = tempValidatorInstance;
            }
        }
View Full Code Here

    protected ScriptEngine getScriptEngine() throws ScriptException {
        final String lang = getScriptLanguage();

        ScriptEngine scriptEngine = getInstance().getEngineByName(lang);
        if (scriptEngine == null) {
            throw new ScriptException("Cannot find engine named: "+lang);
        }

        return scriptEngine;
    }
View Full Code Here

    protected Object processFileOrScript(ScriptEngineManager sem) throws IOException, ScriptException {

        final String lang = getScriptLanguage();
        ScriptEngine scriptEngine = sem.getEngineByName(lang);
        if (scriptEngine == null) {
            throw new ScriptException("Cannot find engine named: "+lang);
        }

        File scriptFile = new File(getFilename());
        if (scriptFile.exists()) {
            BufferedReader fileReader = null;
View Full Code Here

TOP

Related Classes of javax.script.ScriptException

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.