I want to use Keycloak 18 with my Spring boot 2.7.2 version. I can run & config Keycloak in a docker container (bitnami/keycloak:18), and finally I've got token by Postman. And then I tried to configure Spring boot by https://www.baeldung.com/spring-boot-keycloak . When I start SB I've got an error:
Failed to load URLs from http://localhost:48080/auth/realms/XXX/.well-known/openid-configuration
java.lang.Exception: Not Found
where XXX is an existing realm.
I think so something is changed in Keycloak 18.
Has somebody a working example with Spring boot & keycloak?
thx
Zamek
Finally I found it:
In application.properties I used
keycloak.auth-server-url=http://localhost:48080/auth
but it needs
keycloak.auth-server-url=http://localhost:48080
Related
I'm currently upgrading an application from Spring Boot 2.7.7 to Spring Boot 3.0.2 and hit a 404 at the tomcat.
The interesting thing is that the application works fine on my local machine, but not in the Azure Cloud.
I have the log-level set to DEBUG for org.springframework.web and with Spring Boot 2.7.7 I see the call received in the logs (on Azure) for actuator/info, whereas in Spring Boot 3 I see the application starting successfully but then no further logs.
Any ideas what it could be or what I can try out to debug further?
The problem is related to a change in Tomcat version in Spring 2.7.8 (and therefore also Spring Boot 3.x) in relation to the Java-Agent used in Docker / within Azure.
Update to the latest java-agent version in the Docker-Image:
DockerFile
FROM eclipse-temurin:17
COPY "myBuiltApplication.jar" "app.jar"
ADD "https://github.com/microsoft/ApplicationInsights-Java/releases/download/**3.4.8**/applicationinsights-agent-*3.4.8*.jar" "agent.jar"
EXPOSE 80
ENTRYPOINT [ "java", "-javaagent:agent.jar", "-jar", "app.jar"]
Make sure that no other agent is active from Azure
I had to remove the JAVA_TOOL_OPTIONS and StartupBootstrapper from the docker run:
- docker run -d --expose=80 --name myapp
JAVA_TOOL_OPTIONS=-javaagent:/agents/java/applicationinsights-agent-codeless.jar -e StartupBootstrapper=Microsoft.ApplicationInsights.StartupBootstrapper -e
I experienced the same issue with Spring Boot version 2.7.8 with the exact same behavior: Starting the app local in IDE as well as starting the docker image locally worked perfect. When running this image in Azure as an App Service no http call is going to spring. For me it looks like Tomcat has an issue as the 404 seems to be produced by Tomcat.
Downgrading to Spring Boot 2.7.7 fixed the issue again.
I have a prometheus which is up on a container on docker windows using docker desktop .
I have a spring boot app which is on a container on docker in windows also .
I won't to monitor the spring boot app .
this is my file prometheus.yml :
but when running the prometheus container i'm getting an endpoint target like this even if my spring boot container is up :
Please note that in my spring boot app i'm using actuator , and without dockerizing it i could monitor it .
please help!
I have followed this guide to deploy the spring boot application in wildfly version 23.0.2 Final. War file is successfully deployed.
But when I try to access through context root it shows Access to 127.0.0.1 was denied error.
What am I missing ?
I created hello world Spring Boot v2.0.0.M7 app, added actuator, enabled shutdown and it isn't working.
application.properties
server.port=8082
endpoint.shutdown.enabled=true
endpoint.shutdown.sensitive=false
health works fine
but not the shutdown
What am I doing wrong?
Endpoints have changed quite a bit in Spring Boot 2.0 and, as a result, your configuration is out of date. You need to enable the endpoint and also expose it over HTTP:
management.endpoints.web.expose=*
management.endpoint.shutdown.enabled=true
As already noted in the comments, and described in the Actuator HTTP API documentation, you also need to make a POST request so accessing the endpoint in your browser won't work. You can use something like curl on the command line instead:
$ curl -X POST localhost:8080/actuator/shutdown
You can learn more about changes in Spring Boot 2.0 by reading the release notes.
spring boot version : 2.0.1.RELEASE
pom.xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
application.properties
management.endpoints.web.exposure.include=shutdown
management.endpoint.shutdown.enabled=true
then, try
$ curl -X POST localhost:8080/actuator/shutdown
spring-boot 2.0 default
management.endpoints.web.exposure.include=info, health,
change to
management.endpoints.web.exposure.include=info, health, shutdown
I installed Spring boot CLI on Windows 7 but, I use a proxy. I would like to know how to configure proxy with Spring boot. I set the variable JAVA_OPTS with -Dhttp.proxyHost=proxyhostURL and
-Dhttp.proxyPort=proxyPortNumber but I have received the message :
"startup failed : General error during connection ..." after the command "spring run myscript.groovy".
I use jdk 1.7.0_51 and spring boot 1.0.0RC3.
Thanks in advance !
It looks like a known bug and there's a fix on github
Not sure if it's released yet tho...