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
No qualifying bean of type [org.springframework.security.oauth2.provider.token.store.JdbcTokenStore] using docker-compose #4009
Comments
I'm not sure of what you are doing: you want to develop within Docker? Are you using our jhipster/jhipster Docker image? |
i want to test running application inside docker (use case updated). when i just run using gradle bootRun it just work, however when i use docker image generated from jhipster which located at src/main/docker (app.yml, mysql.yml etc) it can't wire JdbcTokenStore. All configuration within db is work and liquibase migration is success. |
Thanks for updating your use case!
-> could you send the whole stacktrace? |
Unable to reproduce
{
"generator-jhipster": {
"jhipsterVersion": "3.6.1",
"baseName": "myapp",
"packageName": "com.myapp.myapp",
"packageFolder": "com/myapp/myapp",
"serverPort": "8080",
"authenticationType": "oauth2",
"hibernateCache": "hazelcast",
"clusteredHttpSession": "hazelcast",
"websocket": "spring-websocket",
"databaseType": "sql",
"devDatabaseType": "mysql",
"prodDatabaseType": "mysql",
"searchEngine": "elasticsearch",
"buildTool": "gradle",
"useSass": true,
"applicationType": "monolith",
"testFrameworks": [
"gatling",
"cucumber",
"protractor"
],
"jhiPrefix": "jhi",
"enableTranslation": true,
"nativeLanguage": "en",
"languages": [
"en"
],
"enableSocialSignIn": false
}
}
See the log:
|
I also can't reproduce it, I have the same output as @pascalgrimaud |
Thanks for the response!
|
Can you provide us your entities plz ? |
I don't believe Spring would behave differently in Docker than with 'gradle bootRun'. |
@jdubois : I generate the project inside jhipster/jhipster image, then generate the entities (uml attached below), i run gradle bootRun on my localhost and connect to local mysql, everything fine. Just get the error when running the app using all generated docker image (app, mysql, elasticsearch, sonar). @pascalgrimaud here are my schema, i change mysql version to 5.7.13 as workaround because 5.7.14 can't have 2 timestamp column (from zonedatetime) in one table by default :
|
Unable to reproduce with your entities. All my steps:
|
@tsaqova , in your log, I see this error below, maybe it's worth investigating.
|
@gmarziou : no, these 2 lines are missing. Here my logs for myapp-mysql:
|
@tsaqova : I saw in your logs
Maybe it's connected to old containers. Can you delete these containers and let docker-compose recreate them? You should have this instead:
|
I've delete the container. All my steps:
But if i just run mysql container from mysql.yml, and point my datasource to it and gradle bootRun (in my local) dev/prod profile, it's work! Here are my full stack trace :
|
i try to run using java -jar app.war in the build folder in my local and get the error too. |
finally i can inject jdbctoken store by adding a Bean to OAuth2ServerConfiguration
or change the @Inject JdbcTokenStore at UserService to TokenStore and cast to JdbcTokenStore at deleteUser function. Maybe JdbcTokenStore not readed as a bean but strange here is when running with gradle bootRun it just work. |
@tsaqova you can't have a difference in the Spring configuration between "bootRun", running as a War, and running in Docker. They should all be the same, unless you have found a bug in our packaging. |
@tsaqova : I try once again, with exact steps like you and everything is OK
2 possibilities:
|
@jdubois yeah that is not the root cause of the problem, i'll try to find the root cause later. Thanks all for your response. Great team. |
Overview of the issue
When i run application using docker-compose app.yml (default) with following config:
i get an error :
No qualifying bean of type [org.springframework.security.oauth2.provider.token.store.JdbcTokenStore]
inside UserService classbut if i run using gradle bootRun it just work as usual.
Motivation for or Use Case
Can''t running application inside docker.
Reproduce the error
ERROR
I try to create a bean with type JdbcTokenStore but the error still exist.
JHipster Version(s)
fresh 3.6.1
JHipster configuration, a
.yo-rc.json
file generated in the root folderOperating System
Linux
The text was updated successfully, but these errors were encountered: