Quarkus error after compiling native with Jaeger Tracing - java

I am trying to compile an application in Quarkus Native and monitor it using Jaeger Traicing, however, I am encountering a problem that when compiling it is taking the wrong url and not the one I should use to work with opentracing:
Example application.properties file:
quarkus.datasource.db-kind=oracle
quarkus.datasource.jdbc.driver=io.opentracing.contrib.jdbc.TracingDriver
quarkus.datasource.jdbc.url=jdbc:tracing:oracle:thin:#172.28.2.134:1522/IVR
quarkus.datasource.username=${USERNAME_CONNECTION_BD:xxxxxxxxxxxxx}
quarkus.datasource.password=${PASSWORD_CONNECTION_BD:xxxxxxxxxx}
quarkus.http.port=${PORT:8082}
quarkus.http.ssl-port=${PORT-SSl:8083}
quarkus.jaeger.service-name=find-puk-code-tracing
quarkus.jaeger.sampler-type=const
quarkus.jaeger.sampler-param=1
quarkus.jaeger.endpoint=${URL_JAEGER:http://10.161.169.24:14268/api/traces}
quarkus.native.add-all-charsets=true
quarkus.swagger-ui.path=/api/FindPukCodeBS/swagger-ui
quarkus.smallrye-openapi.path=/api/FindPukCodeBS/swagger
quarkus.swagger-ui.always-include=true
Locally it works wonderfully, but when I deploy at the kubernetes level it is not taking the url correctly, as follows::
quarkus.datasource.jdbc.url=jdbc:tracing:oracle:thin:#172.28.2.134:1522/IVR
In the logs that appear to me it seems to take the url without the word tracing, however as you can see at the log level it prints the url that is being passed in the application.properties:
That could be happening? I don't understand, and I don't have the value burned anywhere, I'm taking it directly from the application.properties.

Related

How I can deploy Quarkus on GCP?

I have a big problem, I want to send my backend to Google Cloud Run however, I get the following error when I follow this tutorial for the jvm part: https://quarkus.io/guides/deploying-to-google-cloud#deploying-to-google-cloud-run
ERROR: (gcloud.run.deploy) The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.
I tried to defined this variable in my application.yml : quarkus.http.port: 8080 but it still doesn't work :(
If you have any advice, I am interested, thank you very much
Look at https://github.com/cescoffier/polycloud-demo/blob/main/src/main/resources/application.properties.
This is part of a demo deploying on Google Cloud Run. As you can see, the port is configured using:
quarkus.http.port=${PORT:8080}
Also, make sure your application starts correctly. If there is an issue during the startup, the port is not opened.

io.smallrye.mutiny.TimeoutException after adding quarkus.vault. to application.propperties

I'm writing my first bigger Quarkus Applications. Using maven and Java 11, on Windows.
At the moment, I'm trying to make it more secure. I Implemented Authentication using smallrey jwt and that worked fine. Now I'm trying to secure my application.properties by saving the secrets and keys inside a Hashicrop Vault.
I followed this guide to implement this. It´s working fine until the compilation part. If I try to compile after adding these lines to my application.property
# vault url
quarkus.vault.url=http://localhost:8200
quarkus.vault.kv-secret-engine-version=2
# vault authentication
quarkus.vault.authentication.client-token=xxx
# path within the kv secret
quarkus.vault.secret-config-kv-path=test
And try to compile it wit mvn quarkus:dev. I get this error:
ERROR: Failed to start application (with profile dev)
io.smallrye.mutiny.TimeoutException
at
io.smallrye.mutiny.operators.uni.UniBlockingAwait.await(UniBlockingAwait.java:58)
at io.smallrye.mutiny.groups.UniAwait.atMost(UniAwait.java:61)
at
io.quarkus.vault.runtime.client.VertxVaultClient.exec(VertxVaultClient.java:161)
at
io.quarkus.vault.runtime.client.VertxVaultClient.exec(VertxVaultClient.java:146)
at
io.quarkus.vault.runtime.client.VertxVaultClient.get(VertxVaultClient.java:127)
Link to the complete log. I'm a bit lost and can't read anything meaningful out of the error log, so I'm not sure where to look for the wrong configuration.
I'm not trying to access anything inside the vault at the moment.

Spring MVC - missing variable from URI named "path"

I have created application from Jhipster's template,
I have changed almost nothing in the project and it's working fine on local machine but when I deploy it to my server (ubuntu, apache, tomcat - all are the last versions) weird things start to happen.
I have AJAX call to "/api/account" which on local machine get's in response the following json
{
"timestamp":1440703613150,
"status":401,
"error":"Unauthorized",
"message":"Access Denied",
"path":"/api/account"
}
and on the production server (you can check it here) same call get's json WITHOUT "path" field in it
{
"timestamp":1440703613150,
"status":401,
"error":"Unauthorized",
"message":"Access Denied"
}
I stuck on this for long period of time, so, please help me if you can :)
As you have an Apache front-end, have a look at your mod_http_proxy settings, ProxyPass and ProxyPassReverse.
You should also have a look at your Apache logs.
Or disable Apache and access JHipster directly, so you know if this is caused by Apache or not.
I can't see why this would be an issue.
Your setup is probably different somehow, if you want to have same setup the best is to use the executable jar embedding TOmcat rather than deploying it to a server.
Are you running in prod profile for both your local machine and production server?

Catch a configuration error in Play! Framework 2.0.4

My Play! 2.0.4 web application currently connects to several RDS MySQL databases, with the configuration file as such:
# Africa
db.afr.url="jdbc:mysql://<africa-server>:3306/users"
db.afr.driver=com.mysql.jdbc.Driver
db.afr.user=user1
db.afr.password=****
db.afr.logStatements=true
# Europe
db.eur.url="jdbc:mysql://<europe-server>:3306/users"
db.eur.driver=com.mysql.jdbc.Driver
db.eur.user=user1
db.eur.password=****
db.eur.logStatements=true
This works perfectly, while all the databases are running. However, if one of the databases is down (for whatever reason) the entire application fails, throwing a Configuration error (Cannot connect to databases [afr]).
How would I catch the Configuration Error on startup to catch and ignore/log these messages instead of killing the server completely? I've looked into using Global.java's onError() override but I'm having no luck there.
Thanks,
David
Here's what I ended up doing. Not a great solution but an OK work-around maybe.
Copy the contents of play.api.db.BoneCPPlugin to your own file SafeDBPlugin.scala with class name SafeDBPlugin. It needs to be in the package play.api.db (though you can put the file anywhere you want in your code base as usual). The important part is changing the line in method onStartup() that reports the config error and changing that to say logger.warn().
Disable the built-in dbplugin (BoneCPPlugin) by adding the following line to your application.conf:
dbplugin=disabled
Add your new plugin by adding the following line to play.plugins:
600:play.api.db.SafeDBPlugin

Cannot debug Java Web application from Netbeans

I have a Java EE 5 application which consists of three web projects. I'm using JBoss 5.1 web server and NetBeans 7.2 IDE.
I have the following problems:
I cannot start application in Debug mode. That I know of, there are two (best) approaches in NetBeans and Java: Remote debugging and debugging via shared memory. I read this post How to debug JBOSS application in netbeans? and I set debug parameters in Jboss configuration(I also know there are different parameter sets for shared memory and remote debugging), but when I go to attach debugger I got following errors:
If I use remote debugging I got error "Connection refused";
If I use shared memory I got error similar to this text "dt_shmem:file path could not be found".
These errors occur when I start JBoss by running run.bat file. If I start JBoss from Netbeans IDE, I can attach to remote process (still have problem with shared memory approach), but then I have other problems, regarding variable primitives and model binding in page life cycle (I will not write about that now).
How can I solve these problems so I can debug application? At least, how can I find a better error message when it fails. I could not find too much on the Net by looking for "Connection refused" error only.
Why I cannot just press run main project(or web project) and that netbeans start application, open it in new browser tab(as localhost) and start debug mode? I'm coming from .net background and VS is offering this as out of the box tool (called ASP .NET development server). Why I have to use external web server and with every change deploy new application and then attach to it? Why Netbeans cannot by default use JVM for running application, and later when I deploy application I will choose which web server to use!?
I hope someone will make this clear to me :)
Thanks
added Note at 03.01.2013.
Well, when I changed VM options in project.properties file of web project (added run.args.extra=-J-Xms256m -J-Xmx756m), I succeeded to debug application and heat breakpoint when executing the code. However, I still have strange problem with Managed Bean properties. I have select list on page, and it is connected to Boolean property. When nothing is selected it should be set to null value by default (and it is when I start JBoss server by running run.bat file), but its value is by default set to false! I checked parameters post values in firebug and there is no problem in posting parameters to bean. It looks to me that problem is when JSF framework is trying to map post values to Managed Beans properties, but I cannot find out why this is happening. I also checked faces-config.xml, but did not find any specific rule for mapping to this specific property. Any tips?

Categories

Resources