Menu

#58 Cannot execute script without return value

2.1.0
closed
None
1
2025-09-06
2012-11-14
No

When executing script without value returned, as in the example below we end up with exception.

<?xml version="1.0" encoding="UTF-8"?>

<config xmlns="http://web-harvest.sourceforge.net/schema/2.1/core"
        xmlns:var="http://web-harvest.sourceforge.net/schema/2.1/var"
        xmlns:p="http://web-harvest.sourceforge.net/schema/2.1/param">
    <script>
                        <![CDATA[
                        http.statusCode = 201
                        ]]>
    </script>
</config>
ERROR (    ConfigPanel.java:867) - javax.script.ScriptException: Sourced file: inline evaluation of: ``http.statusCode = 201; Empty value ;'' : Typed variable declaration : Class: Empty not found in namespace : at Line: 1 : in file: inline evaluation of: ``http.statusCode = 201; Empty value ;'' : Empty 
 in inline evaluation of: ``http.statusCode = 201; Empty value ;'' at line number 1
org.webharvest.exception.ScriptException: javax.script.ScriptException: Sourced file: inline evaluation of: ``http.statusCode = 201; Empty value ;'' : Typed variable declaration : Class: Empty not found in namespace : at Line: 1 : in file: inline evaluation of: ``http.statusCode = 201; Empty value ;'' : Empty 
 in inline evaluation of: ``http.statusCode = 201; Empty value ;'' at line number 1
    at org.webharvest.runtime.scripting.jsr.JSRScriptEngineAdapter.evaluate(JSRScriptEngineAdapter.java:95)
    at org.webharvest.runtime.processors.ScriptProcessor.execute(ScriptProcessor.java:82)
    at org.webharvest.runtime.processors.AbstractProcessor.run(AbstractProcessor.java:112)
    at org.webharvest.runtime.processors.RunningStatusController.run(RunningStatusController.java:60)
    at org.webharvest.runtime.processors.StoppedOrExitedProcessor.run(StoppedOrExitedProcessor.java:60)
    at org.webharvest.runtime.processors.ConfigProcessor.execute(ConfigProcessor.java:45)
    at org.webharvest.runtime.processors.AbstractProcessor.run(AbstractProcessor.java:112)
    at org.webharvest.runtime.processors.RunningStatusController.run(RunningStatusController.java:60)
    at org.webharvest.runtime.processors.StoppedOrExitedProcessor.run(StoppedOrExitedProcessor.java:60)
    at org.webharvest.runtime.Scraper.execute(Scraper.java:72)
    at org.webharvest.runtime.ScrapingHarvester.execute(ScrapingHarvester.java:118)
    at org.webharvest.runtime.ScrapingHarvester$$EnhancerByGuice$$e739dbae.CGLIB$execute$0(<generated>)
    at org.webharvest.runtime.ScrapingHarvester$$EnhancerByGuice$$e739dbae$$FastClassByGuice$$f049161c.invoke(<generated>)
    at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
    at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
    at org.webharvest.ioc.ScrapingInterceptor$1.execute(ScrapingInterceptor.java:84)
    at org.webharvest.ioc.ScrapingInterceptor.invoke(ScrapingInterceptor.java:105)
    at org.webharvest.ioc.ScrapingInterceptor.invoke(ScrapingInterceptor.java:79)
    at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
    at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
    at org.webharvest.runtime.ScrapingHarvester$$EnhancerByGuice$$e739dbae.execute(<generated>)
    at org.webharvest.gui.ScraperExecutionThread.run(ScraperExecutionThread.java:61)
Caused by: javax.script.ScriptException: Sourced file: inline evaluation of: ``http.statusCode = 201; Empty value ;'' : Typed variable declaration : Class: Empty not found in namespace : at Line: 1 : in file: inline evaluation of: ``http.statusCode = 201; Empty value ;'' : Empty 
 in inline evaluation of: ``http.statusCode = 201; Empty value ;'' at line number 1
    at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:92)
    at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
    at org.webharvest.runtime.scripting.jsr.JSRScriptEngineAdapter.evaluate(JSRScriptEngineAdapter.java:93)
    ... 21 more

Discussion

  • Piotr Dyraga

    Piotr Dyraga - 2012-11-14
    • status: open --> pending
     
  • Piotr Dyraga

    Piotr Dyraga - 2012-11-14
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB