title: CXF rest client not working with JAXRSServerFactoryBean
body: <p>I want to create a rest client using CXF. The following code throws exceptions</p>
  
  <pre><code>JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
          sf.setResourceClasses(Blogger.class);
          sf.getInInterceptors().add(new LoggingInInterceptor());
          sf.getOutInterceptors().add(new LoggingOutInterceptor());
          sf.setAddress("http://myservice");
          Map&lt;Object, Object&gt; mappings = new HashMap&lt;Object, Object&gt;();
          mappings.put("xml", "application/xml");
          mappings.put("json", "application/json");
          sf.setExtensionMappings(mappings);
          sf.create();
  </code></pre>
  
  <p>The exception I got is</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: javax/ws/rs/WebApplicationException
      at com.test.LoggingTest.main(LoggingTest.java:26)
  Caused by: java.lang.ClassNotFoundException: javax.ws.rs.WebApplicationException
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      ... 1 more
  </code></pre>