Scripts (both in Java and Perl) to automate online status inquiry

hi tm1965,

I'm using Java1.4 and it works but its causing some problems on my linux GUI (Exceed). I would like see if can I make some changes to the source to work on linux properly. Can you share the code with me?

thanks,
 
Last edited by a moderator:
Unzip the "ins.jar" file using unjar or winzip. Source file CaseStat.java is provided in "ins.jar"

One suggestion is to use Timer and TimerTask from java.util (new in 1.3 and later) which could simplify the thread/delay code. These are specifically for time delayed threads. Otherwise good job........... I'm learning stuff on this forum perl, C#, java in addition to my usual c/c++ and Immigration law.
:D
 
Hi rk4gc

The source code is in the jar file, feel free to change the code to suit your requirement.

TM
 
Originally posted by Groan
Unzip the "ins.jar" file using unjar or winzip. Source file CaseStat.java is provided in "ins.jar"

One suggestion is to use Timer and TimerTask from java.util (new in 1.3 and later) which could simplify the thread/delay code. These are specifically for time delayed threads. Otherwise good job........... I'm learning stuff on this forum perl, C#, java in addition to my usual c/c++ and Immigration law.
:D


Hi Groan

Appreciate you suggestion, I will try to implement these changes to improve it.

TM
 
HI Groan and tm1965,

Thanks for your inputs. I updated the java source to use Timer and TimerTask classes. I uploaded the new ins.jar file. But I disabled the GUI as I was testing on my linux machine. The gui should work by uncommenting the code. But I need to test it.

No change in source except for using Timer and TimerTask and commenting gui. So linux users can use it by setting up classpath and running it as "java -jar ins.jar". Follow tm1965 instructions about required files. Right now the application dies silently if ins.dat and case.txt files are not available. I''ll try to add meaningful error messages later.

Thanks again tm1965.
 
rk4gc,

I put all the files: ins.jar, case.txt, ins.dat, activation.jar and mail.jar in the same directory on my SUN account. I tried to run with
"java -cp .:mail.jar:activation.jar -jar ins.jar"
However, I got the error message:
"Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException"

Please advice!
 
Originally posted by laava
rk4gc,

I put all the files: ins.jar, case.txt, ins.dat, activation.jar and mail.jar in the same directory on my SUN account. I tried to run with
"java -cp .:mail.jar:activation.jar -jar ins.jar"
However, I got the error message:
"Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException"

Please advice!

laava,

As tm1965 explained you need to copy mail.jar and activation.jar to your JAVA_HOME\lib\ext dir.

or

use try run this way.

"java -cp .:./mail.jar:./activation.jar -jar ins.jar"

so that mail.jar and activation.jar can be found from current dir.

I hope this helps.
 
Originally posted by laava
rk4gc,

I put all the files: ins.jar, case.txt, ins.dat, activation.jar and mail.jar in the same directory on my SUN account. I tried to run with
"java -cp .:mail.jar:activation.jar -jar ins.jar"
However, I got the error message:
"Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingException"

Please advice!

copy mail.jar and activation.jar to your C:\Program Files\Java\j2re1.4.2_03\lib\ext or to lib\ext subdirectory of your java runtime installation, so that you dont have to worry about classpath.
 
tm1965,

I try to run it on a SUN Solaris UNIX machine. Guess I have no rights to copy those files to the system's java directory.

I also tried "java -cp .:./activation.jar:./mail.jar -jar ./ins.jar". The error message is the same.

Anyway, it runs happily on my Windows machine. So let it be.

Thanks all for the good job!
 
Last edited by a moderator:
Originally posted by laava
tm1965,

I try to run it on a SUN Solaris UNIX machine. Guess I have no rights to copy those files to the system's java directory.

I also tried "java -cp .:./activation.jar:./mail.jar -jar ./ins.jar". The error message is the same.

Anyway, it runs happily on my Windows machine. So let it be.

Thanks all for the good job!
laava,

you need to full path of the jar file for the cp as

java -cp .:/home/lava/activation.jar:/home/lava/mail.jar -jar ins.jar
 
request for tm1965

Hi ,
---------------
Step for installation

UNZIP inz.zip file
it should unzip the following files in c:\ins

ins.jar
ins.dat
case.txt
mail.jar
activation.jar


copy mail.jar and activation.jar to your C:\Program Files\Java\j2re1.4.2_03\lib\ext


edit ins.dat file as follow

infile=C:\\ins\\case.txt
outfile=C:\\ins\\stat.txt
datfile=c:\\ins\\stat.dat
smtp=smtp.hotmail.com
to=your.name@hotmail.com
from=your.name@hotmail.com
delay=3600000
ins.dat has to be in the same directory as ins.jar file.
---------------------------------------------------
i was completeed these steps ....
please let me know what arethe steps further i need to do ...
i am not a software litarate , please please let me know what are the steps i need to follow...
Thank You
 
How to Unjar and Jar?

I hava modified the CaseStat.java and compiled it with javac.

But I do not know how do I put it back to the ins.jar? Use jar command? Can someone give me detailed instructions?

I am not familize with the java..:)

Thanks
 
Re: request for tm1965

Originally posted by swarna_bist
Hi ,
---------------
Step for installation

UNZIP inz.zip file
it should unzip the following files in c:\ins

ins.jar
ins.dat
case.txt
mail.jar
activation.jar


copy mail.jar and activation.jar to your C:\Program Files\Java\j2re1.4.2_03\lib\ext


edit ins.dat file as follow

infile=C:\\ins\\case.txt
outfile=C:\\ins\\stat.txt
datfile=c:\\ins\\stat.dat
smtp=smtp.hotmail.com
to=your.name@hotmail.com
from=your.name@hotmail.com
delay=3600000
ins.dat has to be in the same directory as ins.jar file.
---------------------------------------------------
i was completeed these steps ....
please let me know what arethe steps further i need to do ...
i am not a software litarate , please please let me know what are the steps i need to follow...
Thank You


Check Page 2, first post

TM
 
Re: How to Unjar and Jar?

Originally posted by summerwind
I hava modified the CaseStat.java and compiled it with javac.

But I do not know how do I put it back to the ins.jar? Use jar command? Can someone give me detailed instructions?

I am not familize with the java..:)

Thanks

Open the supplied Ins.jar in Winzip or Winrar and replace the CaseStat.class in the jar file. winrar is easy as you can go to the subdirectoy and drop the modified class file into the subdirectory

TM
 
MalformedURLException while running the java program !!

I am getting the following exception message when I ran the program :confused:

what to do ??

Exception in thread "main" java.net.MalformedURLException: unknown protocol: https
at java.net.URL.<init>(URL.java:480)
at java.net.URL.<init>(URL.java:376)
at java.net.URL.<init>(URL.java:330)
at CaseStat.<init>(CaseStat.java:45)
at CaseStat.main(CaseStat.java:67)
 
Re: MalformedURLException while running the java program !!

Originally posted by ksam
I am getting the following exception message when I ran the program :confused:

what to do ??

Exception in thread "main" java.net.MalformedURLException: unknown protocol: https
at java.net.URL.<init>(URL.java:480)
at java.net.URL.<init>(URL.java:376)
at java.net.URL.<init>(URL.java:330)
at CaseStat.<init>(CaseStat.java:45)
at CaseStat.main(CaseStat.java:67)

YOU SHOULD BE CONNECTED TO INTERNET WHEN YOU RUN THIS PROGRAM
 
I am connected to the internet. I can open IE and goto the same web page as in the URL code. Is there something I am missing here ?
 
Few more questions.

Dear Gurus,
I am a novice on Java & Windows. My platform is win-2k. I followed all instructions as said. After I ran the Ins.jar and it ran and created stat.txt and stat.dat files only and stat.txt is an empty file. Is the program behaving as expected ?.???.
Do I have to run the mail.jar and activation.jar files too.... I tried to run activation.jar and mail.jar files, and I got these errors.

---------------------------
Java Virtual Machine Launcher
---------------------------
Failed to load Main-Class manifest attribute from
C:\Program Files\Java\j2re1.4.2_03\lib\ext\activation.jar
---------------------------
OK
---------------------------
 
Originally posted by ksam
I am connected to the internet. I can open IE and goto the same web page as in the URL code. Is there something I am missing here ?

Ksam, I don't know, may be you dont have the latest version of JAVA setup.

Can somebody pitch in and help him out.
 
Re: Few more questions.

Originally posted by GCcare
Dear Gurus,
I am a novice on Java & Windows. My platform is win-2k. I followed all instructions as said. After I ran the Ins.jar and it ran and created stat.txt and stat.dat files only and stat.txt is an empty file. Is the program behaving as expected ?.???.
Do I have to run the mail.jar and activation.jar files too.... I tried to run activation.jar and mail.jar files, and I got these errors.

---------------------------
Java Virtual Machine Launcher
---------------------------
Failed to load Main-Class manifest attribute from
C:\Program Files\Java\j2re1.4.2_03\lib\ext\activation.jar
---------------------------
OK
---------------------------

check your ins.dat is in same directory as ins.jar, check if ins.dat has correct path for case.txt
 
Top