• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difference in behaviour of a class from executable jar and main method  RSS feed

 
anees ahamed
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am attaching a java source here. I have a single question in connection with this class.
As you can see in the main method of this class, I give a username and password as credentials. When I execute this program from the main method I get correct output. ie; 'usrname','pwd' combination gives its corresponding output and 'usrname1','pwd1' give its corresponding output.

But, when I access this class from the application(executable jar), 'usrname','pwd' gives its corresponding output and after that if I give 'usrname1','pwd1' combination, it give the output corresponding to 'usrname','pwd'
Here is my simple Java class.

I really wonder how it behaves differenly when used independently and when used from an executable jar.
Please provide some help in this regard.
Anees
[ November 11, 2008: Message edited by: anees ahamed ]
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Can you show us the output of the running program? (I see you have System.out statements there). Also I don't see you validating that the arguments you pass in are really what you expect, it looks like you pass the args[] directly to a PHP call?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!