title: NetBeans, JNLP, and ServiceManager permissions
body: <p>I am developing a JNLP (Java Web Start) app in NetBeans.  When I press "Run", the JFrame opens and everything works great.</p>
  
  <p>Now I am adding a feature.  The user must be able to choose a local file.  I understand that I should use this technique:</p>
  
  <pre><code>ServiceManager.lookup("javax.jnlp.FileOpenService")
  </code></pre>
  
  <p>When I add this line to my main class and press "Run", I get the following exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: javax/jnlp/UnavailableServiceException
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
      at java.lang.Class.getMethod0(Class.java:2937)
      at java.lang.Class.getMethod(Class.java:1771)
      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: javax.jnlp.UnavailableServiceException
      at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 6 more
  </code></pre>
  
  <p>How can I use the file service during local testing?</p>
  
  <p>It <em>does</em> work when I build the JAR, upload it to the web, and manually run the JNLP.  What is a better work flow for NetBeans?</p>