This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have a batch process which was made as the following: a jar was created, and inside it all the related necessary classes were put inside, including the main class. A .sh file was created to call the jar file. It processes a txt file, and for each line in the file, an e-mail is created parsing the content of each line.
When I run the commands in the sh file manually, all process is done perfectly.
But my client showed an e-mail made by the process which is not complete (some parts of the email body are missing). This process runs automatically every night. Could the schedule made at Unix be the actual reazon for this problem? I was wondering if there might be missing some parameters to let more timing to process each record.
As I don't work with shell scripts very much, I don't have much experience about it...
I am not exactly sure what you are trying to do: I mean is the java program processing a file and sending the email ot is the shell script? Do you have a way of making your program produce a log file with what is going?
If an email is truncated there maybe a number of reasons for that happening: 1) Your program fails, despite the fact that you have tested it and it worked, you are not there when it runs (I assume). You need a log file. 2) Your program terminates processing abnormally for that specific email. It may be just that one not every single one, again you need a log file. 3) The mail server virus scanner maybe stripping lines, but that would generally produce a message for the recepient identifying what has happened and why. 4) many more reason are also possible.
Post a piece of code or an example if you need direction. Thanks.
Joined: Apr 12, 2005
Today I found the root of the problem: my client was using a diferent JVM of mine. The application makes the email's body reading from a file htm. When I set JVM to 1.3 the same error happens. For some reazon it truncates the text, but when I use JVM 1.4 it works fine. So I've created a private method and put all the code which was inside the html text. I know the right way was finding out why it didn't read all the html file through IO correctly, but my client was pushing me a lot.
Joined: Jan 15, 2006
It sounds like a size issue or something of that sort for, but anything that makes the customer happy. I would definitely try to figure it out, if I was you, once you have him off your back.