java.lang.LinkageError: ClassCastException

前端 未结 3 2063
-上瘾入骨i
-上瘾入骨i 2020-12-19 00:59

I do experience a really annoying problem with TestNG and RESTeasy.

I do have a class that runs several tests against an API class which uses the RESTeasy framework

3条回答
  •  心在旅途
    2020-12-19 01:47

    I faced the same issue when deploying my application to JBoss v6.1 - somehow understood that the problem was due to the same package structure of RuntimeDelegate.class existing within jesrey-core and jboss' jaxrs-api jar

    Below is my pom.xml

        
        
            com.sun.jersey
            jersey-client
            1.8
            
                
                    com.sun.jersey
                    resteasy-jaxrs
                
            
        
    
        
        
            org.codehaus.jackson
            jackson-mapper-asl
            1.8.5
        
    
        
            com.sun.jersey
            jersey-json
            1.9
             
                
                    com.sun.jersey
                    jersey-core
                
            
        
    

    After my war is deployed to JBoss, just removed resteasy.deployer folder from jboss' server\default\deployers folder. Ran my application and it worked.

    I would be happy if someone explain why this error got resolved this way? (I think JBoss' has unnecessarily shipped with resteasy.deployers jars when developers could include the jars on their own in their apps) - Not to hide that I tried deploying my war on Tomcat and it worked smoothly.

提交回复
热议问题