NoClassDefFoundError ProcessingException while migrating from jersey 1.x to jersey 2.x ( 2.8 )

后端 未结 2 1886
长发绾君心
长发绾君心 2021-01-19 04:31

I developed a web service application which was working fine with jersey 1.x ( 1.16 ) I recently tried to migrate to latest stable jersey version 2.8

I deleted all j

2条回答
  •  感情败类
    2021-01-19 05:15

    Exception you are getting is happening because you downloaded "javax.ws.rs-api-2.0-m09.jar" this jar doesn't have ProcessingException download the latest one

    Class not foundCaused by: java.lang.NoClassDefFoundError: javax/ws/rs/ProcessingException
    

    Download this jar javax.ws.rs-api-2.0.jar

    
        javax.ws.rs
        javax.ws.rs-api
        2.0
    
    

    Secondly I think you are missing a part from your web.xml

    Try adding these things to your web.xml as appropriate for you application. If you don't have this section this may also lead to SEVERE: A child container failed during start....

    This is what you are missing. Please note that param-value is the list of packages that contain your rest services.

    
        jersey-serlvet
        org.glassfish.jersey.servlet.ServletContainer
        
            jersey.config.server.provider.packages;org.codehaus.jackson.jaxrs
            com.your.package.for.rest
        
        1
    
    

    To get latest Jackson use this Link

    
        com.fasterxml.jackson.jaxrs
        jackson-jaxrs-json-provider
        2.3.3
    
    

提交回复
热议问题