Advertisement
Guest User

Untitled

a guest
Mar 3rd, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. http://localhost:8080/aplicacao/rest/teste
  2.  
  3. Mar 03, 2015 9:18:39 AM org.jboss.resteasy.core.ExceptionHandler
  4. SEVERE: failed to execute
  5. javax.ws.rs.NotFoundException: Could not find resource for full path: http://localhost:8080/aplicacao/rest/teste
  6.  
  7. @Path("/teste")
  8. public class TesteService {
  9.  
  10. @GET
  11. @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
  12. public Response listar() {
  13.  
  14. List<String> listaList = new ArrayList<String>();
  15.  
  16. //...populo a lista
  17.  
  18. return Response.ok(listaList).build();
  19. }
  20. }
  21.  
  22. <?xml version="1.0" encoding="UTF-8"?>
  23. <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" version="3.1">
  24. <display-name>aplicacao</display-name>
  25. <welcome-file-list>
  26. <welcome-file>index.html</welcome-file>
  27. <welcome-file>index.htm</welcome-file>
  28. <welcome-file>index.jsp</welcome-file>
  29. <welcome-file>default.html</welcome-file>
  30. <welcome-file>default.htm</welcome-file>
  31. <welcome-file>default.jsp</welcome-file>
  32. </welcome-file-list>
  33. <display-name>aplicacao rest</display-name>
  34. <context-param>
  35. <param-name>resteasy.servlet.mapping.prefix</param-name>
  36. <param-value>/rest</param-value>
  37. </context-param>
  38. <context-param>
  39. <param-name>resteasy.scan</param-name>
  40. <param-value>true</param-value>
  41. </context-param>
  42.  
  43. <servlet>
  44. <servlet-name>RestServlet</servlet-name>
  45. <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
  46. <load-on-startup>1</load-on-startup>
  47. </servlet>
  48. <servlet-mapping>
  49. <servlet-name>RestServlet</servlet-name>
  50. <url-pattern>/rest/*</url-pattern>
  51. </servlet-mapping>
  52. </web-app>
  53.  
  54. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  55. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  56. <modelVersion>4.0.0</modelVersion>
  57. <groupId>aplicacao</groupId>
  58. <artifactId>aplicacao</artifactId>
  59. <version>0.0.1-SNAPSHOT</version>
  60. <packaging>war</packaging>
  61. <build>
  62. <sourceDirectory>src</sourceDirectory>
  63. <plugins>
  64. <plugin>
  65. <artifactId>maven-compiler-plugin</artifactId>
  66. <version>3.1</version>
  67. <configuration>
  68. <source>1.7</source>
  69. <target>1.7</target>
  70. </configuration>
  71. </plugin>
  72. <plugin>
  73. <artifactId>maven-war-plugin</artifactId>
  74. <version>2.4</version>
  75. <configuration>
  76. <warSourceDirectory>WebContent</warSourceDirectory>
  77. <failOnMissingWebXml>false</failOnMissingWebXml>
  78. </configuration>
  79. </plugin>
  80. </plugins>
  81. </build>
  82. <dependencies>
  83. <dependency>
  84. <groupId>org.jboss.resteasy</groupId>
  85. <artifactId>jaxrs-api</artifactId>
  86. <version>3.0.6.Final</version>
  87. </dependency>
  88. <dependency>
  89. <groupId>org.jboss.resteasy</groupId>
  90. <artifactId>resteasy-jaxrs</artifactId>
  91. <version>3.0.10.Final</version>
  92. </dependency>
  93.  
  94. </dependencies>
  95. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement