title: ClassNotFoundException while running web service client generated using wsimport maven goal in eclipse
body: <p>I am developing a web service client in eclipse. I generated the artifacts for the web service using the wsimport goal of maven (see pom.xml below), and then wrote a simple client like this in a main method:</p>
  
  <pre><code>TeamsService service = new TeamsService();
  Teams port = service.getTeamsPort();
  List&lt;Team&gt; teams = port.getTeams();
  for (Team team : teams) {
      System.out.println("Team name: " + team.getName() + " (roster count: " + team.getRosterCount() + ")");
      for (Player player : team.getPlayers())
                  System.out.println(" Player: " + player.getNickname());
  }
  </code></pre>
  
  <p>Unfortunately when I run the project in eclipse as a Java Application I get a ClassNotFoundException. I tried executing the client using the exec:java goal and it worked just fine, so I guess the problem may lie in the eclipse configuration (e.g. m2e plugin, or classpath).</p>
  
  <p>I would really appreciate any help.</p>
  
  <p>P.S: I am a newbie so maybe I am missing something basic here.</p>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.foo&lt;/groupId&gt;
      &lt;artifactId&gt;JWSClients&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
      &lt;dependencies&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;com.sun.xml.ws&lt;/groupId&gt;
              &lt;artifactId&gt;jaxws-rt&lt;/artifactId&gt;
              &lt;version&gt;2.2.8&lt;/version&gt;
              &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jvnet.jax-ws-commons&lt;/groupId&gt;
                  &lt;artifactId&gt;jaxws-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.3&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;wsimport&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
  
                  &lt;configuration&gt;
                      &lt;wsdlUrls&gt;
                          &lt;wsdlUrl&gt;http://localhost:8888/teams?wsdl&lt;/wsdlUrl&gt;
                      &lt;/wsdlUrls&gt;
                      &lt;sourceDestDir&gt;${basedir}/src/main/java&lt;/sourceDestDir&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.7&lt;/source&gt;
                      &lt;target&gt;1.7&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
  
          &lt;/plugins&gt;
  
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.--&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
                      &lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
                      &lt;version&gt;1.0.0&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;lifecycleMappingMetadata&gt;
                              &lt;pluginExecutions&gt;
                                  &lt;pluginExecution&gt;
                                      &lt;pluginExecutionFilter&gt;
                                          &lt;groupId&gt;
                                              org.jvnet.jax-ws-commons
                                          &lt;/groupId&gt;
                                          &lt;artifactId&gt;
                                              jaxws-maven-plugin
                                          &lt;/artifactId&gt;
                                          &lt;versionRange&gt;
                                              [2.3,)
                                          &lt;/versionRange&gt;
                                          &lt;goals&gt;
                                              &lt;goal&gt;wsimport&lt;/goal&gt;
                                          &lt;/goals&gt;
                                      &lt;/pluginExecutionFilter&gt;
                                      &lt;action&gt;
                                          &lt;ignore&gt;&lt;/ignore&gt;
                                      &lt;/action&gt;
                                  &lt;/pluginExecution&gt;
                              &lt;/pluginExecutions&gt;
                          &lt;/lifecycleMappingMetadata&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  
      &lt;properties&gt;
          &lt;encoding&gt;UTF-8&lt;/encoding&gt;
      &lt;/properties&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Stacktrace:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/istack/localization/Localizable
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      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)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      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)
      at com.sun.xml.ws.client.WSServiceDelegate.&lt;init&gt;(WSServiceDelegate.java:208)
      at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:112)
      at javax.xml.ws.Service.&lt;init&gt;(Service.java:77)
      at ch01.team.TeamsService.&lt;init&gt;(TeamsService.java:42)
      at ch01.team.Client.main(Client.java:7)
  Caused by: java.lang.ClassNotFoundException: com.sun.istack.localization.Localizable
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      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)
      ... 29 more
  </code></pre>
  
  <p>Maven log when executing exec:java</p>
  
  <pre><code>[INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building JWSClients 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
  [WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
  [INFO] 
  [INFO] &gt;&gt;&gt; exec-maven-plugin:1.2.1:java (default-cli) @ JWSClients &gt;&gt;&gt;
  [INFO] 
  [INFO] &lt;&lt;&lt; exec-maven-plugin:1.2.1:java (default-cli) @ JWSClients &lt;&lt;&lt;
  [INFO] 
  [INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ JWSClients ---
  Team name: Abbott and Costello (roster count: 2)
   Player: Bud
   Player: Lou
  Team name: Marx Brothers (roster count: 3)
   Player: Chico
   Player: Groucho
   Player: Harpo
  Team name: Burns and Allen (roster count: 2)
   Player: George
   Player: Gracie
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 2.561s
  [INFO] Finished at: Sat Aug 03 16:52:19 COT 2013
  [INFO] Final Memory: 14M/154M
  [INFO] ------------------------------------------------------------------------
  </code></pre>