Issue Details (XML | Word | Printable)

Key: QRTZNET-136
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Marko Lahma
Reporter: Steve Campbell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Quartz.NET

NativeJob is broken

Created: 05/Nov/08 11:56 AM   Updated: 05/Nov/08 02:48 PM
Component/s: Jobs
Affects Version/s: 1.0 RC 3
Fix Version/s: 1.0

Environment: Windows XP, running Console-server, 2.0 binaries

Flags: Important


 Description  « Hide
NativeJob throws a job exception, even though the BAT file is run successfully:
2008-11-05 11:45:00.0021|Info|Job sampleGroup.sampleJob threw a JobExecutionException:
Parameters: refire = False, unscheduleFiringTrigger = False, unscheduleAllTriggers = False
 Quartz.JobExecutionException: Error launching native command: ---> System.InvalidOperationException: StandardIn has not been redirected.
   at System.Diagnostics.Process.get_StandardInput()
   at Quartz.Job.NativeJob.RunNativeCommand(String command, String parameters, Boolean wait, Boolean consumeStreams)
   --- End of inner exception stack trace ---
   at Quartz.Job.NativeJob.RunNativeCommand(String command, String parameters, Boolean wait, Boolean consumeStreams)
   at Quartz.Job.NativeJob.Execute(JobExecutionContext context)
   at Quartz.Core.JobRunShell.Run() [See nested exception: System.InvalidOperationException: StandardIn has not been redirected.
   at System.Diagnostics.Process.get_StandardInput()
   at Quartz.Job.NativeJob.RunNativeCommand(String command, String parameters, Boolean wait, Boolean consumeStreams)]

The exception occurs irrespective of the "consumeStreams" flag. My sample job definition is:
        <job-detail>
            <name>sampleJob</name>
            <group>sampleGroup</group>
            <description>Sample job for Quartz Server</description>
            <job-type>Quartz.Job.NativeJob, Quartz</job-type>
            <volatile>false</volatile>
            <durable>true</durable>
            <recover>false</recover>
            <job-data-map>
                <entry>
                    <key>command</key>
                    <value>Hello.bat</value>
                </entry>
                <entry>
                    <key>parameters</key>
                    <value>Steve</value>
                </entry>
                <entry>
                    <key>waitForProcess</key>
                    <value>false</value>
                </entry>
                <entry>
                    <key>consumeStreams</key>
                    <value>false</value>
                </entry>
            </job-data-map>
        </job-detail>

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Marko Lahma added a comment - 05/Nov/08 02:46 PM
Updated title to reflect the general problem

Marko Lahma added a comment - 05/Nov/08 02:48 PM
Fixed most obvious issues and got my own .bat file run running correctly