BIRT runtime not found - maven

I have an application, where I am introducing Spring boot. It has some BIRT reports defined as .rptdesign files. To handle them, following mapping was defined in web.xml.
<servlet>
<servlet-name>EngineServlet</servlet-name>
<servlet- class>org.eclipse.birt.report.servlet.BirtEngineServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>EngineServlet</servlet-name>
<url-pattern>/output</url-pattern>
</servlet-mapping>
And Maven dependency:
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>${eclipse.runtime.version}</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.apache.poi</artifactId>
</exclusion>
</exclusions>
</dependency>
I am trying to configure the same with spring-boot. Maven dependency is the same.
I tried registering the mapping via ServletRegistrationBean:
#Bean
public ServletRegistrationBean exampleServletBean() {
ServletRegistrationBean bean = new ServletRegistrationBean(
new BirtEngineServlet(), "/output/*");
bean.setLoadOnStartup(1);
return bean;
}
This code does not compile as class: BirtEngineServlet cannot be resolved to a type. I tried with adding more BIRT components to Maven:
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>report-engine</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>org.eclipse.birt.report.engine</artifactId>
<version>2.2.0-20070705</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>core</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>viewservlets</artifactId>
<version>4.2.0</version>
</dependency>
Other option that I tried, was defining my own BirtEngineFactory. The code compiled, but BIRT Runtime classes (i.e BirtException) were not found during runtime, with NoClassDefFoundException thrown.
Any suggestions how to configure BIRT with Spring boot using Maven?

The solution is as follows:
pom.xml
<repositories>
<repository>
<id>Maven Repository</id>
<url>https://mvnrepository.com</url>
</repository>
</repositories>
...
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>4.4.1</version>
<exclusions>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.apache.poi</artifactId>
</exclusion>
<exclusion>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.orbit.mongodb</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>viewservlets</artifactId>
<version>4.2.0</version>
</dependency>
Repository matters and runtime version matters - tried with various and it failed - only 4.4.1 worked for me.

Related

Is it possible to configure the spring boot server explicitly?

I've a Spring Boot application where one of the dependencies is using spring and a embedded jetty to start an ad-hoc web server. This causes my spring boot app to start in a jetty instead of a tomcat.
My spring-boot-starter-web:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-websocket</artifactId>
</exclusion>
</exclusions>
</dependency>
The dependencies pom:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-http</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
</dependency>
Is there a possibility to configure the server to use by spring boot explicitly instead of being inferred by the dependency tree?
EDIT
I investigated the issue a little bit further and created a repo to reproduce the issue: github.com/svettwer/spring-server-test
org.eclipse.jetty.websocket:javax-websocket-server-impl causes spring to start with jetty without any other config required.
EDIT 2
The issue is not present anymore in Spring Boot 2.x
EDIT 3
I'll deleted the repo mentioned earlier, but here is the dependency setup that caused the issue:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>1.5.7.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.5.7.RELEASE</version>
<scope>test</scope>
</dependency>
<!-- Comment that in to start spring with jetty-->
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>javax-websocket-server-impl</artifactId>
<version>9.4.8.v20171121</version>
</dependency>
</dependencies>
Normally, if you have the spring-boot-starter-tomcat on your classpath (through spring-boot-starter-web), it should always select Tomcat since it has priority over other servlet containers. Even if you have the following dependencies, Spring boot will start with Tomcat:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
</dependency>
You can programmatically override the chosen servlet container by registering your own ServletWebServerFactory, for example:
#Bean
public ServletWebServerFactory factory() {
return new TomcatServletWebServerFactory();
}
You can choose the predefined TomcatServletWebServerFactory, JettyServletWebServerFactory or the UndertowServletWebServerFactory.
This guide may help you: https://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-web-servers.html
If you run an mvn dependency:tree and search for jetty you might find that you need to exclude it, e.g:
spring-boot-starter-jetty
excluded like in the example:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<!-- Exclude the Tomcat dependency -->
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Use Jetty instead -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
which is favouring jetty over tomcat - but you get the idea hopefully...
Hope this helps.

why does maven test scoped dependency overriding compile scoped dependency?

I'm trying to figure out why my simple spring boot project no longer works. It is basically straight from spring example with one controller says hello world. I'm using spring-boot-starter-jetty, and spring boot v1.1.10 (tried also 1.2.0). I have some unit test using embedded solr, so solr-core is marked as <scope>test</scope> in the pom. After added the solr-core dependency, the project no longer runs, and it seems the solr-core jetty dependencies are conflicting with spring-boot-starter-jetty dependencies (see screenshot below from Spring Tool Suite).
I thought test scoped dependencies should not interfere with compile scoped dependencies and "is only available for the test compilation and execution phases" - reference?
How do I resolve the conflict? I want to keep spring-boot-starter-jetty when running the spring boot project, and use solr-core when executing tests.
Thanks!
EDIT: adding a sample pom.xml isolated the problem.
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test</groupId>
<artifactId>boot-solr-conflict</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.0.RELEASE</version>
</parent>
<dependencies>
<!-- tag::jetty[] -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
<!-- end::jetty[] -->
<!-- ################################### -->
<!-- Solr-core dependency for embedded Solr for unit testing. -->
<!-- Causes problem when including this dependency. -->
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<version>4.7.2</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
Application.java
package test;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class Application {
public static void main(String[] args){
SpringApplication.run(Application.class, args);
}
}
MainController.java
package test;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
#Controller
public class MainController {
#RequestMapping("/")
public #ResponseBody String getRoot(){
return "Hello World";
}
}
There are a couple of things going on here.
The mixture of Jetty versions is because Spring Boot only includes dependency management for the Jetty modules that it directly depends upon. You can work around this by declaring your own dependency management for the other Jetty modules that are involved, reusing Boot's jetty.version property. I've opened an issue against Spring Boot so that we can add more complete dependency management for Jetty.
The second part of the problem is that, even once the versions of the Jetty modules have been aligned, Maven omits some of the Jetty compile dependencies as it considers them to be in conflict with the transitive dependencies of solr-core. I don't understand why this is the case as the versions are aligned and the error message confirms as much:
jetty-xml: 8.1.15.v20140411 (omitted for conflict with 8.1.15.v20140411)
You can work around this by using <dependencyManagement> to force some of the dependencies to be compile dependencies by adding <scope>compile</scope>. This was necessary on both jetty-security and jetty-server to get a basic app to start.
Here's the full <dependencyManagement> section that I added to the pom from the question:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-continuation</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-deploy</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jmx</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-security</artifactId>
<version>${jetty.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-xml</artifactId>
<version>${jetty.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Birt Report Viewer with maven not starting

I'm trying to get the Birt View Report running through Maven, but I'm encountering problems for some days now and I can't seem to find a solution. I use the following Depedency:
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>viewservlets</artifactId>
<version>4.2.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.birt</groupId>
<artifactId>engineapi</artifactId>
<version>2.3.2</version>
</dependency>
When I run this I get a blank page with my executable tomcat package and when I place it in my 'manual' tomcat I this:
org.apache.catalina.core.standardcontext.startinternal error
listenerstart
Am I forgetting something? When I copy the lib folder from the WebViewerExample in the project en not use these depedencies it works, but that's not the way ^^
<properties>
<spring.version>3.1.1.RELEASE</spring.version>
<birt.runtime.version>4.3.0</birt.runtime.version>
</properties>
<dependency>
<groupId>org.eclipse.birt.runtime</groupId>
<artifactId>org.eclipse.birt.runtime</artifactId>
<version>${birt.runtime.version}</version>
<exclusions>
<exclusion>
<artifactId>org.apache.poi</artifactId>
<groupId>org.eclipse.birt.runtime</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
</dependency>

Neo4j with SpringRestGraphDatabase - getting class not found exception

I've built a new project using Spring data graph for Neo4J. I'm using Maven.
Everything works fine with embedded database, but when I'm trying to set a database on remote server using REST I'm getting:
java.lang.ClassNotFoundException: org.springframework.data.neo4j.rest.SpringRestGraphDatabase
I saw a post from about one year ago, but with no solution - at least not one that works for me... In this post they referred aspectJ which indeed I use.
Is anyone familiar with this? does anyone have a working configuration example?
I really tried a L-O-T of different configurations, based on different posts in different forums and guides. This is my last one - I'll just specify that I also have other POMs and all of them are grouped by a parent POM (this is a bug project).
This is the bean definition:
<!-- Neo4j configuration (creates Neo4jTemplate) -->
<datagraph:config graphDatabaseService="neo4JRestGraphDatabase" />
<!-- With this uncommented - it works great -->
<!--datagraph:config storeDirectory="data/graph.db" /-->
And this is the project's POM:
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.vo.insight</groupId>
<artifactId>content-insights-model-processed</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>content-insights-model-processed</name>
<url>http://maven.apache.org</url>
<parent>
<artifactId>content-insights-parent</artifactId>
<groupId>com.vo.insight</groupId>
<version>1.0-SNAPSHOT</version>
<relativePath>../content-insights-parent/pom.xml</relativePath>
</parent>
<properties>
<neo4j-rest-graphdb.version>2.0.0-M06</neo4j-rest-graphdb.version>
<neo4j.version>1.8.M06</neo4j.version>
</properties>
<dependencies>
<dependency>
<groupId>com.vo.insight</groupId>
<artifactId>content-insights-common</artifactId>
<version>${project.version}</version>
</dependency>
<!-- Neo4J -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>3.0.0.BUILD-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-rest-graphdb</artifactId>
<version>${neo4j-rest-graphdb.version}</version>
<exclusions>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
</exclusion>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.neo4j.app</groupId>
<artifactId>neo4j-server</artifactId>
<version>${neo4j.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
</exclusion>
<exclusion>
<groupId>de.huxhorn.lilith</groupId>
<artifactId>de.huxhorn.lilith.3rdparty.rrd4j</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-multipart</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.fileinstall</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Do not remove this although we are not using Hibernate! this is needed
for Neo4J -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>3.1.4.RELEASE</version>
</dependency>
<!-- Cassandra Client -->
<dependency>
<groupId>me.prettyprint</groupId>
<artifactId>hector-core</artifactId>
</dependency>
<dependency>
<groupId>me.prettyprint</groupId>
<artifactId>hector-object-mapper</artifactId>
<version>3.0-04</version>
</dependency>
<dependency>
<groupId>org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
</dependency>
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
</dependency>
</dependencies>
<build>
</build>
<!-- this profile is for ci build mode. to activate it use -Pci flag -->
<profiles>
<profile>
<id>ci</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.0</version>
<configuration>
<outxml>true</outxml>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
<aspectLibrary>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.6</source>
<target>1.6</target>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Thanks for your help!
Carmel
I think you don't want to use "org.neo4j" dependencies if you use Spring Data. I'm not an expert but my current project works with only these:
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j</artifactId>
<version>${org.springframework.data-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-neo4j-rest</artifactId>
<version>${org.springframework.data-version}</version>
</dependency>
I think you need to include the org.springframework.data.spring-data-neo4j-rest artifact, not just the org.neo4j.neo4j-rest-graph-db.
Also, you're mixing versions pretty freely
spring-data-neo4j 3.0 snapshot
neo4j-rest-graphdb 2.0 milestone
neo4j 1.8 milestone (you sure you don't mean to use 2.0 M6 here also?)
a long list of exclusions
explicit dependencies on spring-security-web 3.1.4 and spring-orm
I don't know the relevant dependencies and compatibilities for SDN 3, and there isn't necessarily anything wrong with mixing it up a bit, but if you get ClassNotFoundException or NoClassDefFoundError with a pom like that, you may want to look at your dependency tree, for instance by running mvn dependency:tree -Dverbose in your project root, to see if there are conflicting versions causing some dependencies to be silently excluded.
Eventualy, the problem was the definition of my neo4JRestGraphDatabase (which unfortunately I haven't pasted here...).
It was:
<bean id="graphDatabaseService" class="org.springframework.data.neo4j.rest.RestGraphDatabase">
<constructor-arg value="http://localhost:7474/db/data/" />
</bean>
Instead of:
<bean id="graphDatabaseService" class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">
<constructor-arg value="http://localhost:7474/db/data/" />
</bean>
Now I have 'Connection Refused' problem, but this is another issue.
Regarding the dependencies, the dependencies that geceo mentioned above are indeed enough.
Thanks for anyone that tried to help!
Carmel

Maven project with Spring Social framework and Jersey

I want to implement an Maven project which use Spring social framework integrated with Jersey. But it has some dependency problem.
I think it is because I missed some exclusion in the jersey spring. Can someone kindly help me?
The pom.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.social.samples</groupId>
<artifactId>world-rank</artifactId>
<name>World Rank</name>
<packaging>war</packaging>
<version>1.0.0</version>
<properties>
<java-version>1.6</java-version>
<org.springframework.social-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social-version>
<org.springframework.social.facebook-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.facebook-version>
<org.springframework.social.twitter-version>1.1.0.BUILD-SNAPSHOT</org.springframework.social.twitter-version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.springframework.security-version>3.1.0.RELEASE</org.springframework.security-version>
<org.slf4j-version>1.6.1</org.slf4j-version>
</properties>
<dependencies>
<!-- Jersey -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.8</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springframework.security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${org.springframework.security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springframework.security-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>${org.springframework.social.facebook-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-twitter</artifactId>
<version>${org.springframework.social.twitter-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-web</artifactId>
<version>${org.springframework.social-version}</version>
</dependency>
<!-- Jersey + Spring -->
<dependency>
<groupId>com.sun.jersey.contribs</groupId>
<artifactId>jersey-spring</artifactId>
<version>1.8</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Apache Http Client -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.1.2</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- JSR 303 with Hibernate Validator -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.159</version>
</dependency>
<!-- CGLIB, only required and used for #Configuration usage -->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
<version>2.2</version>
</dependency>
<!-- Apache Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-el</artifactId>
<version>2.2.2</version>
</dependency>
<!-- #Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>jstl-impl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>org.springframework.maven.release</id>
<name>Spring Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<!-- For testing against latest Spring snapshots -->
<repository>
<id>org.springframework.maven.snapshot</id>
<name>Spring Maven Snapshot Repository</name>
<url>http://maven.springframework.org/snapshot</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<!-- For developing against latest Spring milestones -->
<repository>
<id>org.springframework.maven.milestone</id>
<name>Spring Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
<snapshots><enabled>false</enabled></snapshots>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<warName>spring-social-popup</warName>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
</plugin>
</plugins>
</build>
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
I had the same issue and in my case, adding AOP dependency helped. I guess it's needed for certain parts of Spring security.
Try adding:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.1.0.RELEASE</version>
</dependency>

Resources