How to resolve “You have not started an Objectify context” in JUnit?

后端 未结 5 778
旧巷少年郎
旧巷少年郎 2021-01-17 16:55

I\'ve got some Objectify test code running in JUnit and I\'m getting this error:

java.lang.IllegalStateException: You have not started an Objectify context.          


        
5条回答
  •  死守一世寂寞
    2021-01-17 17:53

    I also had this issue and noticed that I had not added the ObjectifyFilter to my web.xml

    
        ObjectifyFilter
        com.googlecode.objectify.ObjectifyFilter
    
    
        ObjectifyFilter
        /*
    
    

    I also had to include Objectify and guava jars in my WEB-INF>lib directory and include them in my build path.

提交回复
热议问题