Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes IllegalArgumentException when trying to connect to HTTPs based site. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "IllegalArgumentException when trying to connect to HTTPs based site." Watch "IllegalArgumentException when trying to connect to HTTPs based site." New topic
Author

IllegalArgumentException when trying to connect to HTTPs based site.

Susan Smith
Ranch Hand

Joined: Oct 13, 2007
Posts: 223
I'm trying to connect to a HTTPs based site using JAVA program with username and password provided to me but it gives me the following error.



I have this below before I open the connection to data source


and this is my 'Authenticator' class.



Could someone please advice what might be the cause of this?
Thanks in advance for all the help.
Joseph Macer
Ranch Hand

Joined: Apr 20, 2008
Posts: 63
That's hard to say for sure "yup, you need another String there" because you don't have access to the server-side implementation. Since you said the username/password were provided to you, I'm guessing your code simply doesn't match what the server expects, OR you're getting a return value your code isn't designed to handle.

From the Java API, that exception is "Thrown to indicate that a method has been passed an illegal or inappropriate argument. "

If this is someone else's server, I would definitely contact them first to ask how authentication works.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: IllegalArgumentException when trying to connect to HTTPs based site.
 
Similar Threads
I need your Help!!! -- How to Access protected Web page/Image file?
I need your Help!!! -- How to Access protected Web page/Image file?
java.io.IOException: Server returned HTTP response code: 401 for URL:
Logging in to a site programmatically
Authenticator Class