Comments (6)
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
from spring-data-couchbase.
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();
Catalog catalog1 = new Catalog("Oracle_Magazine", "Oracle_Publishing",
"November-December_2013", "Engineering as a Service",
"David_A._Kelly");
Catalog catalog2 = new Catalog("Oracle_Magazine", "Oracle_Publishing",
"11/12_2013", "Engineering_as_a_Service", "Kelly, David");
arrayList.add(catalog1);
arrayList.add(catalog2);
repository.save(arrayList);
The generated JSON is
{
"journal": "Oracle_Magazine",
"author": "David_A._Kelly",
"edition": "November-December_2013",
"title": "Engineering as a Service",
"_class": "com.couchbase.model.Catalog",
"publisher": "Oracle_Publishing"
}
and:
{
"journal": "Oracle_Magazine",
"author": "Kelly, David",
"edition": "11/12_2013",
"title": "Engineering_as_a_Service",
"_class": "com.couchbase.model.Catalog",
"publisher": "Oracle_Publishing"
}
from spring-data-couchbase.
deepak vohra commented
Even if the document fields are empty except the Id an exception is generated.
For example,
Catalog catalog1 = new Catalog("", "",
"", "Engineering as a Service",
"");
Catalog catalog2 = new Catalog("", "",
"", "Engineering_as_a_Service", "");
arrayList.add(catalog1);
arrayList.add(catalog2);
repository.save(arrayList);
The following code snippet generates an exception.
ArrayList arrayList = new ArrayList();
arrayList.add("catalog:engineering-as-a-service");
arrayList.add("catalog:engineering_as_a_service");
Iterable<Catalog> iterable = repository.findAll(arrayList);
from spring-data-couchbase.
deepak vohra commented
Even the following documents, which don't have very many chars,generate an exception.
Save with:
Catalog catalog1 = new Catalog("", "",
"", "a",
"");
Catalog catalog2 = new Catalog("", "",
"", "b", "");
arrayList.add(catalog1);
arrayList.add(catalog2);
repository.save(arrayList);
Find with:
arrayList.add("a");
arrayList.add("b");
Iterable<Catalog> iterable = repository.findAll(arrayList);
Iterator<Catalog> iter = iterable.iterator();
from spring-data-couchbase.
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
from spring-data-couchbase.
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!
from spring-data-couchbase.
Related Issues (20)
- Release 5.3 M2 (2024.0.0)
- Reintroduce Javadoc legacy mode
- Remove Querydsl and `com.couchbase` split packages HOT 2
- How to set the different config for different environments while using AbstractCouchbaseConfiguration HOT 2
- Bug: Regression - Spring Boot 3.2.3 app fails to compile with Spring Data Couchbase HOT 1
- issue with querydsl HOT 2
- "TypeAlias" does't work along with abstraction HOT 12
- update Couchbase Java SDK to 3.6.0 in main
- javax.inject dependency HOT 1
- Release 5.1.11 (2023.0.11)
- Release 5.2.5 (2023.1.5)
- Release 5.3 RC1 (2024.0.0)
- java.lang.NoClassDefFoundError: javax/inject/Inject: javax.inject.Inject when upgrading to Spring Boot 3.2.4 HOT 7
- Auto Index Creation creates indexes under _default scope HOT 1
- Sorry for the delay @mikereiche , Thanks for all the clarification.
- Compilation error due to QueryDSL annotation processor in Spring Data Couchbase 5.2.4 HOT 4
- Release 5.1.12 (2023.0.12)
- Release 5.2.6 (2023.1.6)
- Release 5.3 GA (2024.0.0)
- Runtime error when calling DeleteAllById(Iterable<T> list) if the repository extends DynamicProxyable
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-data-couchbase.