java.lang.NoClassDefFoundError: javax/el/PropertyNotFoundException when I send invalid values to controller

后端 未结 4 2153
你的背包
你的背包 2021-02-07 22:54

I use MockMvc for my controller testing

@Test
    public void updateEvent() throws Exception{
        MockHttpServletRequestBuilder request = MockMvcRequestBuild         


        
4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-07 23:37

    I met the same problem, Add the following dependency resolved this problem.

    When you met javax/el/PropertyNotFoundException, That means you missed el-api dependency, you can add the following jar

        
            javax.el
            el-api
            2.2
            provided
        
    

    or

    
      javax.el
      javax.el-api
      3.0.0
      test
    
    

    Then you met ClassNotFoundException:com.sun.el.ExpressionFactoryImpl , You missed el-impl jar:

    
      org.glassfish.web
      el-impl
      2.2
      test
    
    

提交回复
热议问题