Jboss eap 7.0 无法部署 .war 文件并一次又一次地重新启动部署

Jboss eap 7.0 failing to deploy .war file and restarting deployment again and again

我想要 运行 一个简单的 java 应用程序,它正在从前端 (extjs) 向 Java 进行休息调用。虽然在成功构建 maven 后启动服务器,但 .war 没有部署。我的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 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.repo</groupId>
  <artifactId>DocumentTracker</artifactId>
  <packaging>war</packaging>
  <version>1</version>
  <name>DT Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>42.1.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
    <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>2.2.1.GA</version>
            <scope>provided</scope>
        </dependency>
  </dependencies>
  <!-- <build>
    <finalName>DT</finalName>
  </build> -->
</project>

我在 运行ning jboss eap 7.0 之后在我的控制台上收到以下信息并且无法解决它。

 23:09:07,832 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-4) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
23:09:08,305 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 69) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:85)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:231)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.run(UndertowDeploymentService.java:82)
    ... 6 more
Caused by: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login
    at org.jboss.resteasy.spi.metadata.ResourceBuilder.constructor(ResourceBuilder.java:692)
    at org.jboss.resteasy.plugins.server.resourcefactory.POJOResourceFactory.registered(POJOResourceFactory.java:42)
    at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:208)
    at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:194)
    at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:180)
    at org.jboss.resteasy.core.ResourceMethodRegistry.addResourceFactory(ResourceMethodRegistry.java:157)
    at org.jboss.resteasy.core.ResourceMethodRegistry.addPerRequestResource(ResourceMethodRegistry.java:76)
    at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:404)
    at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:245)
    at org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap.contextInitialized(ResteasyBootstrap.java:28)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:198)
    ... 8 more

23:09:08,313 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "DocumentTracker-1.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./DocumentTracker-1" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login
    Caused by: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login
    Caused by: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login"}}
23:09:08,368 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 37) WFLYSRV0010: Deployed "DocumentTracker-1.war" (runtime-name : "DocumentTracker-1.war")
23:09:08,381 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003190: Could not find constructor for class: com.repo.rest.Login

23:09:08,511 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
23:09:08,513 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
23:09:08,513 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: JBoss EAP 7.0.0.GA (WildFly Core 2.1.2.Final-redhat-1) started (with errors) in 12589ms - Started 384 of 677 services (2 services failed or missing dependencies, 397 services are lazy, passive or on-demand)
23:09:08,550 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) WFLYJCA0019: Stopped Driver service with driver-name = DocumentTracker-1.war_org.postgresql.Driver_42_1
23:09:08,592 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-6) HV000001: Hibernate Validator 5.2.4.Final-redhat-1
23:09:08,674 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0028: Stopped deployment DocumentTracker-1.war (runtime-name: DocumentTracker-1.war) in 130ms
23:09:08,750 INFO  [org.jboss.as.repository] (DeploymentScanner-threads - 1) WFLYDR0002: Content removed from location M:\DocumentTracker\jboss-eap-7.0.0\jboss-eap-7.0\standalone\data\content\bad4f5f6ff015ce8fc6931c596c3f78a113c78\content
23:09:08,751 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "DocumentTracker-1.war" (runtime-name: "DocumentTracker-1.war")
23:09:08,752 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0184:    New missing/unsatisfied dependencies:
      service jboss.deployment.unit."DocumentTracker-1.war".component."com.sun.faces.config.ConfigureListener".START (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
      service jboss.deployment.unit."DocumentTracker-1.war".component."javax.faces.webapp.FacetTag".START (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
      service jboss.deployment.unit."DocumentTracker-1.war".component."javax.servlet.jsp.jstl.tlv.PermittedTaglibsTLV".START (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
      service jboss.deployment.unit."DocumentTracker-1.war".component."javax.servlet.jsp.jstl.tlv.ScriptFreeTLV".START (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
      service jboss.deployment.unit."DocumentTracker-1.war".component."org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher".START (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
      service jboss.deployment.unit."DocumentTracker-1.war".component."org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap".START (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
      service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1 (missing) dependents: [service jboss.deployment.unit."DocumentTracker-1.war".deploymentCompleteService] 
WFLYCTL0186:   Services which failed to start:      service jboss.undertow.deployment.default-server.default-host./DocumentTracker-1

23:09:10,385 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-8) WFLYDS0013: Started FileSystemDeploymentService for directory M:\DocumentTracker\jboss-eap-7.0.0\jboss-eap-7.0\standalone
23:09:10,410 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment standalone-full-ha.xml
23:09:10,420 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0015: Re-attempting failed deployment standalone-ha.xml

服务器一次又一次地完全独立部署并生成日志

INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0016: Replaced deployment "standalone-full.xml" with deployment "standalone-full.xml"

任何指点都会很有帮助。

我能够解决我面临的问题。我正在使用的其余 class(Login class) 在范围内是 default 而它应该是 public 所以我收到错误:

Could not find constructor for class: com.repo.rest.Login

此外,pom.xml 应该提供 EAP 附带的 resteasy-jaxrs 版本。 我们还可以使用以下设置来处理 jboss 在 pom.xml.

中提供的依赖项的版本
<dependencyManagement>
    <dependencies>
            <dependency>
                <groupId>org.wildfly.bom</groupId>
                <artifactId>wildfly-javaee7-with-tools</artifactId>
                <version>12.0.0.Final</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
</dependencyManagement>