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

Qute - Bean instance for localized interface not found #19617

Closed
SLedunois opened this issue Aug 24, 2021 · 11 comments · Fixed by #23473
Closed

Qute - Bean instance for localized interface not found #19617

SLedunois opened this issue Aug 24, 2021 · 11 comments · Fixed by #23473
Labels
area/devmode area/qute The template engine kind/bug Something isn't working
Milestone

Comments

@SLedunois
Copy link

SLedunois commented Aug 24, 2021

Describe the bug

Using github action or maven docker, the @MessageBundle is not packaged and throw an exception :

2021-08-24 15:04:55,075 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.lang.IllegalStateException: Bean instance for localized interface not found: interface fr.uptimr.i18n.AppMessages

Expected behavior

@MessageBundle should always packaged.

Actual behavior

@MessageBundle is not bundled except with using the quarkus cli tool and mvnw.

How to Reproduce?

Using the default github action: https://github.com/SLedunois/uptimr/runs/3401245346#step:5:2370

You can clone the code - branch env - and launch with :

docker-compose up -d postgres
docker-compose up server

The message bundle is here: https://github.com/SLedunois/uptimr/blob/env/src/main/java/fr/uptimr/i18n/AppMessages.java and uses properties messages : https://github.com/SLedunois/uptimr/tree/env/src/main/resources/messages

Output of uname -a or ver

docker

Output of java -version

openjdk 11

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.1.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

docker-compose up server

Additional information

No response

@SLedunois SLedunois added the kind/bug Something isn't working label Aug 24, 2021
@SLedunois SLedunois changed the title Bean instance for localized interface not found Qute - Bean instance for localized interface not found Aug 24, 2021
@famod famod added area/qute The template engine and removed triage/needs-triage labels Aug 24, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 24, 2021

/cc @mkouba

@mkouba
Copy link
Contributor

mkouba commented Aug 26, 2021

Just to be clear - mvn quarkus:dev works just fine but the problem occurs if you attempt to run the maven from a docker image, mount the current dir as a working dir and execute mvn quarkus:dev from the container image, right?

@SLedunois
Copy link
Author

Hi @mkouba

Yes indeed. It occurs when I launch quarkus using maven:3.8-jdk11 image with the following configuration:

  server:
    container_name: uptimr-server
    image: maven:3.8-jdk-11
    working_dir: /usr/src/app
    volumes:
      - "./:/usr/src/app"
    command: mvn compile quarkus:dev
    ports:
      - "8080:8080"
    links:
      - postgres

And launching with docker-compose up server.

@SLedunois
Copy link
Author

Any update of it ? It also happens on github action context.

@mkouba
Copy link
Contributor

mkouba commented Sep 6, 2021

I have no idea what happens. I'm not even sure this is something that is supported.

CC @aloubyansky @gastaldi

@gastaldi
Copy link
Contributor

gastaldi commented Sep 6, 2021

I believe you need to build the docker image first and then run docker-compose using the built docker image.

  • Add the container-image-docker extension to your project:
./mvnw quarkus:add-extension -Dextensions="container-image-docker"
  • Build the docker image:
./mvnw clean package -Dquarkus.container-image.build=true

See https://quarkus.io/guides/container-image#building

@SLedunois
Copy link
Author

Hi @gastaldi
This also happens on github CI env on default "Quarkus Codestart CI" github action. See: https://github.com/SLedunois/uptimr/runs/3518422708#step:5:2465

@SLedunois
Copy link
Author

I believe you need to build the docker image first and then run docker-compose using the built docker image.

  • Add the container-image-docker extension to your project:
./mvnw quarkus:add-extension -Dextensions="container-image-docker"
  • Build the docker image:
./mvnw clean package -Dquarkus.container-image.build=true

See https://quarkus.io/guides/container-image#building

This can't works for me because it's the verify maven goal that is throwing the previous error. However, building the image application an running it still throw the error:

uptimr-server | 2021-09-21 09:05:22,013 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.IllegalStateException: Bean instance for localized interface not found: interface fr.uptimr.i18n.AppMessages

@SLedunois
Copy link
Author

Any update on this issue ?

1 similar comment
@pipinet
Copy link

pipinet commented Nov 22, 2021

Any update on this issue ?

@pipinet
Copy link

pipinet commented Nov 24, 2021

#21672

mkouba added a commit to mkouba/quarkus that referenced this issue Feb 7, 2022
- there was a missing validation that a localized file conflicts with
the locale of the default message bundle interface
- fixes quarkusio#19617
@quarkus-bot quarkus-bot bot added this to the 2.8 - main milestone Feb 8, 2022
@gsmet gsmet modified the milestones: 2.8 - main, 2.7.3.Final Feb 28, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Feb 28, 2022
- there was a missing validation that a localized file conflicts with
the locale of the default message bundle interface
- fixes quarkusio#19617

(cherry picked from commit 86aeeb1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devmode area/qute The template engine kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants