Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1266

script element in scheduler.xml gets NullPointerException

    XMLWordPrintable

Details

    • Fix
    • Status: Approved (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 1.5.3192
    • None
    • None
    • 1.5.2264-SNAPSHOT-9d38b3d3ec138ac1e380bc3c7b0f26c09aeee6b7

    Description

      I'm not sure but I believe to remember that it has worked with 1.5.2264-SNAPSHOT-03bcd8ee87ea0cd0b13c8acb5c4e3010c15cdc6a

      If I add a script element in the scheduler.xml:

      <?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
      <?xml-stylesheet type="text/xsl" href="scheduler_documentation.xsl" ?>
      
      <spooler>
        
        <config mail_xslt_stylesheet="config/scheduler_mail.xsl" port="4464">
      
          <params>
      			<param name="SCHEDULER_VARIABLE_NAME_PREFIX" value="SCHEDULER_PARAM_"/>
      			<param name="scheduler.order.keep_order_content_on_reschedule" value="false"/>    
          </params>
          
          
          <security ignore_unknown_hosts="yes">
            <allowed_host host="localhost" level="all"/>
          </security>
          
          
          <plugins>
            <plugin java_class="com.sos.scheduler.engine.plugins.jetty.JettyPlugin">
              <plugin.config/>
            </plugin>
          </plugins>
          
          
          <process_classes>
            <process_class max_processes="30"/>
            <process_class max_processes="10" name="single"/>
            <process_class max_processes="10" name="multi"/>
          </process_classes>
          
          
          <script language="javascript">
      			<![CDATA[
      				function spooler_init() {
      					spooler.variables.set_var( "foo", "bar" );
                                              return true;
      				}
      			]]>
          </script>
      
          
          <http_server>
            <http_directory path="${SCHEDULER_HOME}/" url_path="/scheduler_home/"/>
            <http_directory path="${SCHEDULER_DATA}/" url_path="/scheduler_data/"/>
          </http_server>
          
          
          
        </config>
      

      then I get the following error in the scheduler.log

      .23 14:22:38.043 scheduler 0 2128.24D0 1293.391MB .

      Unknown macro: {scheduler}

      Scheduler_script_subsystem: switch_subsystem_state active
      .23 14:22:38.043 scheduler 0 2128.24D0 1293.391MB ...

      [debug3] (Scheduler_script scheduler) spooler_init()
      .23 14:22:38.043 scheduler 0 2128.24D0 1293.391MB ...

      Unknown macro: {scheduler.call}

      Java_module_instance.spooler_init() begin
      .23 14:22:38.047 scheduler 0 2128.24D0 1293.391MB ...

      Java_module_instance.spooler_init() end
      .23 14:22:38.048 scheduler 16 2128.24D0 1293.391MB ..

      Unknown macro: {java.stackTrace}

      java.lang.NullPointerException: null value in entry: spooler_task=null
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:235)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.google.common.collect.ImmutableMap.entryOf(ImmutableMap.java:144)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.google.common.collect.ImmutableMap.of(ImmutableMap.java:110)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at sos.spooler.jobs.ScriptAdapterJob$1.compute(ScriptAdapterJob.java:26)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at sos.spooler.jobs.ScriptAdapterJob$1.compute(ScriptAdapterJob.java:24)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.sos.scheduler.engine.common.Lazy.get(Lazy.java:12)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.sos.scheduler.engine.jobapi.scripting.ScriptInstance.loadScript(ScriptInstance.java:66)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.sos.scheduler.engine.jobapi.scripting.JobScriptInstanceAdapter.loadScript(JobScriptInstanceAdapter.java:71)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at com.sos.scheduler.engine.jobapi.scripting.JobScriptInstanceAdapter.callInit(JobScriptInstanceAdapter.java:17)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB .. at sos.spooler.jobs.ScriptAdapterJob.spooler_init(ScriptAdapterJob.java:48)
      .23 14:22:38.048 scheduler 0 2128.24D0 1293.391MB ..
      .23 14:22:38.049 scheduler 0 2128.24D0 1293.391MB ..[xc.insert 1, "java.lang.NullPointerException"]
      .23 14:22:38.049 scheduler 0 2128.24D0 1293.391MB ..[xc.insert 2, "null value in entry: spooler_task=null"]
      .23 14:22:38.049 scheduler 0 2128.24D0 1293.391MB ..[xc.insert 3, "spooler_init()Z"]
      .23 14:22:38.049 scheduler 0 2128.24D0 1293.391MB ..

      Unknown macro: {scheduler}

      [ERROR] (Scheduler_script scheduler) Z-JAVA-105 Java exception java.lang.NullPointerException("null value in entry: spooler_task=null"), method=spooler_init()Z []
      .23 14:22:38.049 scheduler 0 2128.24D0 1293.391MB ..

      Scheduler_script_subsystem: state=active

      Attachments

        Activity

          People

            jz Joacim Zschimmer
            oh Oliver Haufe
            Oliver Haufe Oliver Haufe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: