我在使用RESTEasy提供的客戶端框架調用RESTful webservice時遇到了一些問題。當我嘗試註冊ResteasyProviderFactory時,我得到了一個ClassCastException,沒有更多的工作。Glassfish中的ResteasyProviderFactory異常
下面的代碼:
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;
和異常:
java.lang.ClassCastException: com.sun.jersey.server.impl.provider.RuntimeDelegateImpl cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory
我使用Glassfish的3.0.1和2.2.1 RestEasy的。
我通過網絡搜索,但發現沒有解決方案或沒有相關的信息就此。 如果有人有解決方案或其他方式做到這一點,請幫助我!
在此先感謝
我走了很多關於研究之和我沒有發現任何東西沒用,只是解決辦法,這並不工作也是如此。我認爲在這種情況下切換澤西島RestEasy是更好的選擇。 – irobson 2011-12-01 12:15:34