我知道thorntail已经过时并且不再受支持,但此时不使用它对我来说并不是一个真正的选择。
2021-05-04 18:25:16,353 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Undertow - STABLE io.thorntail:undertow:2.7.0.Final
2021-05-04 18:25:16,374 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Logging - STABLE io.thorntail:logging:2.7.0.Final
2021-05-04 18:25:16,374 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: JAX-RS - STABLE io.thorntail:jaxrs:2.7.0.Final
2021-05-04 18:25:16,375 INFO [org.wildfly.swarm] (main) THORN0013: Installed fraction: Elytron - STABLE io.thorntail:elytron:2.7.0.Final
2021-05-04 18:25:19,311 INFO [org.jboss.msc] (main) JBoss MSC version 1.4.11.Final
2021-05-04 18:25:19,323 INFO [org.jboss.threads] (main) JBoss Threads version 2.3.3.Final
2021-05-04 18:25:19,446 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0049: Thorntail 2.7.0.Final (WildFly Core 10.0.3.Final) starting
2021-05-04 18:25:19,680 INFO [org.wildfly.swarm] (MSC service thread 1-2) THORN0019: Install MSC service for command line args: []
2021-05-04 18:25:20,378 INFO [org.wildfly.security] (ServerService Thread Pool -- 3) ELY00001: WildFly Elytron version 1.10.4.Final
2021-05-04 18:25:20,712 INFO [org.jboss.as.security] (ServerService Thread Pool -- 13) WFLYSEC0002: Activating Security Subsystem
2021-05-04 18:25:20,716 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 18) WFLYNAM0001: Activating Naming Subsystem
2021-05-04 18:25:20,720 INFO [org.jboss.as.security] (MSC service thread 1-1) WFLYSEC0001: Current PicketBox version=5.0.3.Final
2021-05-04 18:25:20,741 INFO [org.xnio] (ServerService Thread Pool -- 11) XNIO version 3.7.3.Final
2021-05-04 18:25:20,762 INFO [org.jboss.as.naming] (MSC service thread 1-2) WFLYNAM0003: Starting Naming Service
2021-05-04 18:25:20,791 INFO [org.xnio.nio] (ServerService Thread Pool -- 11) XNIO NIO Implementation Version 3.7.3.Final
2021-05-04 18:25:20,844 INFO [org.wildfly.extension.io] (ServerService Thread Pool -- 11) WFLYIO001: Worker 'default' has auto-configured to 24 core threads with 192 task threads based on your 12 available processors
2021-05-04 18:25:20,847 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0003: Undertow 2.1.3.Final starting
2021-05-04 18:25:20,866 INFO [org.jboss.as.jaxrs] (ServerService Thread Pool -- 14) WFLYRS0016: RESTEasy version 3.11.2.Final
2021-05-04 18:25:20,961 INFO [org.wildfly.extension.undertow] (MSC service thread 1-7) WFLYUT0012: Started server default-server.
2021-05-04 18:25:21,034 INFO [org.wildfly.extension.undertow] (MSC service thread 1-8) WFLYUT0006: Undertow HTTP listener default listening on 0.0.0.0:8080
2021-05-04 18:25:21,156 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2021-05-04 18:25:21,160 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: Thorntail 2.7.0.Final (WildFly Core 10.0.3.Final) started in 1919ms - Started 99 of 105 services (22 services are lazy, passive or on-demand)
2021-05-04 18:25:21,630 INFO [org.wildfly.swarm.runtime.deployer] (main) deploying film.war
2021-05-04 18:25:21,674 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "film.war" (runtime-name: "film.war")
2021-05-04 18:25:22,522 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.module.service."deployment.film.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.film.war".main: WFLYSRV0179: Failed to load module: deployment.film.war
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:116)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http
at org.jboss.modules.Module.addPaths(Module.java:1266)
at org.jboss.modules.Module.link(Module.java:1622)
at org.jboss.modules.Module.relinkIfNecessary(Module.java:1650)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:299)
at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:283)
at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:93)
... 8 more
2021-05-04 18:25:22,529 ERROR [org.jboss.as.controller.management-operation] (main) WFLYCTL0013: Operation ("add") failed - address: (("deployment" => "film.war")) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.film.war\".main" => "WFLYSRV0179: Failed to load module: deployment.film.war
Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http"}}
2021-05-04 18:25:22,530 ERROR [org.jboss.as.server] (main) WFLYSRV0021: Deploy of deployment "film.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.film.war\".main" => "WFLYSRV0179: Failed to load module: deployment.film.war
Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http"}}
2021-05-04 18:25:22,543 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028: Stopped deployment film.war (runtime-name: film.war) in 11ms
2021-05-04 18:25:22,547 ERROR [stderr] (main) org.wildfly.swarm.container.DeploymentException: org.wildfly.swarm.container.DeploymentException: THORN0004: Deployment failed: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.film.war\".main" => "WFLYSRV0179: Failed to load module: deployment.film.war
2021-05-04 18:25:22,547 ERROR [stderr] (main) Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http"}}
2021-05-04 18:25:22,547 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:301)
2021-05-04 18:25:22,548 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:174)
2021-05-04 18:25:22,548 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:107)
2021-05-04 18:25:22,548 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer$Proxy$_$$_WeldClientProxy.deploy(Unknown Source)
2021-05-04 18:25:22,548 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.deploy(Swarm.java:476)
2021-05-04 18:25:22,549 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.main(Swarm.java:747)
2021-05-04 18:25:22,549 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-05-04 18:25:22,549 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-05-04 18:25:22,549 ERROR [stderr] (main) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-05-04 18:25:22,550 ERROR [stderr] (main) at java.lang.reflect.Method.invoke(Method.java:498)
2021-05-04 18:25:22,550 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:57)
2021-05-04 18:25:22,550 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.run(Main.java:134)
2021-05-04 18:25:22,550 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.main(Main.java:87)
2021-05-04 18:25:22,551 ERROR [stderr] (main) Caused by: org.wildfly.swarm.container.DeploymentException: THORN0004: Deployment failed: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.film.war\".main" => "WFLYSRV0179: Failed to load module: deployment.film.war
2021-05-04 18:25:22,551 ERROR [stderr] (main) Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http"}}
2021-05-04 18:25:22,551 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:296)
2021-05-04 18:25:22,552 ERROR [stderr] (main) ... 12 more
2021-05-04 18:25:22,555 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0008: Undertow HTTP listener default suspending
2021-05-04 18:25:22,559 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0007: Undertow HTTP listener default stopped, was bound to 0.0.0.0:8080
2021-05-04 18:25:22,570 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) WFLYUT0004: Undertow 2.1.3.Final stopping
2021-05-04 18:25:22,594 INFO [org.jboss.as] (MSC service thread 1-5) WFLYSRV0050: Thorntail 2.7.0.Final (WildFly Core 10.0.3.Final) stopped in 35ms
2021-05-04 18:25:22,716 ERROR [stderr] (main) org.wildfly.swarm.container.DeploymentException: org.wildfly.swarm.container.DeploymentException: THORN0004: Deployment failed: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.film.war\".main" => "WFLYSRV0179: Failed to load module: deployment.film.war
2021-05-04 18:25:22,716 ERROR [stderr] (main) Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http"}}
2021-05-04 18:25:22,716 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:301)
2021-05-04 18:25:22,717 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:174)
2021-05-04 18:25:22,717 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:107)
2021-05-04 18:25:22,717 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer$Proxy$_$$_WeldClientProxy.deploy(Unknown Source)
2021-05-04 18:25:22,718 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.deploy(Swarm.java:476)
2021-05-04 18:25:22,718 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.main(Swarm.java:747)
2021-05-04 18:25:22,718 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-05-04 18:25:22,719 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-05-04 18:25:22,719 ERROR [stderr] (main) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-05-04 18:25:22,719 ERROR [stderr] (main) at java.lang.reflect.Method.invoke(Method.java:498)
2021-05-04 18:25:22,720 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:57)
2021-05-04 18:25:22,720 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.run(Main.java:134)
2021-05-04 18:25:22,721 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.main(Main.java:87)
2021-05-04 18:25:22,721 ERROR [stderr] (main) Caused by: org.wildfly.swarm.container.DeploymentException: THORN0004: Deployment failed: {"WFLYCTL0080: Failed services" => {"jboss.module.service.\"deployment.film.war\".main" => "WFLYSRV0179: Failed to load module: deployment.film.war
2021-05-04 18:25:22,721 ERROR [stderr] (main) Caused by: org.jboss.modules.ModuleNotFoundException: java.net.http"}}
2021-05-04 18:25:22,721 ERROR [stderr] (main) at org.wildfly.swarm.container.runtime.RuntimeDeployer.deploy(RuntimeDeployer.java:296)
2021-05-04 18:25:22,722 ERROR [stderr] (main) ... 12 more
2021-05-04 18:25:22,722 ERROR [stderr] (main) java.lang.IllegalStateException: zip file closed
2021-05-04 18:25:22,722 ERROR [stderr] (main) at java.util.zip.ZipFile.ensureOpen(ZipFile.java:669)
2021-05-04 18:25:22,723 ERROR [stderr] (main) at java.util.zip.ZipFile.getEntry(ZipFile.java:309)
2021-05-04 18:25:22,723 ERROR [stderr] (main) at java.util.jar.JarFile.getEntry(JarFile.java:240)
2021-05-04 18:25:22,723 ERROR [stderr] (main) at java.util.jar.JarFile.getJarEntry(JarFile.java:223)
2021-05-04 18:25:22,723 ERROR [stderr] (main) at org.jboss.modules.JarFileResourceLoader.getJarEntry(JarFileResourceLoader.java:187)
2021-05-04 18:25:22,724 ERROR [stderr] (main) at org.jboss.modules.JarFileResourceLoader.getClassSpec(JarFileResourceLoader.java:130)
2021-05-04 18:25:22,724 ERROR [stderr] (main) at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:330)
2021-05-04 18:25:22,724 ERROR [stderr] (main) at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
2021-05-04 18:25:22,725 ERROR [stderr] (main) at org.jboss.modules.Module.loadModuleClass(Module.java:731)
2021-05-04 18:25:22,725 ERROR [stderr] (main) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
2021-05-04 18:25:22,725 ERROR [stderr] (main) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
2021-05-04 18:25:22,725 ERROR [stderr] (main) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
2021-05-04 18:25:22,726 ERROR [stderr] (main) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
2021-05-04 18:25:22,726 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.stop(Swarm.java:438)
2021-05-04 18:25:22,726 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.tryToStopAfterStartupError(Swarm.java:779)
2021-05-04 18:25:22,727 ERROR [stderr] (main) at org.wildfly.swarm.Swarm.main(Swarm.java:756)
2021-05-04 18:25:22,727 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2021-05-04 18:25:22,727 ERROR [stderr] (main) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2021-05-04 18:25:22,727 ERROR [stderr] (main) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2021-05-04 18:25:22,728 ERROR [stderr] (main) at java.lang.reflect.Method.invoke(Method.java:498)
2021-05-04 18:25:22,728 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:57)
2021-05-04 18:25:22,728 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.run(Main.java:134)
2021-05-04 18:25:22,729 ERROR [stderr] (main) at org.wildfly.swarm.bootstrap.Main.main(Main.java:87)
对httpCLient的调用是这样的:
package api.model;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.function.Supplier;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
public class TMDB_Caller {
//variables
private String apiKey;
private int pageSize = 20;
//connstracteur---------------------------------------------------------------------------------------------------
public TMDB_Caller(String apiKey) {
super();
this.apiKey = apiKey;
}
/////////// Genres /////////////
//listAllGenres_uri-------------------------------------------------------------------------------------------------
public String listAllGenres_uri() {
//https://api.themoviedb.org/3/genre/movie/list?api_key=3aacfef6a62a872d2a4717b9b6cd5283&language=en-US
return "https://api.themoviedb.org/3/genre/movie/list?api_key="+apiKey+"&language=en-US";
}
//getAllGenres()----------------------------------------------------------------------------------------------------
public List<Genre> getAllGenres() throws IOException, InterruptedException {
String uri = listAllGenres_uri();
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(uri))
.build();
HttpResponse<Supplier<AllGenresBody>> response = client.send(request, new JsonBodyHandler<>(AllGenresBody.class));
Supplier<AllGenresBody> allGenres_result = response.body();
String genres_str = allGenres_result.get().genres.toPrettyString();
ObjectMapper mapper = new ObjectMapper();
List<Genre> genreList = mapper.readValue(genres_str, new TypeReference<List<Genre>>() {});
return genreList;
}
}
模块的pom.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>api</groupId>
<artifactId>app</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>api</groupId>
<artifactId>film</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>film</name>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
<version.thorntail>2.7.0.Final</version.thorntail>
<skip-docker-build>false</skip-docker-build>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom-all</artifactId>
<version>${version.thorntail}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.thorntail}</version>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20210307</version>
</dependency>
</dependencies>
</project>
父级的 pom 是:
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>api</groupId>
<artifactId>app</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>api</groupId>
<artifactId>user</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>user</name>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
<version.thorntail>2.7.0.Final</version.thorntail>
<skip-docker-build>false</skip-docker-build>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.2.20</version>
</dependency>
<dependency>
<groupId>io.thorntail</groupId>
<artifactId>bom-all</artifactId>
<version>${version.thorntail}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.thorntail}</version>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>api.model.App</mainClass>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
网上经常出现的“解决方案”是将 jboss-deployment-struct.xml 文件添加到 WEB-INF 中,其中包含以下内容:
<?xml version="1.0"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="java.net.http"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
但这并没有解决问题,我找到了 java.net.http 仍处于孵化器阶段时的早期建议,但这也没有解决问题。我想我的问题是如何解决这个问题?我在网上找到的任何东西都没有真正起作用/适用于我的情况。
我还需要提供更多额外信息吗?
<configuration>
<webResources>
<resource>
<directory>$/film/src/main/webapp/WEB-INF</directory>
<targetPath>WEB-INF</targetPath>
<includes>
<include>**/jboss-deployment-structure.xml</include>
</includes>
</resource>
</webResources>
</configuration>
之后:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin
</artifactId>
</plugin>
pom 的一部分并修复了它。受到这个答案的启发:
我为新的 JBoss version 7.2
JBoss version 7.4