Could not find MessageBodyWriter for response object of type: java.util.ArrayList of media type: text/html - in Resteasy

前端 未结 7 2040
傲寒
傲寒 2021-02-18 15:39

I am developing RESTEasy Example. In this example I am using all latest dependencies and deploying om tomcat 8.x version. I can successfully deploy the applicat

7条回答
  •  执笔经年
    2021-02-18 16:35

    (For those who find the question, working with quarkus)

    Using this setup routine:

    mvn io.quarkus:quarkus-maven-plugin:0.16.1:create     -DprojectGroupId=com.sample     -DprojectArtifactId=hello-quarkus     -DclassName="com.sample.DemoEndpoint"     -Dpath="/persons"
    

    To fix the issue described here, I had to add this dependency.

    
      io.quarkus
      quarkus-resteasy-jsonb
    
    

    here is my full pom.xml after I added the above dependency. Again, 99% of the below pom.xml came from the mvn command above.

    
    
      4.0.0
      com.sample
      hello-quarkus
      1.0-SNAPSHOT
      
        UTF-8
        2.22.0
        0.16.1
        1.8
        UTF-8
        1.8
      
      
        
          
            io.quarkus
            quarkus-bom
            ${quarkus.version}
            pom
            import
          
        
      
      
        
          io.quarkus
          quarkus-resteasy
        
    
    
        
        
          io.quarkus
          quarkus-resteasy-jsonb
        
    
    
    
    
        
          io.quarkus
          quarkus-junit5
          test
        
        
          io.rest-assured
          rest-assured
          test
        
      
      
        
          
            io.quarkus
            quarkus-maven-plugin
            ${quarkus.version}
            
              
                
                  build
                
              
            
          
          
            maven-surefire-plugin
            ${surefire-plugin.version}
            
              
                org.jboss.logmanager.LogManager
              
            
          
        
      
      
        
          native
          
            
              native
            
          
          
            
              
                io.quarkus
                quarkus-maven-plugin
                ${quarkus.version}
                
                  
                    
                      native-image
                    
                    
                      true
                    
                  
                
              
              
                maven-failsafe-plugin
                ${surefire-plugin.version}
                
                  
                    
                      integration-test
                      verify
                    
                    
                      
                        ${project.build.directory}/${project.build.finalName}-runner
                      
                    
                  
                
              
            
          
        
      
    
    

提交回复
热议问题