[jboss-user] [JBoss Web Services] - Error with registering a RESTeasy Providerfactory

M Longman do-not-reply at jboss.com
Mon Feb 25 13:34:42 EST 2013


M Longman [https://community.jboss.org/people/tamuren] created the discussion

"Error with registering a RESTeasy Providerfactory"

To view the discussion, visit: https://community.jboss.org/message/799444#799444

--------------------------------------------------------------
Hi,

I get the following error:


java.lang.ClassCastException: com.sun.jersey.server.impl.provider.RuntimeDelegateImpl cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory at org.jboss.resteasy.spi.ResteasyProviderFactory.getInstance(ResteasyProviderFactory.java:330) at de.webshop.test.util.RegisterResteasy.register(RegisterResteasy.java:11) at de.webshop.test.BestellverwaltungTest.setup(BestellverwaltungTest.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:617) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) 




After I run this code: 


*package* de.webshop.test.util;   *import* org.jboss.resteasy.plugins.providers.RegisterBuiltin; *import* org.jboss.resteasy.spi.ResteasyProviderFactory;   *public* *abstract* *class* RegisterResteasy { *private* *static* *boolean* registered = *false*;   *public* *static* *void* register() { *if* (!registered) { ResteasyProviderFactory resteasyProviderFactory = ResteasyProviderFactory.getInstance(); RegisterBuiltin.register( resteasyProviderFactory ); registered = *true*; } } } 




What can be the reason ? Thanks for help in advance. And don't just say 'You're mixing Jersey and Resteasy', I don't know what that means and there's no Jersey dependencies in my pom.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/799444#799444]

Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2044]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130225/4d65b1fd/attachment.html 


More information about the jboss-user mailing list