java - web service tutorial sample on weblogic --> 404 -


i have followed web service tutorial sample , deployed on weblogic. when type url, shows 404. have wrong or missing?? path http://localhost:7001/aeon_mobileapps_java_ws/userservice/users

web.xml

<?xml version="1.0" encoding="utf-8"?> <web-app>     <servlet>         <display-name>my jersey application</display-name>         <servlet-name>myjerseyapp</servlet-name>         <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class>         <init-param>             <param-name>javax.ws.rs.application</param-name>             <param-value>com.tutorialspoint</param-value>         </init-param>     </servlet>     <servlet-mapping>         <servlet-name>myjerseyapp</servlet-name>         <url-pattern>/*</url-pattern>     </servlet-mapping> </web-app> 

weblogic.xml

<?xml version='1.0' encoding='utf-8'?> <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90"     xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <library-ref>     <library-name>jax-rs</library-name>     <specification-version>1.1</specification-version>     <implementation-version>1.9</implementation-version>     <exact-match>false</exact-match> </library-ref> </weblogic-web-app> 

pom.xml

<dependencies>   <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-server --> <dependency>     <groupid>com.sun.jersey</groupid>     <artifactid>jersey-server</artifactid>     <version>1.19.4</version> </dependency>   <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-core --> <dependency>     <groupid>com.sun.jersey</groupid>     <artifactid>jersey-core</artifactid>     <version>1.19.4</version> </dependency>   <!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-bundle --> <dependency>     <groupid>com.sun.jersey</groupid>     <artifactid>jersey-bundle</artifactid>     <version>1.19.4</version> </dependency>   <!-- https://mvnrepository.com/artifact/asm/asm --> <dependency>     <groupid>asm</groupid>     <artifactid>asm</artifactid>     <version>3.3.1</version> </dependency>   <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api --> <dependency>     <groupid>javax.servlet</groupid>     <artifactid>javax.servlet-api</artifactid>     <version>3.1.0</version>     <scope>provided</scope> </dependency>    </dependencies> 

the url path , project structure screen

404 error occur because of page not found or bad url. using jersey rest services, need use path mapping of controller , method. need use @path annotation before class , method.

you can find below sample code:

@path("/test")   public class test{    @get   @path("/{text}")   public response gettext(@pathparam("text") string text) {       string output = text;       return response.status(200).entity(output).build();   }   

so out check code can not give correct answer, probable reasons of error.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -