-
Notifications
You must be signed in to change notification settings - Fork 41
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
JSON views from namespaced controller are not resolved when running from WAR file #200
Comments
I cloned the project and run
|
btw... I don't think your |
Found a new interesting result from my testing, if I run the war file using If I move the war file somewhere else, let's say my home directory, or ~/Downloads then the namespaced controller will throw exception. Actually I found this issue initially when deploying war file into a Google App Engine instance and noticing that all of my namespaced controller keeps throwing exception. |
Thanks for the feedback. |
Apparently this bug affects all deployment in production environment, noticed this when trying to deploy grails app to our staging server (not running war but using traditional deployment with Jetty). Here's some log on a non-namespaced controller:
And here's some log from a namespaced controller, notice
After debugging and setting some breakpoints in the classes, I found that this issue may have originated from
The first line will always remove a single character from the path even if they does not contains any leading forward slash character. This can make the classloader to never found the classname because somehow the Perhaps a better solution for removing the leading slash character is to use regex like: |
pushed a fix to check if path starts with '/' to 2.0.x branch. |
@davydotcom Could you please verify if this is fixed in one of the recent releases, if yes? please attach the milestone and close this issue. |
This probably related with the closed issue #186
Environment
Linux amd64, OpenJDK 1.8.0_192, Grails 3.3.9, Grails View 1.2.9
Steps to reproduce
run-app
/message?text=hello
and/v1/message?text=hello
(they work)grails assemble
java -jar grails-json-view-test-0.1.war
Description
When the grails app is started by
run-app
command, JSON view for namespaced controllers works fine. If the application is started from a war archive somehow the view does not resolve properly, resulting in the exception below:The text was updated successfully, but these errors were encountered: