title: Tomcat 5.5 Giving an error java.lang.NoClassDefFoundError
body: <p>I hosted a jsp service to access a java class to send a request to a server. I hosted this service in Tomcat 6.0 server hosted in my local computer and it worked fine. But when I tried it with another server which has Tomcat 5.5 I'm getting this error.</p>
  
  <p>Error report is given below. I'll be really grateful if someone can help.</p>
  
  <p>Error Report</p>
  
  <p>description The server encountered an internal error () that prevented it from fulfilling this request.</p>
  
  <p>exception</p>
  
  <p>org.apache.jasper.JasperException: Could not initialize class sun.net.www.protocol.http.HttpURLConnection
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:616)
      org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
      java.security.AccessController.doPrivileged(Native Method)
      javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
      org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
      org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)</p>
  
  <p>root cause</p>
  
  <p>javax.servlet.ServletException: Could not initialize class sun.net.www.protocol.http.HttpURLConnection
      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
      org.apache.jasper.runtime.PageContextImpl.access$11(PageContextImpl.java:779)
      org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:761)
      java.security.AccessController.doPrivileged(Native Method)
      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:759)
      org.apache.jsp.index_jsp._jspService(index_jsp.java:125)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:616)
      org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
      java.security.AccessController.doPrivileged(Native Method)
      javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
      org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
      org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)</p>
  
  <p>root cause</p>
  
  <p>java.lang.NoClassDefFoundError: Could not initialize class sun.net.www.protocol.http.HttpURLConnection
      sun.net.www.protocol.http.Handler.openConnection(Handler.java:62)
      sun.net.www.protocol.http.Handler.openConnection(Handler.java:57)
      java.net.URL.openConnection(URL.java:963)
      com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:628)
      com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:189)
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:776)
      com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:741)
      com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
      com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
      com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:288)
      javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
      hiit.audioimager.ImageRetriever.getNopsaImages(ImageRetriever.java:86)
      org.apache.jsp.index_jsp._jspService(index_jsp.java:72)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      java.lang.reflect.Method.invoke(Method.java:616)
      org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
      java.security.AccessController.doPrivileged(Native Method)
      javax.security.auth.Subject.doAsPrivileged(Subject.java:537)
      org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
      org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)</p>