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

combination of grails.app.context="/" and "grails run-war" doesn't work #31

Closed
JohnM1991 opened this issue Oct 12, 2013 · 5 comments
Closed

Comments

@JohnM1991
Copy link

I don't have a good isolated test case (tried to make one but a seemingly clean grails app with nimble added and cache disabled fails with ClassNotFoundException: grails.plugin.webxml.FilterManager for some reason) nor am I fully certain it is a Nimble problem, but when running my application with "grails run-war" it fails with:

http://localhost:8080/

redirecting to

http://localhost:8080//login?targetUri=home%2Findex

and getting a 404.

When run as "grails run-app" and when the .war is deployed under Tomcat7 it works fine (redirects to "http://localhost:8080/login?targetUri=%2Fhome%2Findex" as expected).

I have

grails.app.context="/"

in Config.groovy which could be at fault because if I set it to "/test" then

http://localhost:8080/test/

redirects to

http://localhost:8080/test/login?targetUri=%2Fhome%2Findex 

as expected.

@snimavat
Copy link
Owner

Can not reproduce,
I tried with grails.app.context="/" and it redirects me to http://localhost:8080/login?targetUri=foo
See NimbleFilterBase.groovy if you want to dig further. NimbleFilterBase.onNotAuthenticated is called when access is denied, and it redirects to login

For ClassNotFoundException: ensure that you have webxml plugin installed, it should be acquired through transitive deps, but still you can try declaring it in plugin dependencies and see how it goes.

Nimble does not have dependency on webxml plugin, i think resources plugin depends on it.

@JohnM1991
Copy link
Author

Thanks for the webxml suggestion, I managed to recreate it on a test app (that doesn't mean it will be reproducible for you, maybe my environment is somehow bad!):

https://dl.dropboxusercontent.com/u/32868579/nimbleTest-bug-report-12102013.zip

Steps:

grails create-app nimbleTest

put

    compile ":nimble:0.5.2"


        compile ":webxml:1.4.1"

and comment

//        compile ':cache:1.1.1'

in BuildConfig.groovy

put

grails.app.context="/"

in Config.groovy

grails run-app

grails jack-be-nimble test TestUser TestProfile

grails run-war

launch http://localhost:8080/ get working home page

click on grails.plugin.nimble.core.UserController

get redirected to http://localhost:8080//login?targetUri=administration%2Fusers%2Flist

shown

HTTP Status 404 - //login

type Status report

message //login

description The requested resource is not available.

Apache Tomcat/7.0.42

@snimavat
Copy link
Owner

Right, It reproduces, Weird, probably some thing related to grails rather thn nimble.
Why would grails redirect to http://localhost:8080//login? for filter.redirect(controller: 'auth', 'action: 'login')

Its a grails bug, should be reproducible for other scenarios as well, try to redirect from a filter to a controller action which has some url mapping like '/foo'

btw: why are you commenting cache plugin, any specific reason ?

@JohnM1991
Copy link
Author

I agree it is not likely a Nimble bug, I just assumed it was initially because I got it on the Nimble redirect. I closed it.

I did not submit a ticket to Grails JIRA BTW (will do later IF I get a clean non-nimble test case).

I commented cache because of GPCACHE-33 for which you provided another, better, workaround of "{ excludes "servlet-api" }" for the nimble plugin include but typing in "//" in front of the cache is less symbols.:)

Thanks for your quick response.

@snimavat
Copy link
Owner

GPCACHE-33 I had a guess :)

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

2 participants