title: ResteasyProviderFactory exception in Glassfish
body: <p>I'm having some trouble invoking a RESTful webservice using the Client Framework provided by RESTEasy. When I try to register the ResteasyProviderFactory I got a ClassCastException and nothing more works.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>    RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
      LifeGoalClient leClient = ProxyFactory.create(LifeGoalClient.class, "http://localhost:8080/TutorFinanceiro");
      List&lt;LifeGoal&gt; lifeGoals = leClient.getLifeGoals();
      JOptionPane.showMessageDialog(null, lifeGoals);
      return lifeGoals;
  </code></pre>
  
  <p>And the exception: </p>
  
  <pre><code>    java.lang.ClassCastException: com.sun.jersey.server.impl.provider.RuntimeDelegateImpl cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory
  </code></pre>
  
  <p>I'm using Glassfish 3.0.1 and Resteasy 2.2.1.</p>
  
  <p>I searched through the web but found no solution or no relevant info in respect to this.
  If anyone have a solution or an alternative way of doing this, please help me!</p>
  
  <p>Thanks in advance</p>