This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes HttpsUrlConnection through a proxy returning ArrayIndexOutOfBounds Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HttpsUrlConnection through a proxy returning ArrayIndexOutOfBounds Exception" Watch "HttpsUrlConnection through a proxy returning ArrayIndexOutOfBounds Exception" New topic
Author

HttpsUrlConnection through a proxy returning ArrayIndexOutOfBounds Exception

Daniel Obuba
Greenhorn

Joined: Jan 23, 2013
Posts: 3
Hello All,


I get an ArrayIndexOutOfBoundsException as seen below everytime i run the code. Please what can be the problem and what is the soluton?? I'm in dire need of it...thanks in advance

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.getOutputStream(HttpURLConnection.java:979)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
at com.vasconsulting.www.utility.RIMXMLUtility.sendXMLRequestToRIM(RIMXMLUtility.java:188)
at com.vasconsulting.www.utility.RIMXMLUtility.cancelSubscriptionByIMSI(RIMXMLUtility.java:333)
at com.vasconsulting.www.interfaces.impl.DeactivateBlackberryServiceCommandImpl.execute(DeactivateBlackberryServiceCommandImpl.java:61)
at com.vasconsulting.www.invokers.CommandInvoker.provision(CommandInvoker.java:34)
at com.vasconsulting.www.controllers.SMSHandler.provisionSubscriber(SMSHandler.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)
java.lang.NullPointerException
at com.vasconsulting.www.interfaces.impl.DeactivateBlackberryServiceCommandImpl.execute(DeactivateBlackberryServiceCommandImpl.java:62)
at com.vasconsulting.www.invokers.CommandInvoker.provision(CommandInvoker.java:34)
at com.vasconsulting.www.controllers.SMSHandler.provisionSubscriber(SMSHandler.java:150)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
Welcome to the Ranch

You should use the code button; when I applied it to your code, it made it look so much better. But I had to break some of your long lines.
Where is this Exception occurring? I cannot see any arrays in that code. Which line number is it?
Daniel Obuba
Greenhorn

Joined: Jan 23, 2013
Posts: 3
Campbell Ritchie wrote:Welcome to the Ranch

You should use the code button; when I applied it to your code, it made it look so much better. But I had to break some of your long lines.
Where is this Exception occurring? I cannot see any arrays in that code. Which line number is it?


Lol...thanks New to this forum....the error occurs on line 43 "OutputStream out = httpUrlConnection.getOutputStream();"
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
Don’t know. Sorry. Is that method the same as this? It doesn’t say anything about arrays there.
Daniel Obuba
Greenhorn

Joined: Jan 23, 2013
Posts: 3
Campbell Ritchie wrote:Don’t know. Sorry. Is that method the same as this? It doesn’t say anything about arrays there.


Yes it is the same method as that. My theory is that the exception is emanating from here "at sun.net.www.protocol.http.NTLMAuthentication.buildType3Msg(NTLMAuthentication.java:368)" which is not a class in my application.
 
Consider Paul's rocket mass heater.
 
subject: HttpsUrlConnection through a proxy returning ArrayIndexOutOfBounds Exception
 
Similar Threads
org.springframework.web.HttpSessionRequiredException: Session attribute 'user' required - not found
org.springframework.web.client.ResourceAccessException: I/O error: Connection refused: connect
com.sun.mail.smtp.SMTPSendFailedException: 451 4.7.1 Please try again later
IllegalArgumentException: Cannot convert value of type [java.lang.String] to required
nested exception is org.springframework.web.client.ResourceAccessException: I/O error