Hi, Sergey

I spotted couple of configuration issues in spring context, most notably I
wrongly used the implementation class instead of interface declaration in
jaxrs:client section. Now changed to interface.

About moving @Path and @GET (in fact @POST is being used), they were already
in the interface declaration. 

Also, I tried to remove @Transactional from endpoint. The final result I got
so far is a different stack trace (no mention of CGLIB). Here it is:

java.lang.ClassCastException: java.lang.Class cannot be cast to
javax.ws.rs.core.Response
        at $Proxy124.createHelloWorld(Unknown Source)
        at
endpoint.it.AdvKeywordSetEndpointIT.testCreateHelloWorld(HelloWorldEndpointIT.java:47)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
        at
org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
        at
org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
        at
org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
        at
org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
        at
org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
        at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
        at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
        at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
        at 
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
        at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
        at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
        at
org.apache.maven.surefire.booter.SurefireBooter.run(SurefireBooter.java:241)
        at
org.codehaus.mojo.failsafe.IntegrationTestMojo.execute(IntegrationTestMojo.java:555)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at 
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:110)





Sergey Beryozkin-5 wrote:
> 
> Hi
> 
> It looks like the issue is caused either by the fact that CGLIB is being
> used on the client side or by Spring adding a proxy wrapper
> (@Transactional)
> or by the combination of both factors.
> I'd appreciate you helping me with narrowing down the cause and I'll then
> fix it before 2.2.9 gets released as I'm short of time right now.
> So please try first :
> - create a HelloService interface and then move @Path and @GET annotations
> to that interface - this should result in no CGLIB involved; try
> with/without @Transactional
> 
> thanks, Sergey
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ClassCastException-prevents-thorough-endpoint-testing-tp28719118p28733956.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to