Comments (5)
Anything interesting logged?
from gretty.
These are the only parts logged that caught my eye.
INFO: Starting Servlet Engine: Apache Tomcat/9.0.7
Oct 31, 2018 11:12:33 AM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
11:12:34 DEBUG START: context=/Maintenance, pipeline: StandardPipeline[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Maintenance]] #438760853
11:12:34 DEBUG valves:
11:12:34 DEBUG NonLoginAuthenticator[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Maintenance]] #1170152270
11:12:34 DEBUG StandardContextValve[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Maintenance]] #278898914
from gretty.
If anyone has a minimal project to reproduce this, please share.
from gretty.
This is also happening in Gretty v3.04. In my case, I'm using Tomcat 9 and need to set up a DataSourceRealm so that the users are read from a DB. I came up with a working configuration that runs as expected when I deploy the WAR file in an external Tomcat instance but running the app with Gretty gives me the Tomcat's 503 error page instead of the configured login page when I try to access a secured page.
I looked at the docs and found that there's a section about Tomcat security realms. Here is described how to set up a MemoryRealm, which is backed by a tomcat-users.xml
file. I gave it a try so I commented out my DataSourceRealm and followed the instructions on that web page which basically consists on adding realm 'auth'
to the gretty configuration in build.gradle
and adding a tomcat-users.xml
with a couple users in my project's root dir (since this is one of the default locations). That done, everything worked as expected. The next step was to figure out how to make it work with the DataSourceRealm.
What I did next was to uncomment my DataSourceRealm in my local context file and removed the tomcat-users.xml
file since I don't need it, right? The result was: I got Tomcat's 503 error page again when trying to access a secured resource. Then, after scratching my head for a while, I put the tomcat-users.xml
file back and tomcat-users.xml
though. I think this is misleading behavior (probably an issue) since, if there's a tomcat-users.xml
file, the normal expectation would be, imo, that those users are the ones available.
Last thing I tried was to remove realm 'auth'
from gretty config in build.gradle
but keeping the tomcat-users.xml
file and, to my surprise, the DataSourceRealm kept working. So, it seems that the tomcat-users.xml
is being used as a decide factor for whether setting up a Realm. This seems and issue to me and also seems to me that documentation could be improved. I don't really think we should provide a tomcat-users.xml
file for enabling the usage of a different Realm.
Hope this helps @alamakih @javabrett
from gretty.
@arcesino - thanks for the detailed report. I see that tomcat-users.xml
is mentioned a few times in ProjectUtils.groovy and especially concerning some realms. Perhaps that's why you observe this behavior?
In any case, a PR for updating the documentation and/or fixing the issue will be appreciated. :)
from gretty.
Related Issues (20)
- For a non spring boot application, gretty is complaining for spring boot dependency HOT 1
- Error "CONTAINER_JAR_PATTERN" with Gretty 4.0.0 HOT 4
- Remove Groovy-based Logging Configuration from Gretty HOT 2
- Configuring the way the server is stopped HOT 4
- Gretty ignoring the JDK set from the Toolchain HOT 3
- Overlay dependency leakage. Causes needed jars to be missing from war. HOT 3
- Remove usage of deprecated WarPluginConvention HOT 2
- Support Jetty 10 HOT 9
- Unable to build project using gretty version 2.3.1 HOT 5
- support slf4j-api:2.0.3 HOT 5
- Unable to use appRun with Tomcat 9 after updating to Gradle 7.5.1 and Gretty 3.0.8 HOT 2
- Not able to run the app using Gretty 4.0.3 in combination with JDK17 and Gradle 7.5.1. HOT 2
- Wrong warning about missing slf4j provider HOT 1
- Gretty 3.0.8+ is incompatible with Proguard `7.3.0` HOT 4
- Cannot inject Tomcat DBCP 2 library in Gretty 3.1.0 via dependencies/gretty HOT 4
- Gretty always configures the `war` task
- Some logger properties missing when upgrading from 3.0.6 to 3.1.1 HOT 6
- Update Documentation on Gretty Logging HOT 1
- No such property: CONTAINER_JAR_PATTERN for class: org.eclipse.jetty.webapp.MetaInfConfiguration HOT 4
- Gradle 8 deprecation warnings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gretty.