• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with a batch process using Java+Unix

 
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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...
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Rogerio,

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.
 
Rogerio Kioshi
Ranch Hand
Posts: 701
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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.

Thanks
 
George Stoianov
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Good luck.
 
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic