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

for the Tomcat servlet container, context.xml is ignored #128

Open
demonti opened this issue Sep 24, 2019 · 2 comments
Open

for the Tomcat servlet container, context.xml is ignored #128

demonti opened this issue Sep 24, 2019 · 2 comments

Comments

@demonti
Copy link

demonti commented Sep 24, 2019

While gretty detects the presence of a context.xml file in the WAR file at the expected location, I was puzzled that it had no effect. While searching on the net, found an unresolved issue akhikhl#415 in the old gretty repository (akhikhl/gretty). Digging further, I found out with my lousy Groovy knowledge that in TomcatServerConfigurer.groovy a member variable of the "context" variable called "configFile" is populated by either the path to the context.xml file included in the WAR or by the path given in the gretty configuration. However, I did not find any location in the code where this variable is read and processed, i.e. given to Tomcat for further interpreting the content. This explains the observed behaviour. It would be nice if you could fix this.

@demonti
Copy link
Author

demonti commented Sep 25, 2019

Ah, I now see that I misunderstood the code. "context" already seems to be the respective Tomcat object that is getting initialized. So it is obviously correct that I could not find any further use of "configFile". Nevertheless, it still seems that the setting is without any effect. Therefore I leave the issue open for now.

@jkachika
Copy link

I was able to set the context for farm with the following:

farm {
    webapp([contextConfigFile:project(':project-name').file("context.xml-filename").absolutePath], 'war-file-path')
}

Not sure if it helps but I was struggling to make the container pickup the context while running it from the farm

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