title: Launching eclipse application with java web start generates java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
body: <p>I have an Eclipse application, for which I created the feature for generating the jnlp file.
  I built the application with maven tycho, for architectures x86 and x86_64.</p>
  
  <p>When I try to start the jnlp for the application, I see that all the resources are downloaded, but the application does not start. If I try to open it in a broswer, it starts. I checked the logs for the first case and I got the following:</p>
  
  <pre><code>eclipse.buildId=unknown
  java.version=1.6.0_26
  java.vendor=Sun Microsystems Inc.
  BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
  Framework arguments:  -clientno=01 -StartupLogo=false -mode=3 -sessionid=7110AAD90803F34A9B01CD66A676E0ED.ASES01 -ServletDir=/SES/ -Port=8080 -host=172.20.224.138 -auth=tftttttttttt -Lang=de_DE -user=taris -Protocol=http
  Command-line arguments:  -clientno=01 -StartupLogo=false -mode=3 -sessionid=7110AAD90803F34A9B01CD66A676E0ED.ASES01 -ServletDir=/SES/ -Port=8080 -host=172.20.224.138 -auth=tftttttttttt -Lang=de_DE -user=taris -Protocol=http
  
  !ENTRY org.eclipse.osgi 4 0 2012-05-28 15:56:46.999
  !MESSAGE An error occurred while automatically activating bundle org.eclipse.ui.workbench (20).
  !STACK 0
  org.osgi.framework.BundleException: The activator org.eclipse.ui.internal.WorkbenchPlugin for bundle org.eclipse.ui.workbench is invalid
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
      at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
      at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:299)
      at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:440)
      at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:268)
      at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)
      at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:463)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
      at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:400)
      at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClassCond(Unknown Source)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass
  [....]
  
  Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
      at java.lang.Class.getConstructor0(Unknown Source)
      at java.lang.Class.newInstance0(Unknown Source)
      at java.lang.Class.newInstance(Unknown Source)
      at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:166)
      ... 78 more
  Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError
      at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
      at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
      at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 84 more
  </code></pre>
  
  <p>Here is the part of the pom for generating the resources:</p>
  
  <pre><code>&lt;plugin&gt;
              &lt;groupId&gt;org.eclipse.tycho&lt;/groupId&gt;
              &lt;artifactId&gt;target-platform-configuration&lt;/artifactId&gt;
              &lt;version&gt;${tycho-version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;resolver&gt;p2&lt;/resolver&gt;
                                      &lt;ignoreTychoRepositories&gt;true&lt;/ignoreTychoRepositories&gt;
                  &lt;environments&gt;
                      &lt;environment&gt;
                          &lt;os&gt;win32&lt;/os&gt;
                          &lt;ws&gt;win32&lt;/ws&gt;
                          &lt;arch&gt;x86&lt;/arch&gt;
                      &lt;/environment&gt;
                      &lt;environment&gt;
                          &lt;os&gt;win32&lt;/os&gt;
                          &lt;ws&gt;win32&lt;/ws&gt;
                          &lt;arch&gt;x86_64&lt;/arch&gt;
                      &lt;/environment&gt;
                  &lt;/environments&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
  </code></pre>
  
  <p>I did check that the resources are referenced in the jnlp file:</p>
  
  <pre><code>&lt;resources os="Windows" arch="x86"&gt;
  &lt;jar href="plugins/org.eclipse.swt.win32.win32.x86_3.7.2.v3740f.jar"/&gt;
  </code></pre>
  
  <p>
  
      
  </p>
  
  <p>I also checked the cache and the resources are downloaded.</p>
  
  <p>I just can't find a reason for the application not starting with Java web start, when there are no problems with starting it direcly in the browser.</p>
  
  <p>Any help is appreciated!</p>