首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wildfly 10:无法执行: javax.ws.rs.NotFoundException: RESTEASY003210

Wildfly 10:无法执行: javax.ws.rs.NotFoundException: RESTEASY003210
EN

Stack Overflow用户
提问于 2016-09-01 19:23:23
回答 1查看 756关注 0票数 0

我正在尝试将wildfly-swarm与一个已经在glassfish上运行的hello world web项目(只有一个index.html文件)一起使用。这是我的POM.xml:

代码语言:javascript
复制
<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
    <artifactId>MongoDBDemo</artifactId>
    <groupId>com.test</groupId>
    <version>1.0-SNAPSHOT</version>
  </parent>

    <dependencyManagement>
        <dependencies>
          <dependency>
            <groupId>org.wildfly.swarm</groupId>
            <artifactId>bom</artifactId>
            <version>${version.wildfly.swarm}</version>
            <scope>import</scope>
            <type>pom</type>
          </dependency>
        </dependencies>
    </dependencyManagement>

    <groupId>com.test</groupId>
    <artifactId>MongoDBDemo-web</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>MongoDBDemo-web</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <version.wildfly.swarm>2016.8.1</version.wildfly.swarm>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <endorseddirs>${endorsed.dir}</endorseddirs>
                    </compilerArguments>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${endorsed.dir}</outputDirectory>
                            <silent>true</silent>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax</groupId>
                                    <artifactId>javaee-endorsed-api</artifactId>
                                    <version>7.0</version>
                                    <type>jar</type>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.wildfly.swarm</groupId>
                <artifactId>wildfly-swarm-plugin</artifactId>
                <version>${version.wildfly.swarm}</version>
                <executions>
                  <execution>
                    <goals>
                      <goal>package</goal>
                    </goals>
                  </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

我有一个例外:

代码语言:javascript
复制
2016-09-01 16:37:10,543 ERROR [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-1) RESTEASY002010: Failed to execute: javax.ws.rs.NotFoundException: RESTEASY003210: Could not find resource for full path: http://localhost:8080/MongoDBDemo-web/index.html
        at org.jboss.resteasy.core.registry.ClassNode.match(ClassNode.java:75)
        at org.jboss.resteasy.core.registry.RootClassNode.match(RootClassNode.java:48)
        at org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker(ResourceMethodRegistry.java:445)

我正在使用以下命令运行它:

代码语言:javascript
复制
mvn wildfly-swarm:run

我不知道为什么我在浏览器上看不到任何输出,甚至也不例外。你能告诉我为什么假设index.html是一个JAX-RS资源而不是一个物理的HTML文件吗?

index.html位于src\main\webapp文件夹中

EN

回答 1

Stack Overflow用户

发布于 2016-09-02 03:53:48

默认情况下,WildFly群不会向您的应用程序添加上下文路径。

您尝试过访问http://localhost:8080/index.html吗??

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39270225

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档