Nie mogę wywołać Resta

0

Mam problem z utworzeniem aplikacji restowej. NIe moge wywolac metody GET

@Path("/")
public class MessageRestService {

    @GET
    @Path("/log")
    public Response printMessage() {

        String result = "Restful example : " ;

        return Response.status(200).entity(result).build();
    }
@ApplicationPath("/")
public class RestApplication extends Application {
}

web.xml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/j2ee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">


    <welcome-file-list>
        <welcome-file>jsf/index.xhtml</welcome-file>
        <welcome-file>jsf/index.jsf</welcome-file>
    </welcome-file-list>




</web-app>

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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

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

    <repositories>
        <repository>
            <id>JBoss repository</id>
            <a href="https://repository.jboss.org/nexus/content/groups/public-jboss/">https://repository.jboss.org/nexus/content/groups/public-jboss/</a>
        </repository>
    </repositories>


    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <failOnMissingWebXml>false</failOnMissingWebXml>
        <!-- See https://docs.jboss.org/wildfly/plugins/maven/1.1.0.Alpha7/apidocs/org/wildfly/plugin/server/AddUser.html#set%28java.lang.String%29 -->
        <wildfly.adminUsername>admin</wildfly.adminUsername>
        <wildfly.adminPassword>Admin#70365</wildfly.adminPassword>
        <wildfly.add-user>${wildfly.adminUsername}:${wildfly.adminPassword}:group:ManagementRealm:false</wildfly.add-user>
    </properties>

<dependencies>

    <!--log -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>7.0</version>
    </dependency>




</dependencies>

    <build>
        <finalName>test</finalName>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-maven-plugin</artifactId>
                <version>1.1.0.Alpha7</version>
                <configuration>
                    <java-opts>
                        <java-opt>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</java-opt>
                    </java-opts>
                </configuration>
            </plugin>

        </plugins>

    </build>

</project>
0
<html><head><title>Error</title></head><body>404 - Not Found</body></html> przy uzyciu Rest Client Intellij

1 użytkowników online, w tym zalogowanych: 0, gości: 1