Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockHttpServletRequest Exception on Production mode only #38

Open
uris77 opened this issue Jun 21, 2013 · 6 comments
Open

MockHttpServletRequest Exception on Production mode only #38

uris77 opened this issue Jun 21, 2013 · 6 comments

Comments

@uris77
Copy link

uris77 commented Jun 21, 2013

I'm getting this exception on production mode only:

org.springframework.mock.web.MockHttpServletRequest. Stacktrace follows:
java.lang.ClassNotFoundException: org.springframework.mock.web.MockHttpServletRequest

It works fine on development mode.

@uris77
Copy link
Author

uris77 commented Jun 21, 2013

BTW, this is the rest of the stack trace:

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2451)
    at java.lang.Class.getDeclaredMethods(Class.java:1810)
    at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
    at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
    at grails.plugin.gson.converters.GSON.render(GSON.groovy:57)
    at grails.plugin.gson.api.ArtefactEnhancer$_enhanceControllers_closure1.doCall(ArtefactEnhancer.groovy:29)
    at introcloud.AttendeeMeetingRequestController$_renderList_closure4_closure5.doCall(AttendeeMeetingRequestController.groovy:39)
    at introcloud.AttendeeMeetingRequestController.renderList(AttendeeMeetingRequestController.groovy:36)
    at introcloud.AttendeeMeetingRequestController.list(AttendeeMeetingRequestController.groovy:16)
    at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
    at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)

This only happens when I use

render aList as GSON

@robfletcher
Copy link
Owner

I'm trying to replicate this issue with the test application. For instance the AlbumController class uses the render method. I run the app up using grails prod run-app then hit curl http://localhost:8080/albums which does render Album.list(params) as GSON in the controller. Everything's working for me. Is there something else that could be missing here?

@uris77
Copy link
Author

uris77 commented Jun 22, 2013

Try it with

grails prod run-war

It is what we used to replicate it in our dev environment.

@robfletcher
Copy link
Owner

When I try that I get a StackOverflowError!

On Saturday, June 22, 2013, Roberto Guerra wrote:

Try it with

grails prod run-war

It is what we used to replicate it in our dev environment.


Reply to this email directly or view it on GitHubhttps://github.com//issues/38#issuecomment-19856735
.

@felipebremer
Copy link

I had this problem too.
I solved this problem, adding in my dependencies this plugin:
runtime ("org.springframework:spring-test:2.5")
After add this and generate the war, all is ok.

@ppazos
Copy link

ppazos commented Jul 27, 2015

Solution worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants