title: Error creating bundle cache when starting GlassFish 4 in Eclipse (Linux)
body: <p>When I try to start the GlassFish 4 server from the Servers tab in Eclipse Mars, I get the following error:</p>
  <p><a href="https://i.stack.imgur.com/yINqo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yINqo.png" alt="Problem Occurred" /></a></p>
  <blockquote>
  <p>'Starting GlassFish 4 at localhost [domain1]' has encountered a problem.</p>
  <p>Unable to start server due following issues:<br />
  Launch process failed with exit code 1</p>
  </blockquote>
  <p>In the Console tab, I see the following output:</p>
  <pre><code>Launching GlassFish on Felix platform
  ERROR: Error creating bundle cache. (java.lang.Exception: Unable to create bundle cache lock file: java.io.FileNotFoundException: /home/user/glassfish4/glassfish/domains/domain1/osgi-cache/felix/cache.lock (Permission denied))
  java.lang.Exception: Unable to create bundle cache lock file: java.io.FileNotFoundException: /home/user/glassfish4/glassfish/domains/domain1/osgi-cache/felix/cache.lock (Permission denied)
      at org.apache.felix.framework.cache.BundleCache.&lt;init&gt;(BundleCache.java:168)
      at org.apache.felix.framework.Felix.init(Felix.java:640)
      at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
  Exception in thread &quot;Thread-1&quot; java.lang.RuntimeException: org.osgi.framework.BundleException: Error creating bundle cache.
      at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:90)
  Caused by: org.osgi.framework.BundleException: Error creating bundle cache.
      at org.apache.felix.framework.Felix.init(Felix.java:645)
      at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
  Caused by: java.lang.Exception: Unable to create bundle cache lock file: java.io.FileNotFoundException: /home/user/glassfish4/glassfish/domains/domain1/osgi-cache/felix/cache.lock (Permission denied)
      at org.apache.felix.framework.cache.BundleCache.&lt;init&gt;(BundleCache.java:168)
      at org.apache.felix.framework.Felix.init(Felix.java:640)
      ... 1 more
  Exception in thread &quot;main&quot; java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
      at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:54)
  Caused by: org.glassfish.embeddable.GlassFishException: java.lang.NullPointerException
      at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:170)
      at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:157)
      at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:110)
      at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:112)
      ... 6 more
  ...
  </code></pre>