title: Maven project with Spring Social framework and Jersey
body: <p>I want to implement an Maven project which use Spring social framework integrated with Jersey. But it has some dependency problem.</p>
  
  <p>I think it is because I missed some exclusion in the jersey spring. Can someone kindly help me?</p>
  
  <p>The pom.xml is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;org.springframework.social.samples&lt;/groupId&gt;
  &lt;artifactId&gt;world-rank&lt;/artifactId&gt;
  &lt;name&gt;World Rank&lt;/name&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;properties&gt;
      &lt;java-version&gt;1.6&lt;/java-version&gt;
      &lt;org.springframework.social-version&gt;1.1.0.BUILD-SNAPSHOT&lt;/org.springframework.social-version&gt;
      &lt;org.springframework.social.facebook-version&gt;1.1.0.BUILD-SNAPSHOT&lt;/org.springframework.social.facebook-version&gt;
      &lt;org.springframework.social.twitter-version&gt;1.1.0.BUILD-SNAPSHOT&lt;/org.springframework.social.twitter-version&gt;
      &lt;org.springframework-version&gt;3.1.1.RELEASE&lt;/org.springframework-version&gt;
      &lt;org.springframework.security-version&gt;3.1.0.RELEASE&lt;/org.springframework.security-version&gt;
      &lt;org.slf4j-version&gt;1.6.1&lt;/org.slf4j-version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
      &lt;!-- Jersey --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
          &lt;version&gt;1.8&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Spring --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework-version}&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                  &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
               &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-tx&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-web&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.security-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-taglibs&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.security-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-config&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.security-version}&lt;/version&gt;
      &lt;/dependency&gt;       
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
          &lt;artifactId&gt;spring-social-core&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.social-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
          &lt;artifactId&gt;spring-social-facebook&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.social.facebook-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
          &lt;artifactId&gt;spring-social-twitter&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.social.twitter-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.social&lt;/groupId&gt;
          &lt;artifactId&gt;spring-social-web&lt;/artifactId&gt;
          &lt;version&gt;${org.springframework.social-version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Jersey + Spring --&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.jersey.contribs&lt;/groupId&gt;
          &lt;artifactId&gt;jersey-spring&lt;/artifactId&gt;
          &lt;version&gt;1.8&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;/exclusion&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
  
      &lt;!-- Apache Http Client --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.1.2&lt;/version&gt;
          &lt;exclusions&gt;
              &lt;!-- Exclude Commons Logging in favor of SLF4j --&gt;
              &lt;exclusion&gt;
                  &lt;groupId&gt;commons-logging&lt;/groupId&gt;
                  &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;/exclusion&gt;
          &lt;/exclusions&gt;           
      &lt;/dependency&gt;
  
      &lt;!-- JSR 303 with Hibernate Validator --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.validation&lt;/groupId&gt;
          &lt;artifactId&gt;validation-api&lt;/artifactId&gt;
          &lt;version&gt;1.0.0.GA&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
          &lt;version&gt;4.1.0.Final&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Logging --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
          &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
          &lt;version&gt;${org.slf4j-version}&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;1.2.16&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;version&gt;1.3.159&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- CGLIB, only required and used for @Configuration usage --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;cglib&lt;/groupId&gt;
          &lt;artifactId&gt;cglib-nodep&lt;/artifactId&gt;
          &lt;version&gt;2.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Apache Tiles --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
          &lt;artifactId&gt;tiles-jsp&lt;/artifactId&gt;
          &lt;version&gt;2.2.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.tiles&lt;/groupId&gt;
          &lt;artifactId&gt;tiles-el&lt;/artifactId&gt;
          &lt;version&gt;2.2.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- @Inject --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.inject&lt;/groupId&gt;
          &lt;artifactId&gt;javax.inject&lt;/artifactId&gt;
          &lt;version&gt;1&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Servlet --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
          &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
          &lt;version&gt;2.1&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet.jsp.jstl&lt;/groupId&gt;
          &lt;artifactId&gt;jstl-api&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt;
          &lt;artifactId&gt;jstl-impl&lt;/artifactId&gt;
          &lt;version&gt;1.2&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;org.springframework.maven.release&lt;/id&gt;
          &lt;name&gt;Spring Maven Release Repository&lt;/name&gt;
          &lt;url&gt;http://maven.springframework.org/release&lt;/url&gt;
          &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
          &lt;snapshots&gt;&lt;enabled&gt;false&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/repository&gt;
      &lt;!-- For testing against latest Spring snapshots --&gt;
      &lt;repository&gt;
          &lt;id&gt;org.springframework.maven.snapshot&lt;/id&gt;
          &lt;name&gt;Spring Maven Snapshot Repository&lt;/name&gt;
          &lt;url&gt;http://maven.springframework.org/snapshot&lt;/url&gt;
          &lt;releases&gt;&lt;enabled&gt;false&lt;/enabled&gt;&lt;/releases&gt;
          &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/repository&gt;
      &lt;!-- For developing against latest Spring milestones --&gt;
      &lt;repository&gt;
          &lt;id&gt;org.springframework.maven.milestone&lt;/id&gt;
          &lt;name&gt;Spring Maven Milestone Repository&lt;/name&gt;
          &lt;url&gt;http://maven.springframework.org/milestone&lt;/url&gt;
          &lt;snapshots&gt;&lt;enabled&gt;false&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/java&lt;/directory&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;${java-version}&lt;/source&gt;
                  &lt;target&gt;${java-version}&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;warName&gt;spring-social-popup&lt;/warName&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;tomcat-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.1&lt;/version&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>The Error message is: 
  ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
  org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webMvcConfig' defined in file [/Users/yousilin/workspace/9323/target/classes/org/springframework/social/popup/config/WebMvcConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor' defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration.transactionAdvisor()] threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor.setAdvice(Lorg/aopalliance/aop/Advice;)V
  Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactoryLocator' defined in BeanDefinition defined in class path resource [org/springframework/social/popup/config/SocialConfig.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor' defined in class path resource [org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.class]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration.transactionAdvisor()] threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.transaction.interceptor.BeanFactoryTransactionAttributeSourceAdvisor.setAdvice(Lorg/aopalliance/aop/Advice;)V</p>