Deploying a Jersey webapp on Jboss AS 7

后端 未结 11 1159
既然无缘
既然无缘 2020-12-01 06:13

Currently running some webapps on Jboss AS 4/5 and I am testing migration to jboss7. When I try to deploy a jersey based webapp on JBoss AS 7 (full profile with standalone-p

11条回答
  •  北海茫月
    2020-12-01 06:51

    Here is what worked for me for JBoss 7.1.1 and Jersey 1.17.1. No need to modify standalone.xml or domain.xml. Besides filtering restEasy in web.xml instruct Jersey to use Jackson. You can read about this configuration here.

    To save time in configuration guesses, I am posting web.xml and pom.xml from test project.

    web.xml

    
    
      TestJerseyonJBoss
      
        Jersey REST Service
        com.sun.jersey.spi.container.servlet.ServletContainer
        
          com.sun.jersey.config.property.packages
          com.test.rest
        
        
            com.sun.jersey.api.json.POJOMappingFeature
            true
        
        1
      
      
        Jersey REST Service
        /rest/*
      
       
            resteasy.scan
            false
        
        
            resteasy.scan.providers
            false
        
        
            resteasy.scan.resources
            false
        
    
    

    pom.xml

    
      4.0.0
      TestJerseyOnJBoss
      TestJerseyOnJBoss
      0.0.1-SNAPSHOT
      war
      
        src
        
          
            maven-compiler-plugin
            3.1
            
              1.7
              1.7
            
          
          
            maven-war-plugin
            2.3
            
              WebContent
              false
            
          
        
      
      
        
            com.sun.jersey
            jersey-bundle
            1.17.1
        
    
            
               com.sun.jersey
               jersey-json
               1.17.1
            
        
                   asm
                   asm
                   3.3.1
                   jar
                   compile
        
      
    

提交回复
热议问题