Java/eclipse does not recognize Path GET annotation

Asked

Viewed 568 times

1

I am developing a Restful application, using eclipse and jersey (No use framework).

But I’m having a problem with @Path annotations, @GET. When I use these annotations there is an error in the line of the package within the class. The following error:

The type java.lang.Charsequence cannot be resolved. It is Indirectly referened from required . class file

And I believe that is why every time I start the server/ I run the application unable to access the data. Because every time q access to Uri that should return me the data I receive a

"HTTP Status 404- /Primeirorestfl".

Description The requested Resource is not available

All the jersey lib are added in the path and I’m using Tomcat 7 Codifying

line with error that I don’t understand: inserir a descrição da imagem aqui

Resoruce inserir a descrição da imagem aqui

Lib’s

inserir a descrição da imagem aqui

Web.xml: inserir a descrição da imagem aqui

Exception after running the application inserir a descrição da imagem aqui

In the cowboy: inserir a descrição da imagem aqui

  • You have placed the Jersey Libs inside the /WEB-INF/lib folder ?

  • @adelmo00 yes, I put

  • You could post your code, including the Imports?

  • @Weslleytavares, one moment, I will send the code and the error q return

  • The error in Stacktrace refers to the missing library containing Faces Servlet. You can download it here: https://javaserverfaces.java.net/download.html

1 answer

1


There is a situation very similar to yours in the stackoverflow.with. By this answer the solution is in the Java version. JDK 1.8 supports default methods interfaces involving new methods in legacy interfaces (JDK 1.7 or less). Charsequence is a case...

If your project has a compatibility level lower than 1.8, you cannot reference these default methods. According to the solution I mentioned (and I believe this is the case), there are two options:

  1. Even set JDK 1.7 as part of your solution and use only libs compatible with JDK1.7
  2. Definitely migrate to JDK 1.8 (best option in my opinion).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.