Uploaded image for project: 'Spring Data for Apache Solr'
  1. Spring Data for Apache Solr
  2. DATASOLR-164

Using Spring Data Solr with Spring Data REST WebMVC

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2 RC1 (Dijkstra)
    • Fix Version/s: None
    • Component/s: Repository
    • Labels:
      None

      Description

      I am working on a POC that involves using spring-data-solr to access Solr server and the results available as a REST. For the REST service I am using spring-data-rest-webmvc package. When I try to access the Solr using a REST call I get the following error:

      http://localhost:8080/contracts_search/search/findById?id=1000

      {
      "cause" : null,
      "message" : "Cannot create self link for class com.sample.solr.document.Contract! No persistent entity found!"
      }

      The stack trace
      Stack Trace
      2014-05-17 18:12:10.065 ERROR 17172 — [nio-8080-exec-4] s.d.r.w.AbstractRepositoryRestController : Cannot create self link for class com.sample.solr.document.Contract! No persistent entity found!

      java.lang.IllegalArgumentException: Cannot create self link for class com.sample.solr.document.Contract! No persistent entity found!
      at org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler.getSelfLinkFor(PersistentEntityResourceAssembler.java:81)
      at org.springframework.data.rest.webmvc.PersistentEntityResourceAssembler.toResource(PersistentEntityResourceAssembler.java:64)
      at org.springframework.data.rest.webmvc.AbstractRepositoryRestController.resultToResources(AbstractRepositoryRestController.java:213)
      at org.springframework.data.rest.webmvc.RepositorySearchController.executeQueryMethod(RepositorySearchController.java:222)
      at org.springframework.data.rest.webmvc.RepositorySearchController.executeSearch(RepositorySearchController.java:135)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      pom.xml (dependencies only)

      <dependencies>
      <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      </dependency>

      <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-solr</artifactId>
      <version>1.2.0.RC1</version>
      </dependency>

      <dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-rest-webmvc</artifactId>
      <version>2.1.0.RC1</version>
      </dependency>

      </dependencies>

      My test case is very simple accessing Solr documents with just a few fields.

      Can post code if more details is needed? Any ideas on where to start looking?

        Attachments

          Activity

            People

            • Assignee:
              cstrobl Christoph Strobl
              Reporter:
              ajegam Jega A
              Last updater:
              Oliver Drotbohm
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: