Multiple matching properties for name security.jaxrs.deny-unannotated-endpoints

847 views
Skip to first unread message

Clifton Mtengezo

unread,
Mar 1, 2021, 4:30:28 AM3/1/21
to Quarkus Development mailing list
Team,

I am new to quarkus. I am getting an exception when I compile my project with mvn compile quarkus:dev command

The exception is as follows:

2021-03-01 11:16:25,927 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: java.lang.RuntimeException: java.lang.IllegalArgume
ntException: Multiple matching properties for name "security.jaxrs.deny-unannotated-endpoints" property was matched by both public boolean io.quarkus.
resteasy.reactive.common.runtime.JaxRsSecurityConfig.denyJaxRs and public boolean io.quarkus.resteasy.runtime.JaxRsSecurityConfig.denyJaxRs. This is l
ikely because you have an incompatible combination of extensions that both define the same properties (e.g. including both reactive and blocking datab
ase extensions)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:308)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:182)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:59)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:80)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:379)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:57)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:128)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:81)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:144)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:63)

My POM is as follows:

<?xml version="1.0"?>
    <modelVersion>4.0.0</modelVersion>
    <groupId>mw.co.natbank</groupId>
    <artifactId>chatbotportal</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <properties>
        <compiler-plugin.version>3.8.1</compiler-plugin.version>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus-plugin.version>1.11.2.Final</quarkus-plugin.version>
        <quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
        <quarkus.platform.version>1.11.2.Final</quarkus.platform.version>
        <surefire-plugin.version>2.22.1</surefire-plugin.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-reactive</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-jwt-build</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-jwt</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-context-propagation</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus-plugin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>${surefire-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                                <configuration>
                                    <systemPropertyVariables>
                                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                                        <maven.home>${maven.home}</maven.home>
                                    </systemPropertyVariables>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
        </profile>
    </profiles>
</project>

And my resource is as follows:

package mw.co.natbank.chatbotportal.resources;

import io.smallrye.mutiny.Uni;
import javax.enterprise.context.RequestScoped;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.SecurityContext;
import mw.co.natbank.chatbotportal.interfacemodels.NBMETSResponse;
import mw.co.natbank.chatbotportal.interfacemodels.NBMETSResponseService;
import org.eclipse.microprofile.jwt.JsonWebToken;

@Path("/register")
@RequestScoped
public class Register {

    @Inject
    JsonWebToken jwt;
    
    @Inject
    NBMETSResponseService service;

    @GET
    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN})
    public Uni<NBMETSResponse> hello(@Context SecurityContext ctx) {
        System.out.println("Hitting endpoint...");
        return service.greeting("clifton");
    }

}

Georgios Andrianakis

unread,
Mar 1, 2021, 4:34:14 AM3/1/21
to tiko.m...@gmail.com, Quarkus Development mailing list
Hi,

You can't quarkus-resteasy-jackson alongside with quarkus-resteasy-reactive.
Either use quarkus-resteasy-jackson or quarkus-resteasy-reactive-jackson. quarkus-resteasy-reactive is problematic with the first and unnecessary with the second.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/2d829a7a-5ea3-47af-a073-59f62c865084n%40googlegroups.com.

Paul Carter-Brown

unread,
Mar 1, 2021, 4:34:33 AM3/1/21
to tiko.m...@gmail.com, Quarkus Development mailing list
Assuming you are using the reactive resteasy module, change quarkus-resteasy-jackson to quarkus-resteasy-reactive-jackson

On Mon, Mar 1, 2021 at 11:30 AM Clifton Mtengezo <tiko.m...@gmail.com> wrote:
--

Clifton Mtengezo

unread,
Mar 1, 2021, 4:43:06 AM3/1/21
to Quarkus Development mailing list
Team,
Thank you, your suggestions have worked.

Clifton Mtengezo

unread,
Mar 1, 2021, 4:59:59 AM3/1/21
to Quarkus Development mailing list
Team, 

I am getting the exception below. Is it because I am now using quarkus-resteasy-reactive-jackson? Now my dependencies are as follows: 

   <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-reactive-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-jwt-build</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-jwt</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-context-propagation</artifactId>
        </dependency>
    </dependencies>


dException: Build failure: Build failed due to errors
        [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found
 2 deployment problems:
[1] Unsatisfied dependency for type javax.servlet.http.HttpServletRequest and qualifiers [@Default]
        - java member: mw.co.natbank.chatbotportal.resources.AuthorizationHeaderPresenceCheckFilter#request
        - declared on CLASS bean [types=[javax.ws.rs.container.ContainerRequestFilter, mw.co.natbank.chatbotportal.resources.AuthorizationHeaderPresen
ceCheckFilter, java.lang.Object], qualifiers=[@Default, @Any], target=mw.co.natbank.chatbotportal.resources.AuthorizationHeaderPresenceCheckFilter]
[2] Unsatisfied dependency for type javax.servlet.http.HttpServletRequest and qualifiers [@Default]
        - java member: mw.co.natbank.chatbotportal.resources.AuthorisedIPFilter#request
        - declared on CLASS bean [types=[javax.ws.rs.container.ContainerRequestFilter, mw.co.natbank.chatbotportal.resources.AuthorisedIPFilter, java.
lang.Object], qualifiers=[@Default, @Any], target=mw.co.natbank.chatbotportal.resources.AuthorisedIPFilter]

Paul Carter-Brown

unread,
Mar 1, 2021, 5:04:42 AM3/1/21
to tiko.m...@gmail.com, Quarkus Development mailing list
If you are using servlets then you need undertow:

<dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-undertow</artifactId>
        </dependency>

Georgios Andrianakis

unread,
Mar 1, 2021, 5:05:16 AM3/1/21
to tiko.m...@gmail.com, Quarkus Development mailing list
Sounds like a question for StackOverflow :)

Clifton Mtengezo

unread,
Mar 1, 2021, 5:21:04 AM3/1/21
to Quarkus Development mailing list
I am sorry for asking these questions here. I don't know what type of questions should be asked on this forum. Please guide to avoid wasting your time.

I am grateful to you all for the support you rendered. After adding the dependency which I removed in my frantic search for a solution to the initial problem, the project has compiled successfully.

Regards

Reply all
Reply to author
Forward
0 new messages