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

Live Coding (Regression): Warnings when the changing code contains @ConfigProperty #17618

Closed
Sgitario opened this issue Jun 2, 2021 · 4 comments · Fixed by #17798
Closed
Labels
area/config area/user-experience Will make us lose users kind/bug Something isn't working
Milestone

Comments

@Sgitario
Copy link
Contributor

Sgitario commented Jun 2, 2021

Describe the bug

Using DEV mode and live coding activated, given my resource as:

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.eclipse.microprofile.config.inject.ConfigProperty;

@Path("/hello")
public class GreetingResource {

    public static final String PROPERTY = "custom.property.name";

    @ConfigProperty(name = PROPERTY)
    String name;

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String sayHello() {
        return "Hello, I'm " + name;
    }
}

When I run my Quarkus app in DEV mode: mvn quarkus:dev.
And update anything in the GreetingResource, for example, from "Hello" to "Hi", the console prints the following warnings when the changes are detected:

 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2021-06-02 07:49:13,913 INFO  [io.quarkus] (Quarkus Main Thread) getting-started 1.0.0-SNAPSHOT on JVM (powered by Quarkus 999-SNAPSHOT) started in 1.485s. Listening on: http://localhost:8080
2021-06-02 07:49:13,936 INFO  [io.quarkus] (Quarkus Main Thread) Profile dev activated. Live Coding activated.
2021-06-02 07:49:13,937 INFO  [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, resteasy, smallrye-context-propagation]
2021-06-02 07:49:29,055 INFO  [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-0) Changed source files detected, recompiling GreetingResource.java
2021-06-02 07:49:29,478 WARN  [io.qua.dep.dev.JavaCompilationProvider] (vert.x-worker-thread-0) unknown enum constant org.osgi.annotation.bundle.Requirement.Resolution.OPTIONAL
  reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found, line -1 in [unknown source]
2021-06-02 07:49:29,480 WARN  [io.qua.dep.dev.JavaCompilationProvider] (vert.x-worker-thread-0) unknown enum constant org.osgi.annotation.bundle.Requirement.Resolution.OPTIONAL
  reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found, line -1 in [unknown source]
2021-06-02 07:49:29,480 WARN  [io.qua.dep.dev.JavaCompilationProvider] (vert.x-worker-thread-0) unknown enum constant org.osgi.annotation.bundle.Requirement.Resolution.OPTIONAL
  reason: class file for org.osgi.annotation.bundle.Requirement$Resolution not found, line -1 in [unknown source]
2021-06-02 07:49:29,488 INFO  [io.quarkus] (Quarkus Main Thread) getting-started stopped in 0.003s

The warnings are unexpected as far I can tell.
Moreover, no warnings are thrown if we don't use the @ConfigProperty annotation.

Environment (please complete the following information):

GraalVM version (if different from Java)

Quarkus version or git rev

2.X and 999-SNAPSHOT

Additional context

These warnings were not printed using the Quarkus version 1.13.6.Final.

@Sgitario Sgitario added the kind/bug Something isn't working label Jun 2, 2021
@geoand
Copy link
Contributor

geoand commented Jun 2, 2021

This seems to be caused by eclipse/microprofile-config#381.

We can definitely ignore these warnings, or we could provide our own jboss version the Microprofile MP API jars (like we do with Jakarta).
In any case a user should never see these warnings since there is nothing he or she can do about them

cc @radcortez

@geoand geoand added area/user-experience Will make us lose users area/config and removed triage/needs-triage labels Jun 2, 2021
@radcortez
Copy link
Member

Interesting. I've never noticed this before, and I usually play a lot with this kind of changes. Maybe they are there and my brain just ignores that. I'll check.

@radcortez
Copy link
Member

Yes, I can see the warning now. I guess because they show up before the Quarkus logo, they are easy to miss.

What a mess. In my opinion this shouldn't be using any OSGI API, but I guess its too late to change that now. Or at least soon.

Creating a copy of the MP Config API, just seems like a waste of time and effort. @geoand are you in favour if we add a plain ignore for sources starting by org.osgi.annotation.bundle? Or make this configurable to ignore sources that start with a certain namespace?

@geoand
Copy link
Contributor

geoand commented Jun 7, 2021

I think we can start by just ignoring this for now and make it configurable later on if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config area/user-experience Will make us lose users kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants