Jan Cumps wrote:Nothing I can see directly in your code.
But I can see that you call some unknown to us methods (e.g.: populateReadArray ) in your while loop. Have you checked what is happening there?
Jan Cumps wrote:
Do you use recursion in your program?
Jan Cumps wrote:In your code, you don't close connections if exceptions occur.
You should not close a connection - and other jdbc resources - in the try{} block, but in the finally{} block.
Rob Prime wrote:When you use JAR files and the -jar flag, the class path is ignored. Try putting the JavaMail JAR file in a folder relative to your JAR file, then adding it to the Class-Path directive in your MANIFEST.MF file.
Wouter Oet wrote:Try using the -classpath (or -cp) option of the java command.
Paul Clapham wrote:
James Brooks wrote: The program creates a .csv file. When run manually, the .csv is output, which I can tell from the file attributes (time created). It does not output the file when the task scheduler supposedly runs it.
No, that just tells you that it didn't work right. You know the task scheduler ran it, so presumably something bad happened and the program crashed. That suggests to me that something is different between your environment and the task scheduler's environment.
By the way, you said it worked correctly when you ran it from the command line. Does it work correctly when you run it from the command line with C:\Program Files\Java\jdk1.6.0_13\jre\bin as the current directory, or did you try it with some other current directory?
And does the command line run the application under your user profile or some other user profile. Could that make a difference?
I'm sure there are plenty of other environment differences that could exist. Keep looking for them.
Paul Clapham wrote:What makes you think the program doesn't run? Perhaps it does run but the results of its running weren't what you expected.
Paul Clapham wrote:I see you didn't add the Java Activation Framework to your classpath, so presumably you're using Java 6 where it is built in?
And do any of those other jars contain JavaMail classes?
Also, the stack trace would be useful information, to see where the class is being requested from.