Menu

#19 Variable names are not checked for correctness

2.1.0
closed
None
5
2025-09-06
2009-07-26
No
  • Check configuration (working).

    <?xml version="1.0" encoding="UTF-8"?>
    <config>
        <var-def name="destDir">D:/Collector/DB-Operational/Google-test</var-def>
    
        <file path="${destDir}/google-page.html" action="write" type="text" charset="Windows-1251">
            <http method="get" url="http://www.google.ru" />
        </file>
    
    </config>
    
  • Bug reproduce configuration. Define "destDir" variable with another spelling - "dest-dir". (Replace "destDir" by "dest-dir" in the check configuration)

Both error message displayed in GUI (see attachment) and exception displayed in the log pane (see Appendix A) are not meaningful and give a wrong start point for the config error investigation.

So variable name spell check at the variable definition point is required.


Appendix A - exception displayed in the log pane.

INFO - VarDefProcessor starts processing...
INFO - ConstantProcessor starts processing...
INFO - ConstantProcessor processor executed in 0ms.
INFO - VarDefProcessor processor executed in 0ms.
INFO - FileProcessor starts processing...
ERROR - Error during script execution: Sourced file: inline evaluation of: dest-dir;'' : illegal use of undefined variable, class, or 'void' literal org.webharvest.exception.ScriptException: Error during script execution: Sourced file: inline evaluation of:dest-dir;'' : illegal use of undefined variable, class, or 'void' literal
at org.webharvest.runtime.scripting.BeanShellScriptEngine.eval(Unknown Source)
at org.webharvest.runtime.templaters.BaseTemplater.execute(Unknown Source)
at org.webharvest.runtime.processors.FileProcessor.execute(Unknown Source)
at org.webharvest.runtime.processors.BaseProcessor.run(Unknown Source)
at org.webharvest.runtime.Scraper.execute(Unknown Source)
at org.webharvest.runtime.Scraper.execute(Unknown Source)
at org.webharvest.gui.ScraperExecutionThread.run(Unknown Source)
Caused by: Sourced file: inline evaluation of: dest-dir;'' : illegal use of undefined variable, class, or 'void' literal : at Line: 1 : in file: inline evaluation of:dest-dir;'' : ;

at bsh.BSHBinaryExpression.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
... 7 more

Discussion

  • Alexey Svatseff

    Alexey Svatseff - 2009-07-26

    Error message displayed in GUI

     
  • Robert Bala

    Robert Bala - 2012-11-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,14 +1,14 @@
    
     * Check configuration (working).
    
         <?xml version="1.0" encoding="UTF-8"?>
    
    -      <config> 
    +    <config>   
             <var-def name="destDir">D:/Collector/DB-Operational/Google-test</var-def>
    -   
    -   <file path="${destDir}/google-page.html" action="write" type="text" charset="Windows-1251">
    -       <http method="get" url="http://www.google.ru" />
    -   </file>
    -   
    -      </config>
    +                 
    +        <file path="${destDir}/google-page.html" action="write" type="text" charset="Windows-1251">
    +            <http method="get" url="http://www.google.ru" />
    +        </file>
    +            
    +    </config>
    
    
     * Bug reproduce configuration. Define "destDir" variable with another spelling - "dest-dir". (Replace "destDir" by "dest-dir" in the check configuration)
    
    • status: open --> accepted
    • assigned_to: Robert Bala
     
  • Robert Bala

    Robert Bala - 2012-11-15
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,15 +1,15 @@
    
     * Check configuration (working).
    -
    -    <?xml version="1.0" encoding="UTF-8"?>
    -    <config>   
    -        <var-def name="destDir">D:/Collector/DB-Operational/Google-test</var-def>
    -                 
    -        <file path="${destDir}/google-page.html" action="write" type="text" charset="Windows-1251">
    -            <http method="get" url="http://www.google.ru" />
    -        </file>
    +    
    +        <?xml version="1.0" encoding="UTF-8"?>
    +        <config>
    +            <var-def name="destDir">D:/Collector/DB-Operational/Google-test</var-def>
    +                
    +            <file path="${destDir}/google-page.html" action="write" type="text" charset="Windows-1251">
    +                <http method="get" url="http://www.google.ru" />
    +            </file>
    
    
    -    </config>
    -
    +        </config>
    +    
     * Bug reproduce configuration. Define "destDir" variable with another spelling - "dest-dir". (Replace "destDir" by "dest-dir" in the check configuration)
    
     Both error message displayed in GUI (see attachment) and exception displayed in the log pane (see Appendix A) are not meaningful and give a wrong start point for the config error investigation. 
    
     
  • Robert Bala

    Robert Bala - 2012-11-16
    • status: accepted --> closed
     
  • Maciej Czapiewski

    • milestone: Backlog --> 2.1.0rc1-RELEASE
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB