-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
findAll(Iterable<ID> ids) in CrudRepository throws java.util.concurrent.ExecutionException [DATACOUCH-50] #365
Comments
Michael Nitschinger commented This exception originates on the server side, it shows that you have invalid chars in your documents. Can you pinpoint this document and send it along? Has it been stored through spring-data-couchbase? If so we should make sure they can't go through |
deepak vohra commented Why don't the other methods in CrudRepository, including findOne and findAll, on the same document generate an exception if the document has invalid chars? The documents are added with save(Iterable<S> entities) method. The example used is ArrayList arrayList = new ArrayList();
The generated JSON is and: |
deepak vohra commented Even if the document fields are empty except the Id an exception is generated. For example, Catalog catalog1 = new Catalog("", "",
The following code snippet generates an exception. ArrayList arrayList = new ArrayList();
|
deepak vohra commented Even the following documents, which don't have very many chars,generate an exception. Save with:
Find with: arrayList.add("a");
|
deepak vohra commented The exception is generated due an invalid char in the JSON generated for the request and is not related to JSON stored in the datastore |
Michael Nitschinger commented I tried the code and it works without issues. Also note that the findAll() method doesn't work this way as described here. No argument is supported there, if you want a custom method you need to add one to your interface with a Query param. Please reopen if you still have issues with the current master, and if possible provide a complete code example with data and server version that I can reproduce. Thanks! |
deepak vohra opened DATACOUCH-50 and commented
The other methods in CrudRepository do not generate an exception , but the findAll(Iterable<ID> ids) method generates the following exception with the example from https://github.com/spring-projects/spring-data-couchbase
Exception in thread "main" java.lang.RuntimeException: Failed to access the view
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:759)
at org.springframework.data.couchbase.core.CouchbaseTemplate$5.doInBucket(CouchbaseTemplate.java:196)
at org.springframework.data.couchbase.core.CouchbaseTemplate$5.doInBucket(CouchbaseTemplate.java:192)
at org.springframework.data.couchbase.core.CouchbaseTemplate.execute(CouchbaseTemplate.java:234)
at org.springframework.data.couchbase.core.CouchbaseTemplate.queryView(CouchbaseTemplate.java:192)
at org.springframework.data.couchbase.core.CouchbaseTemplate.findByView(CouchbaseTemplate.java:179)
at org.springframework.data.couchbase.repository.support.SimpleCouchbaseRepository.findAll(SimpleCouchbaseRepository.java:143)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:344)
at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:329)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.data.couchbase.repository.support.ViewPostProcessor$ViewInterceptor.invoke(ViewPostProcessor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy13.findAll(Unknown Source)
at service.CatalogService.findAllDocumentsByCollection(CatalogService.java:103)
at service.CatalogService.main(CatalogService.java:62)
Caused by: java.util.concurrent.ExecutionException: OperationException: SERVER: bad_request Reason: invalid UTF-8 JSON:
error,{2,"lexical error: invalid char in json text.\n"
,"[catalog:engineering-as-a-service, catalog:quintessential-and-collaborative]"}
at com.couchbase.client.internal.HttpFuture.waitForAndCheckOperation(HttpFuture.java:98)
at com.couchbase.client.internal.ViewFuture.get(ViewFuture.java:65)
at com.couchbase.client.internal.ViewFuture.get(ViewFuture.java:49)
at com.couchbase.client.internal.HttpFuture.get(HttpFuture.java:72)
at com.couchbase.client.CouchbaseClient.query(CouchbaseClient.java:752)
... 21 more
Caused by: OperationException: SERVER: bad_request Reason: invalid UTF-8 JSON:
error,{2,"lexical error: invalid char in json text.\n"
,"[catalog:engineering-as-a-service, catalog:quintessential-and-collaborative]"}
at com.couchbase.client.protocol.views.DocsOperationImpl.parseError(DocsOperationImpl.java:105)
at com.couchbase.client.protocol.views.ViewOperationImpl.handleResponse(ViewOperationImpl.java:68)
at com.couchbase.client.ViewNode$MyHttpRequestExecutionHandler.handleResponse(ViewNode.java:225)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.processResponse(AsyncNHttpClientHandler.java:417)
at org.apache.http.nio.protocol.AsyncNHttpClientHandler.inputReady(AsyncNHttpClientHandler.java:242)
at com.couchbase.client.http.AsyncConnectionManager$ManagedClientHandler.inputReady(AsyncConnectionManager.java:249)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:172)
at org.apache.http.impl.nio.DefaultClientIOEventDispatch.inputReady(DefaultClientIOEventDispatch.java:155)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:161)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:335)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:275)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:542)
at java.lang.Thread.run(Thread.java:722)
No further details from DATACOUCH-50
The text was updated successfully, but these errors were encountered: