• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic