Rest on wildfly return “Not Found”, but jsp works, What's wrong? | بلاگ

Rest on wildfly return “Not Found”, but jsp works, What's wrong?

تعرفه تبلیغات در سایت

آخرین مطالب

امکانات وب

Vote count: 0

I'm start study Rest and I try to do REST to return a JSON of Aluno, when I will test on "postman" or "firefox" I receive this 404 error, but ther isn't no problem to access jsp.

I try many thinks, I changed versions of rest-easy, hibernate, try do another Rest, but only the same answer.

Technology used: Wildfly, RestEasy, EasyCriteria, JPA, Hibernate.

URL: http://localhost:8080/teachmanager/ws/aluno

What's wrong?!

answer:


    
        Error
    
   


        


        
    Not Found

Rest:

@Path("aluno")
public class AlunoRest {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public String busca() {
        Dao dao = new Dao(JPAUtil.getEntityManager(), Aluno.class);
        Aluno aluno = dao.getById(1);
        return aluno.toJson();
    }

}

pom.xml:


  4.0.0
  br.com.ilearning.teachmanager
  teachmanager
  0.0.1-SNAPSHOT
  war

  


    
        mysql
        mysql-connector-java
        6.0.3
    

    
        org.hibernate
        hibernate-core
        5.2.10.Final
    

    
        org.hibernate.javax.persistence
        hibernate-jpa-2.1-api
        1.0.0.Final
    

    
        org.hibernate.validator
        hibernate-validator
        6.0.7.Final
    

    
        org.hibernate
        hibernate-ehcache
        5.2.13.Final
    

    
       dom4j
       dom4j
       1.6.1
       provided
    

    
        uaihebert.com
        EasyCriteria
        3.0.0
    

    

    
        com.google.code.gson
        gson
        2.8.2
    

    
        org.jboss.resteasy
        resteasy-jaxrs
        2.2.1.GA
        provided
    

    
        org.jboss.resteasy
        resteasy-multipart-provider
        2.2.0.GA
        provided
    

    
        org.jboss.resteasy
        resteasy-servlet-initializer
        3.5.0.Final
    

  

  
    src
    
      
        maven-compiler-plugin
        3.7.0
        
          1.8
          1.8
        
      
      
        maven-war-plugin
        3.0.0
        
          WebContent
        
      
    
  

web.xml:

    
    
        resteasy.scan 
        true
    

    
        resteasy.servlet.mapping.prefix
        /ws
    

    
        
            org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
        
    

    
        restEasy
        org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
    
    
        restEasy
        /ws/*
    

    
        index.jsp
    


asked 41 secs ago
user3061516

...
نویسنده : استخدام کار بازدید : 11 تاريخ : سه شنبه 15 اسفند 1396 ساعت: 5:59