Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Spring data
Spring data [message #1020409] Mon, 18 March 2013 05:24 Go to next message
Daniel McGreal is currently offline Daniel McGrealFriend
Messages: 27
Registered: April 2012
Junior Member
Hi, has anyone had any success using Spring Data (JPA) in Virgo? Their OSGi imports required upgrading Virgo's Spring version which seems to have worked, but then I get conflicts on javax.persistence. Hibernate needs v.1 and spring data jpa needs v2. Is there a way of resolving this?
Re: Spring data [message #1022771 is a reply to message #1020409] Fri, 22 March 2013 13:44 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

I succeed to make it work... but with eclipselink Razz

Here's the scoped plan: https://github.com/Tcharl/virgo.plans/tree/master/virgo-plans.jpa

Regards.
Re: Spring data [message #1023261 is a reply to message #1020409] Sat, 23 March 2013 19:53 Go to previous messageGo to next message
Daniel McGreal is currently offline Daniel McGrealFriend
Messages: 27
Registered: April 2012
Junior Member
Thanks! I was just about to try the same.
Re: Spring data [message #1023269 is a reply to message #1023261] Sat, 23 March 2013 20:22 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

I'm happy to help...

Just in case, if a day you try and succeed to run cxf (jaxrs) in Virgo RT, please let me just know Wink
Re: Spring data [message #1023596 is a reply to message #1023269] Sun, 24 March 2013 17:28 Go to previous message
Daniel McGreal is currently offline Daniel McGrealFriend
Messages: 27
Registered: April 2012
Junior Member
I ended up using EclipseLink 4.0.0, Spring Framework 3.1.3.RELEASE, Spring Data JPA 1.2 (with all its pom imports excluded) and the following relevant MANIFEST:
Import-Bundle: com.springsource.com.mysql.jdbc;version="[5.1.6,5.1.6]",
 org.eclipse.persistence.jpa;version="2.4.0", org.eclipse.persistence.core;version="2.4.0",
 javax.persistence;version="[2.0.0,3.0.0)",
 org.springframework.data.jpa;version="1.2.0", org.springframework.data.core;version="1.2.0"
Excluded-Imports: org.eclipse.persistence.internal.*


However, I removed javax.persistence from repository/usr and I edited the new javax.persistence to not import org.osgi.service.jpa (because it itself exports it) - are there any side effects to this? Or is there a better way? My pom is the following, with some deployment stuff redacted:

	<properties>
		<java.version>1.7</java.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<spring.version>3.1.3.RELEASE</spring.version>
		<spring-security.version>3.1.0.RELEASE</spring-security.version>
		<org.eclipse.persistence.version>2.4.0</org.eclipse.persistence.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.core</artifactId>
			<version>${spring.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.test</artifactId>
			<version>${spring.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.aop</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.aspects</artifactId>
			<version>${spring.version}</version>
		</dependency>


		<dependency>
			<groupId>com.mysql.jdbc</groupId>
			<artifactId>com.springsource.com.mysql.jdbc</artifactId>
			<version>5.1.6</version>
		</dependency>


		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>3.2.1</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.jdbc</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>org.springframework.orm</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-pool</groupId>
			<artifactId>commons-pool</artifactId>
			<version>1.5.6</version>
		</dependency>
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<version>1.3</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>javax.persistence</artifactId>
            <version>2.0.3</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.jpa</artifactId>
            <version>${org.eclipse.persistence.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.osgi</artifactId>
            <version>${org.eclipse.persistence.version}</version>
            <scope>compile</scope>
        </dependency>

			
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-jpa</artifactId>
			<version>1.2.0.RELEASE</version>
			<!-- <exclusions>
				<exclusion>
					<artifactId>spring-orm</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
				<exclusion>
					<artifactId>spring-context</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
				<exclusion>
					<artifactId>spring-aop</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
				<exclusion>
					<artifactId>spring-tx</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
				<exclusion>
					<artifactId>spring-beans</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
				<exclusion>
					<artifactId>spring-core</artifactId>
					<groupId>org.springframework</groupId>
				</exclusion>
				<exclusion>
					<artifactId>slf4j-api</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
				<exclusion>
					<artifactId>aspectjrt</artifactId>
					<groupId>org.aspectj</groupId>
				</exclusion>
				<exclusion>
					<artifactId>jcl-over-slf4j</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions> -->
		</dependency>
		
	</dependencies>

	<repositories>
		<repository>
			<id>com.springsource.repository.bundles.release</id>
			<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
			<url>http://repository.springsource.com/maven/bundles/release</url>
		</repository>
		<repository>
			<id>com.springsource.repository.bundle.external</id>
			<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
			<url>http://repository.springsource.com/maven/bundles/external</url>
		</repository>
		<repository>
			<id>com.springsource.repository.libraries.release</id>
			<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
			<url>http://repository.springsource.com/maven/libraries/release</url>
		</repository>
		<repository>
			<id>com.springsource.repository.libraries.external</id>
			<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
			<url>http://repository.springsource.com/maven/libraries/external
			</url>
		</repository>
		<repository>
			<id>com.springsource.repository.bundles.snapshot</id>
			<name>EBR Spring Snapshot Repository</name>
			<url>http://repository.springsource.com/maven/bundles/snapshot</url>
		</repository>
		<repository>
			<id>org.maven.repo1</id>
			<name>You are now arriving at Maven Central</name>
			<url>http://repo1.maven.org/maven2</url>
		</repository>

		<repository>
			<id>EclipseLink</id>
			<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
		</repository>
	</repositories>


Oh and P.S. While I'd love to help with CXF, I doubt I'll need it anytime soon. And besides, your poms are much more elegant than mine, so I doubt I could do any better anyway Razz Lots of thanks Charlie, and Glyn too whose posts in other threads are invaluable.

[Updated on: Sun, 24 March 2013 17:31]

Report message to a moderator

Previous Topic:NoClassDefFoundError for javax.annotation.Priority
Next Topic:Remote Node Management
Goto Forum:
  


Current Time: Wed Apr 24 23:23:47 GMT 2024

Powered by FUDForum. Page generated in 0.03580 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top