title: Getting an error as "Could not initialize class sun.net.www.protocol.http.HttpURLConnection" in ZK Framework
body: <p>My code is below :</p>
  
  <p><strong>home.zul</strong></p>
  
  <pre><code>&lt;?page title="Home" contentType="text/html;charset=UTF-8"?&gt;
  &lt;zk&gt;
  &lt;window title="Home" border="normal" maximizable="true" height="488px" 
  apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('com.company.login.HomePage')"&gt;
  
   &lt;borderlayout&gt;
  
      &lt;north height="80px"&gt;
          &lt;hlayout&gt;
              &lt;div&gt;
                  &lt;a image="/Image/books.png" id="image" onClick="@command('getImage')"/&gt;
              &lt;/div&gt;
              &lt;space  width="600px"/&gt;
                  &lt;menubar id="menubar" width="100%"  autodrop="true"&gt;
                      &lt;menuitem label="Home" /&gt;
                      &lt;menu label="Library" &gt;
                          &lt;menupopup&gt;
                              &lt;menu label="JAVA"&gt;
                                  &lt;menupopup&gt;
                                  &lt;menuitem label="Method Overloading" /&gt;
                                  &lt;menuitem label="Method Overriding" /&gt;
                                  &lt;menuitem label="Polymorpsim" /&gt;
                                  &lt;/menupopup&gt;
                              &lt;/menu&gt;
                              &lt;menuitem label="C++" /&gt;
                              &lt;menuitem label="C#" /&gt;
                              &lt;menu label="SELENIUM"&gt;
                                  &lt;menupopup&gt;
                                  &lt;menuitem label="Selenium IDE" /&gt;
                                  &lt;menuitem label="Object Identification" /&gt;
                                  &lt;menuitem label="Handling Dynamic Obj" /&gt;
                                  &lt;/menupopup&gt;
                              &lt;/menu&gt;
                          &lt;/menupopup&gt;
                      &lt;/menu&gt;
                      &lt;menuitem label="Contact us" /&gt;
                  &lt;/menubar&gt;
           &lt;/hlayout&gt;
      &lt;/north&gt;
  
      &lt;west width="170px"&gt;
          &lt;vlayout&gt;
              &lt;tree id="tree" &gt;
                  &lt;treecols sizable="true"&gt;
                      &lt;treecol label="Library" /&gt;
                  &lt;/treecols&gt;
  
          &lt;treechildren&gt;
              &lt;treeitem&gt;
                  &lt;treerow&gt;
                      &lt;treecell label="JAVA" /&gt;
                  &lt;/treerow&gt;
                      &lt;treechildren&gt;
                          &lt;treeitem&gt;
                              &lt;treerow&gt;
                                  &lt;treecell&gt; &lt;toolbarbutton   id="click1" label="Method Overloading" &gt;
                                  &lt;attribute name="onClick"&gt;iframe.setSrc("http://www.javatpoint.com/method-overloading-in-java");
  
  
                                  &lt;/attribute&gt;
  
                                   &lt;/toolbarbutton&gt;
                                  &lt;/treecell&gt;
                              &lt;/treerow&gt;
                          &lt;/treeitem&gt;
  
                          &lt;treeitem&gt;
                              &lt;treerow&gt;
                                  &lt;treecell&gt; &lt;toolbarbutton id="click2" label="Method Overriding" &gt;
                                  &lt;attribute name="onClick"&gt;iframe.setSrc("http://www.javatpoint.com/method-overriding-in-java");
  
                                  &lt;/attribute&gt;
                                  &lt;/toolbarbutton&gt;
                                  &lt;/treecell&gt;
                              &lt;/treerow&gt;
                          &lt;/treeitem&gt;
  
                          &lt;treeitem&gt;
                              &lt;treerow&gt;
                                  &lt;treecell&gt; &lt;toolbarbutton id="click3" label="Polymorpsim"&gt;
                                  &lt;attribute name="onClick"&gt;iframe.setSrc("http://www.javatpoint.com/runtime-polymorphism-in-java");
  
                                  &lt;/attribute&gt;
                                  &lt;/toolbarbutton&gt;
                                  &lt;/treecell&gt;
                              &lt;/treerow&gt;
                          &lt;/treeitem&gt;
                      &lt;/treechildren&gt;
                  &lt;/treeitem&gt;
  
  
                      &lt;treeitem&gt;
                          &lt;treerow&gt;
                              &lt;treecell label="C++" /&gt;
                          &lt;/treerow&gt;
                      &lt;/treeitem&gt;
  
  
                      &lt;treeitem&gt;
                          &lt;treerow&gt;
                              &lt;treecell label="C#" /&gt;
                          &lt;/treerow&gt;
                      &lt;/treeitem&gt;
  
              &lt;treeitem&gt;
                  &lt;treerow&gt;
                      &lt;treecell label="SELENIUM" /&gt;
                  &lt;/treerow&gt;
  
                      &lt;treechildren&gt;
                          &lt;treeitem&gt;
                              &lt;treerow&gt;
                                  &lt;treecell&gt; &lt;toolbarbutton id="click4" label="Selenium IDE" &gt;
                                  &lt;attribute name="onClick"&gt;iframe.setSrc("http://www.seleniumhq.org/docs/02_selenium_ide.jsp");&lt;/attribute&gt;
                                  &lt;/toolbarbutton&gt;
                                  &lt;/treecell&gt;
                              &lt;/treerow&gt;
                          &lt;/treeitem&gt;
  
                          &lt;treeitem &gt;
                              &lt;treerow&gt;
                                  &lt;treecell&gt; &lt;toolbarbutton id="click5" label="Object Identification" &gt;
                                  &lt;attribute name="onClick"&gt;iframe.setSrc("http://www.testinginterviewquestion.com/p/object-identification-in-selenium.html");&lt;/attribute&gt;
                                  &lt;/toolbarbutton&gt;
                                  &lt;/treecell&gt;
                              &lt;/treerow&gt;
                          &lt;/treeitem&gt;
  
                          &lt;treeitem &gt;
                              &lt;treerow&gt;
                                  &lt;treecell&gt; &lt;toolbarbutton id="click6" label="Handling Dynamic Obj"  &gt;
                                  &lt;attribute name="onClick"&gt;iframe.setSrc("http://www.testerlogic.com/handling-dynamic-elements-in-selenium-webdriver/");&lt;/attribute&gt;
                                  &lt;/toolbarbutton&gt;
                                  &lt;/treecell&gt;
                              &lt;/treerow&gt;
                          &lt;/treeitem&gt;
                      &lt;/treechildren&gt;
                  &lt;/treeitem&gt;
              &lt;/treechildren&gt;
          &lt;/tree&gt;
      &lt;/vlayout&gt;
  &lt;/west&gt;
  
  
      &lt;south height="30px"&gt;
  
      &lt;/south&gt;
  
      &lt;center&gt;
          &lt;vlayout&gt;
  
          &lt;iframe src="" id="iframe2" scrolling="true" width="50%" height="200px" &gt;&lt;/iframe&gt;
          &lt;iframe src="" id="iframe3" scrolling="true" width="50%" height="200px" &gt;&lt;/iframe&gt;
          &lt;iframe src="" id="iframe4" scrolling="true" width="50%" height="200px" &gt;&lt;/iframe&gt;
          &lt;iframe src="" id="iframe" scrolling="true" width="100%" height="750px" &gt;&lt;/iframe&gt;  
  
  
  
  
  
          &lt;/vlayout&gt;
  
      &lt;/center&gt;
  
       &lt;/borderlayout&gt;
  
    &lt;/window&gt;
    &lt;/zk&gt;
  </code></pre>
  
  <p><strong>HomePage.Java</strong></p>
  
  <pre><code>package com.company.login;
  
  
  
   import org.zkoss.bind.annotation.Command;
   import org.zkoss.zk.ui.Execution;
   import org.zkoss.zk.ui.Executions;
   import org.zkoss.zk.ui.select.annotation.Listen;
  
    public class HomePage {
  
  
  
  
     @Command
      public void getImage(){
  
  
          Executions.sendRedirect("/home.zul");
  
   }
  
  @Listen("onClick = #click1")
  
  
  public void showModal() {
  
      Execution execution = Executions.getCurrent();
      execution.getParameter("myValue");
  
  
      }
  
    }
  </code></pre>
  
  <p>While running the above code I am getting my homepage however when I am trying to click on any link I am getting an error message stating : "<strong>Could not initialize class sun.net.www.protocol.http.HttpURLConnection</strong> "</p>
  
  <p>Please find the below error message:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: Could not initialize class sun.net.www.protocol.http.HttpURLConnection
  at sun.net.www.protocol.http.Handler.openConnection(Unknown Source)
  at sun.net.www.protocol.http.Handler.openConnection(Unknown Source)
  at java.net.URL.openConnection(Unknown Source)
  at org.zkoss.zkex.rt.Runtime.sendError(Unknown Source)
  at org.zkoss.zkex.rt.Runtime.sendError(Unknown Source)
  at org.zkoss.zkex.rt.Runtime.init(Unknown Source)
  at org.zkoss.zkex.init.DesktopInit$RTInfoService.service(Unknown Source)
  at org.zkoss.zk.ui.impl.DesktopImpl.service(DesktopImpl.java:750)
  at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1317)
  at org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:606)
  at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)
  at org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:490)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Please let me know how to proceed further as I am using all the latest jars.</p>