无法使用jboss部署resteasy项目

时间:2018-12-18 18:30:13

标签: java rest maven jboss

我无法部署我的“ resteasy”项目,而尝试进行部署时却遇到未找到类的异常,而我也找不到为什么找不到该类的问题?

    @ApplicationPath("/rest")
public class RoperRestUtilsApplication extends Application{

        private Set<Object> singletons = new HashSet();

        public RoperRestUtilsApplication() {
            //super();
            this.singletons.add(new BusinessService());
            this.singletons.add(new PersonService());
            this.singletons.add(new TouristService());
            this.singletons.add(new BusinessOwnerService());
            this.singletons.add(new ProductService());
        }


        public Set<Object> getSingletons()
        {
            return this.singletons;
        }
}

web.xml: web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
      <display-name>Roper</display-name>
      <context-param>
        <param-name>resteasy.scan</param-name>
        <param-value>true</param-value>
      </context-param>
    <listener>
        <listener-class>
                org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
            </listener-class>
      </listener>
      <servlet>
        <servlet-name>Resteasy</servlet-name>
        <servlet-class>
                org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
            </servlet-class>
        <init-param>
          <param-name>javax.ws.rs.Application</param-name>
          <param-value>java.org.Roper.RoperRestUtils.RoperRestUtilsApplication</param-value>
        </init-param>
      </servlet>
      <servlet-mapping>
        <servlet-name>Resteasy</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping>
    </web-app>

pom:

    <?xml version="1.0"?>
    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <modelVersion>4.0.0</modelVersion>
      <groupId>easy</groupId>
      <artifactId>easy</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
      <dependencies>
        <dependency>
          <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-jaxrs</artifactId>
          <version>3.0.13.Final</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.resteasy</groupId>
          <artifactId>resteasy-jaxb-provider</artifactId>
          <version>3.0.13.Final</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>javax</groupId>
          <artifactId>javaee-api</artifactId>
          <version>7.0</version>
          <scope>compile</scope>
        </dependency>
      </dependencies>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>Central Repository</name>
          <url>https://repo.maven.apache.org/maven2</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <releases>
            <updatePolicy>never</updatePolicy>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>Central Repository</name>
          <url>https://repo.maven.apache.org/maven2</url>
        </pluginRepository>
      </pluginRepositories>
      <build>
        <sourceDirectory>P:\eclipse\WorkDir\Trunk\easy\src</sourceDirectory>
        <scriptSourceDirectory>P:\eclipse\WorkDir\Trunk\easy\src\main\scripts</scriptSourceDirectory>
        <testSourceDirectory>P:\eclipse\WorkDir\Trunk\easy\src\test\java</testSourceDirectory>
        <outputDirectory>P:\eclipse\WorkDir\Trunk\easy\target\classes</outputDirectory>
        <testOutputDirectory>P:\eclipse\WorkDir\Trunk\easy\target\test-classes</testOutputDirectory>
        <resources>
          <resource>
            <directory>P:\eclipse\WorkDir\Trunk\easy\src\main\resources</directory>
          </resource>
        </resources>
        <testResources>
          <testResource>
            <directory>P:\eclipse\WorkDir\Trunk\easy\src\test\resources</directory>
          </testResource>
        </testResources>
        <directory>P:\eclipse\WorkDir\Trunk\easy\target</directory>
        <finalName>easy-0.0.1-SNAPSHOT</finalName>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-antrun-plugin</artifactId>
              <version>1.3</version>
            </plugin>
            <plugin>
              <artifactId>maven-assembly-plugin</artifactId>
              <version>2.2-beta-5</version>
            </plugin>
            <plugin>
              <artifactId>maven-dependency-plugin</artifactId>
              <version>2.8</version>
            </plugin>
            <plugin>
              <artifactId>maven-release-plugin</artifactId>
              <version>2.5.3</version>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>compile</phase>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <source>1.8</source>
                  <target>1.8</target>
                </configuration>
              </execution>
              <execution>
                <id>default-testCompile</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>testCompile</goal>
                </goals>
                <configuration>
                  <source>1.8</source>
                  <target>1.8</target>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.2.1</version>
            <executions>
              <execution>
                <id>default-war</id>
                <phase>package</phase>
                <goals>
                  <goal>war</goal>
                </goals>
                <configuration>
                  <warSourceDirectory>WebContent</warSourceDirectory>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <warSourceDirectory>WebContent</warSourceDirectory>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.5</version>
            <executions>
              <execution>
                <id>default-clean</id>
                <phase>clean</phase>
                <goals>
                  <goal>clean</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.6</version>
            <executions>
              <execution>
                <id>default-testResources</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>testResources</goal>
                </goals>
              </execution>
              <execution>
                <id>default-resources</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>resources</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12.4</version>
            <executions>
              <execution>
                <id>default-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>default-install</id>
                <phase>install</phase>
                <goals>
                  <goal>install</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.7</version>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.3</version>
            <executions>
              <execution>
                <id>default-site</id>
                <phase>site</phase>
                <goals>
                  <goal>site</goal>
                </goals>
                <configuration>
                  <outputDirectory>P:\eclipse\WorkDir\Trunk\easy\target\site</outputDirectory>
                  <reportPlugins>
                    <reportPlugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-project-info-reports-plugin</artifactId>
                    </reportPlugin>
                  </reportPlugins>
                </configuration>
              </execution>
              <execution>
                <id>default-deploy</id>
                <phase>site-deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <outputDirectory>P:\eclipse\WorkDir\Trunk\easy\target\site</outputDirectory>
                  <reportPlugins>
                    <reportPlugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-project-info-reports-plugin</artifactId>
                    </reportPlugin>
                  </reportPlugins>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <outputDirectory>P:\eclipse\WorkDir\Trunk\easy\target\site</outputDirectory>
              <reportPlugins>
                <reportPlugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-project-info-reports-plugin</artifactId>
                </reportPlugin>
              </reportPlugins>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <reporting>
        <outputDirectory>P:\eclipse\WorkDir\Trunk\easy\target\site</outputDirectory>
      </reporting>
    </project>

我得到的例外情况:

  
    
      

20:07:34,113错误[org.jboss.msc.service.fail](MSC服务线程1-6)MSC000001:无法启动服务       jboss.deployment.unit。“ easy-0.0.1-SNAPSHOT.war” .POST_MODULE:       服务中的org.jboss.msc.service.StartException       jboss.deployment.unit。“ easy-0.0.1-SNAPSHOT.war” .POST_MODULE:       WFLYSRV0153:无法处理部署阶段POST_MODULE       的“ easy-0.0.1-SNAPSHOT.war”       org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)         在       org.jboss.msc.service.ServiceControllerImpl $ StartTask.startService(ServiceControllerImpl.java:2032)         在       org.jboss.msc.service.ServiceControllerImpl $ StartTask.run(ServiceControllerImpl.java:1955)         在java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)         在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)         在java.lang.Thread.run(未知源)造成原因:       org.jboss.as.server.deployment.DeploymentUnitProcessingException:       WFLYRS0006:无法在以下位置加载JAX-RS应用程序类       org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcessor.java:334)         在       org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:109)         在       org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)         ... 5更多原因:java.lang.ClassNotFoundException:       java.org.Roper.RoperRestUtils.RoperRestUtilsApplication在       java.net.URLClassLoader.findClass(未知源),网址为       java.lang.ClassLoader.loadClass(未知源)       sun.misc.Launcher $ AppClassLoader.loadClass(未知源)在       java.lang.ClassLoader.loadClass(未知源)       org.jboss.modules.JDKSpecific.getSystemClass(JDKSpecific.java:183)在       org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:397)         在       org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)         在       org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcessor.java:330)         ...还有7个

    
         

20:07:34,258 INFO [org.infinispan.factories.GlobalComponentRegistry](MSC服务线程1-3)ISPN000128:Infinispan版本:Infinispan     'Chakra'8.2.8.Final-redhat-1 20:07:34,269错误     [org.jboss.as.controller.management-operation](控制器启动     线程)WFLYCTL0013:操作(“部署”)失败-地址:     ([(“ deployment” =>“ easy-0.0.1-SNAPSHOT.war”)])-故障描述:     {“ WFLYCTL0080:服务失败” =>     {“ jboss.deployment.unit。\” easy-0.0.1-SNAPSHOT.war \“。POST_MODULE” =>     “ WFLYSRV0153:无法处理部署阶段POST_MODULE     \\“简单0.0.1-SNAPSHOT.war \”         由以下原因引起:org.jboss.as.server.deployment.DeploymentUnitProcessingException:     WFLYRS0006:无法加载JAX-RS应用程序类         由以下原因引起:java.lang.ClassNotFoundException:java.org.Roper.RoperRestUtils.RoperRestUtilsApplication“}}     20:07:34,276 INFO [org.jboss.as.server](ServerService线程池-     40)WFLYSRV0010:部署了“ easy-0.0.1-SNAPSHOT.war”(运行时名称:     “ easy-0.0.1-SNAPSHOT.war”)20:07:34,277信息     [org.jboss.as.controller](控制器引导线程)​​WFLYCTL0183:     服务状态报告WFLYCTL0186:无法启动的服务:
    服务jboss.deployment.unit。“ easy-0.0.1-SNAPSHOT.war”。POST_MODULE:     WFLYSRV0153:无法处理部署阶段POST_MODULE     “ easy-0.0.1-SNAPSHOT.war”

         

20:07:34,350 INFO [org.jboss.as.server](控制器引导线程)​​WFLYSRV0212:恢复服务器20:07:34,352 INFO [org.jboss.as]     (控制器引导线程)​​WFLYSRV0060:Http管理界面     收听http://127.0.0.1:9990/management 20:07:34,352 INFO     [org.jboss.as](控制器引导线程)​​WFLYSRV0051:管理控制台     监听http://127.0.0.1:9990 20:07:34,353错误[org.jboss.as]     (控制器引导线程)​​WFLYSRV0026:JBoss EAP 7.1.0.GA(WildFly Core     3.0.10.Final-redhat-1)在4834毫秒内启动(有错误)-启动343个606服务(1个服务失败或缺少依赖项,365)     服务是懒惰,被动或按需)

  

0 个答案:

没有答案