Announcement Announcement Module
Collapse
No announcement yet.
Using Cross Store. Maven dependencies with SDN/SDJPA and SD Commons Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Cross Store. Maven dependencies with SDN/SDJPA and SD Commons

    Usually I use the github repo that has multiple Spring Data versions showing which works with which version. But it is 4 months old so I think missing more recent Spring Data versions.

    Now when I am trying to run my test, I can't create my App context because of conflicts.

    I either get

    Caused by: org.xml.sax.SAXParseException; systemId: http://www.springframework.org/schem...neo4j-2.0.xsd; lineNumber: 32; columnNumber: 51; src-resolve: Cannot resolve the name 'repository:repository' to a(n) 'type definition' component.

    When I just let the Spring Data JPA bring with it the Spring Data Commons version, which might cause this problem.

    Or if I have a separate dependency tag in my pom to Spring Data Commons using

    <spring-data-jpa.version>1.2.0.RELEASE</spring-data-jpa.version>
    <spring-data-neo4j.version>2.1.0.RC1</spring-data-neo4j.version>
    <spring-data-commons.version>1.3.1.RELEASE</spring-data-commons.version>

    In which for SDN and JPA deps I add <exclusions> tag so they don't get commons, but the separate dep tag does, I get TypeNotPresent errors.

    Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProx y

    When I have the following in my pom file.

    Code:
            <!-- Spring Data JPA -->
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-jpa</artifactId>
                <version>${spring-data-jpa.version}</version>
                <!--exclusions>
                    <exclusion>
                        <groupId>org.springframework.data</groupId>
                        <artifactId>spring-data-commons-core</artifactId>
                    </exclusion>
                </exclusions-->
            </dependency>
    
            <!-- Spring Data Neo4j -->
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-neo4j</artifactId>
                <version>${spring-data-neo4j.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.data</groupId>
                        <artifactId>spring-data-commons-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-commons-core</artifactId>
                <version>${spring-data-commons.version}</version>
            </dependency>
    Thanks

    Mark

  • #2
    OK, think I got past this without anymore conflicts. I'll post what I did in a couple minutes. Just have something in my clipboard I have to paste into a new thread first.

    Mark

    Comment


    • #3
      OK here are the versions I am using now

      <spring-data-jpa.version>1.2.0.RELEASE</spring-data-jpa.version>
      <spring-data-neo4j.version>2.1.0.RC3</spring-data-neo4j.version>
      <spring-data-commons.version>1.3.2.RELEASE</spring-data-commons.version>

      And the pom dependency tags

      Code:
              <!-- Spring Data JPA -->
              <dependency>
                  <groupId>org.springframework.data</groupId>
                  <artifactId>spring-data-jpa</artifactId>
                  <version>${spring-data-jpa.version}</version>
              </dependency>
      
              <!-- Spring Data Neo4j -->
              <dependency>
                  <groupId>org.springframework.data</groupId>
                  <artifactId>spring-data-neo4j</artifactId>
                  <version>${spring-data-neo4j.version}</version>
                  <exclusions>
                      <exclusion>
                          <groupId>org.springframework.data</groupId>
                          <artifactId>spring-data-commons-core</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
              <dependency>
                  <groupId>org.springframework.data</groupId>
                  <artifactId>spring-data-neo4j-rest</artifactId>
                  <version>${spring-data-neo4j.version}</version>
              </dependency>
      Mark

      Comment


      • #4
        Any reason you have such a mixed bag of dependencies? The latest release train release included the following versions:

        SD Commons 1.4
        SD JPA 1.2
        SD Neo4J 2.1

        All in GA. Expect bugfix releases within these versions to work fine with each other. Expect things to horribly blow up in case you mix other versions, esp. as SD JPA is very unlikely to fully work with SD Commons 1.3.

        Cheers,
        Ollie

        [0] http://www.springsource.org/node/3703

        Comment


        • #5
          Because we use many different databases in our application. In the case of those three, we have some of our user data in a relational database and other parts in Neo4J. We also are using MongoDB and Redis in our application. I would love to be able to use Spring Data for all those databases within the same application.

          Thanks

          Mark

          Comment


          • #6
            Originally posted by Oliver Gierke View Post

            All in GA. Expect bugfix releases within these versions to work fine with each other. Expect things to horribly blow up in case you mix other versions, esp. as SD JPA is very unlikely to fully work with SD Commons 1.3.

            Cheers,
            Ollie

            [0] http://www.springsource.org/node/3703
            All .RELEASE versions in maven? The Spring Data pages for each of those projects say a little bit different. Maybe those websites need updating?

            Thanks

            Mark

            Comment


            • #7
              Yes… never rely on the websites. search.maven.org speaks the truth

              Comment


              • #8
                Originally posted by Oliver Gierke View Post
                Yes… never rely on the websites. search.maven.org speaks the truth
                Says the man who probably is partly responsible for keeping the website up to date.

                Thanks

                Mark

                Comment

                Working...
                X