Announcement Announcement Module
Collapse
No announcement yet.
REST and MVC - exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • REST and MVC - exception

    Today i downloaded an example of Spring MVC and REST from github.com/nebhale/spring-one-2012.
    When i build project with maven i get errors in the test phrase.


    Exceptions was thrown in GamesControllerTest and GamesControllerIntegrationTest
    Each error has the same reason


    java.lang.NoSuchMethodError: org.springframework.mock.web.MockFilterChain.<init >(Ljavax/servlet/Servlet;[Ljavax/servlet/FilterV
    at org.springframework.test.web.servlet.MockMvcBuilde rSupport.createMockMvc(MockMvcBuilderSupport.java: 59)
    at org.springframework.test.web.servlet.setup.Default MockMvcBuilder.build(DefaultMockMvcBuilder.java:19 4)
    at com.nebhale.letsmakeadeal.web.GamesControllerTest. <init>(GamesControllerTest.java:55)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:525)
    at org.junit.runners.BlockJUnit4ClassRunner.createTes t(BlockJUnit4ClassRunner.java:187)
    at org.junit.runners.BlockJUnit4ClassRunner$1.runRefl ectiveCall(BlockJUnit4ClassRunner.java:236)
    at org.junit.internal.runners.model.ReflectiveCallabl e.run(ReflectiveCallable.java:15)
    at org.junit.runners.BlockJUnit4ClassRunner.methodBlo ck(BlockJUnit4ClassRunner.java:233)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild( BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner. java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRu nner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentR unner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRu nner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRu nner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.ja va:300)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunn erWithArgs(JUnit4IdeaTestRunner.java:76)
    at com.intellij.rt.execution.junit.JUnitStarter.prepa reStreamsAndStart(JUnitStarter.java:195)
    at com.intellij.rt.execution.junit.JUnitStarter.main( JUnitStarter.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:57)
    at com.intellij.rt.execution.application.AppMain.main (AppMain.java:120)




    In myproject I changed imports from
    org.springframework.test.web.servlet[...]
    to
    org.springframework.test.web.mock.servlet[...]
    because compiler cant find classes.

    I dont know how to deal with it. Please help me

  • #2
    Hi BigMax,

    I ran into the same issue and I wrote a blog about it: http://www.java-producties.nl/2013/0...th-rest-shell/

    Comment

    Working...
    X