• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Https url connection ArrayIndeoutofBounds Exception java

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

run my code it throws below exception :

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at sun.net.www.protocol.http.NTLMAuthentication.buildType3Msg(NTLMAuthentication.java:368)
at sun.net.www.protocol.http.NTLMAuthentication.setHeaders(NTLMAuthentication.java:225)
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:1557)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at ReadHttpsURL1.main(ReadHttpsURL1.java:29)

 
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried pulling the code into my environment, but all of the classes do not resolve. In lieu of trying this out myself, I'll ask if the following code:




to something like this as it looks to me like you are opening the connection and then setting your request property. I don't know if the lack of the property when the connection is opened may be leading to the exception or not which is occuring later in the code..



 
krish dutt
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Brian Burress.
Thank you for your reply.I don't create HttpsUrlConnection object directly because it is an abstract class.
 
Brian Burress
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Krish,

My apologies, that's what I get for doing a quick read/reply

I have not done much with HTTPS (most of what I have been involved with is the setting the certificates on the server side). Hopefully someone with practical experience with HTTPS will see this and jump in.

In the meantime, have you looked at examples found from a google search? There are a number of examples that aren't exactly what you are doing but have some different properties (Example1) that are being set that you may want to look into to see how they are set up on your environment as well as dumping the certs and such to show you have a good connection (Example2):

Example1

Example2


As a side question, are you able to try making your connection using HTTP first to verify those mechanics work? If you are going through a proxy, I am wondering if you are trying to debug a proxy issue, an HTTPS issue or something else. Looking deeper at the stacktrace this site might be where you want to start as NTLMAuthentication is the class invoking the array copy:

NTLMAuthentication
 
krish dutt
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brian,

Thank you for your quick response.I tried those examples but not working for me . It throws same exception .The Proxy settings are only worked for Http protocol.I used Https it throws above exception.
 
It means our mission is in jeapordy! Quick, read this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic