尝试在 Spring WebFlux 中注入 Light4j 中间件处理程序,但在 handler.yml 中定义的端点在被邮递员击中时显示“错误”:“未找到” 。文档中提到的示例是 servlet 即同步方式,而不是 Reactive 即异步
任何建议如何解决这个问题?
我的pom.xml是
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.5.0</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.dummy.project</groupId> <artifactId>dummymanagement</artifactId> <version>0.0.1-SNAPSHOT</version> <name>DummyManagement</name> <description>Project for Dummy Management</description> <properties> <java.version>1.8</java.version> <version.light-4j>1.5.21</version.light-4j> <version.undertow>2.0.11.Final</version.undertow> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> <version>2.5.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>io.projectreactor</groupId> <artifactId>reactor-test</artifactId> <scope>test</scope> </dependency> <!-- For local caching --> <dependency> <groupId>com.github.ben-manes.caffeine</groupId> <artifactId>caffeine</artifactId> <version>2.8.0</version> </dependency> <!-- For generating random uuid for different purposes --> <dependency> <artifactId>java-uuid-generator</artifactId> <groupId>com.fasterxml.uuid</groupId> <version>3.1.4</version> </dependency> <!-- For swagger --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> <version>2.4.5</version> </dependency> <!-- https://mvnrepository.com/artifact/javax.persistence/javax.persistence-api
--> javax.persistence javax.persistence-api 2.2
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.20</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api --> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>5.2.4.Final</version> </dependency> <dependency> <artifactId>maven-javadoc-plugin</artifactId> <exclusions> <exclusion> <artifactId>slf4j-jdk14</artifactId> <groupId>org.slf4j</groupId> </exclusion> <exclusion> <artifactId>slf4j-nop</artifactId> <groupId>org.slf4j</groupId> </exclusion> <exclusion> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </exclusion> </exclusions> <groupId>org.apache.maven.plugins</groupId> <version>2.9.1</version> </dependency> <dependency> <groupId>com.networknt</groupId> <artifactId>config</artifactId> <version>${version.light-4j}</version> </dependency> <dependency> <groupId>com.networknt</groupId> <artifactId>utility</artifactId> <version>${version.light-4j}</version> </dependency> <dependency> <groupId>com.networknt</groupId> <artifactId>security</artifactId> <version>${version.light-4j}</version> </dependency> <dependency> <groupId>com.networknt</groupId> <artifactId>client</artifactId> <version>${version.light-4j}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-undertow</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> <groupId>org.apache.maven.plugins</groupId> <version>3.8.1</version> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.6.0</version> <executions> <execution> <goals> <goal>java</goal> </goals> </execution> </executions> <configuration> <mainClass>com.mmt.bot.App</mainClass> <systemProperties> <systemProperty> <key>config.resource</key> <value>application.dev.conf</value> </systemProperty> </systemProperties> </configuration> </plugin> <plugin> <groupId>org.sonarsource.scanner.maven</groupId> <artifactId>sonar-maven-plugin</artifactId> <version>3.4.0</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <argLine>${jacoco.agent.ut.arg}</argLine> <testFailureIgnore>false</testFailureIgnore> </configuration> </plugin> <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <version>0.7.8</version> <executions> <execution> <id>default-instrument</id> <goals> <goal>instrument</goal> </goals> </execution> <execution> <id>default-restore-instrumented-classes</id> <phase>process-test-classes</phase> <goals> <goal>restore-instrumented-classes</goal> </goals> </execution> <execution> <id>prepare-ut-agent</id> <phase>process-test-classes</phase> <goals> <goal>prepare-agent</goal> </goals> <configuration> <propertyName>jacoco.agent.ut.arg</propertyName> <append>true</append> </configuration> </execution> </executions> </plugin> </plugins> </build> </project>