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.
Here's the code:
    RegisterBuiltin.register(ResteasyProviderFactory.getInstance());
    LifeGoalClient leClient = ProxyFactory.create(LifeGoalClient.class, "http://localhost:8080/TutorFinanceiro");
    List<LifeGoal> lifeGoals = leClient.getLifeGoals();
    JOptionPane.showMessageDialog(null, lifeGoals);
    return lifeGoals;
And the exception:
    java.lang.ClassCastException: com.sun.jersey.server.impl.provider.RuntimeDelegateImpl cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory
I'm using Glassfish 3.0.1 and Resteasy 2.2.1.
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!
Thanks in advance
I did force resteasy over jersey in glassfish by adding a file named javax.ws.rs.ext.RuntimeDelegate in the class path at "META-INF/services", wich contain only the following line : org.jboss.resteasy.spi.ResteasyProviderFactory
However, for me, all seemed to work fine until I try to use resteasy-cdi. Adding that last artifact to my dependencies and configuring the required context-param did dig up the same classcast problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With