Comments (8)
Hi @ddxl123 , the POST looks wrong to me. You cannot POST content to the avatars collection. You can only POST content to avatar entities. You would need to POST to http://192.168.1.3:8080/avatars/{id}
or http://192.168.1.3:8080/avatars/{id}/content
(since you added a content property by correlating the attributes)
from spring-content.
Hi @ddxl123 , the POST looks wrong to me. You cannot POST content to the avatars collection. You can only POST content to avatar entities. You would need to POST to
http://192.168.1.3:8080/avatars/{id}
orhttp://192.168.1.3:8080/avatars/{id}/content
(since you added a content property by correlating the attributes)
@paulcwarren
http://192.168.1.3:8080/avatars/1 or http://192.168.1.3:8080/avatars/1/content still the same mistake.
response: {
"timestamp": "2023-08-16T04:46:57.969+00:00",
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/avatars/1"
}
from spring-content.
Perhaps your app is not initializing spring content rest properly. Any chance you can provide a repro-able sample?
Alternatively, I have a working spring-content-fs/rest example here
from spring-content.
If you want to debug it you can put a breakpoint in DispatcherServlet.doDispatch and see what handler it is selecting for this request.
from spring-content.
I’m not sure what’s going on, but it’s suddenly fine now, but I haven’t changed anything, it’s weird…
from spring-content.
If you want to debug it you can put a breakpoint in DispatcherServlet.doDispatch and see what handler it is selecting for this request.
from spring-content.
If you want to debug it you can put a breakpoint in DispatcherServlet.doDispatch and see what handler it is selecting for this request.
@paulcwarren
In this case, you must use Content-Type:application/hal+json
+POST 192.168.1.3:8080/avatars/1
to request (create this data row), and then use Content-Type:image/png
+ POST 192.168.1.3:8080/avatars/1
to store it to succeed, if you store it directly, it will appear 404
.
I looked at the document tutorial and it seems to be like this. The tutorial in the document is not easy to understand for beginners. You should add emphasis: "You must first [First create an entity]".
from spring-content.
Assuming you are using a ContentStore then yes (which is what 99% of users do) then yes the entity has to be created and exist before you can associate and store content with it.
If you look at the valid POST URIs (for content 192.168.1.3:8080/avatars/1
and 192.168.1.3:8080/avatars/1/content
) you can see it is an entity-based URI because the content is associated with the entity.
from spring-content.
Related Issues (20)
- REST content request gives 404 when using spring.data.rest.base-path HOT 4
- Spring Method Security does not seem to work correctly. HOT 18
- Incompatibility between used versions of Hibernate Commons Annotations (5.1.2.Final) and Hibernate Core (6.1.7.Final) HOT 3
- Circular references in `AzureStorageConfiguration` during application startup HOT 1
- Spring-Content-JPA 2.9.0 nullpointer exception trying to setContent HOT 3
- Unable to use @EnableS3Stores in junit test annotated with @DataJpaTest HOT 9
- LockingAndVersioningRepositoryImpl seems to be shared between multiple repositories but caches EntityInformation HOT 2
- S3ContentStore, FilesystemContentStore, etc extend deprecated ContentStore HOT 2
- spring-content-fs depends on old version of Hibernate
- Fail to set content on nested content properties when using JPA. HOT 2
- @ContentLength field is set to 0 instead of null for nullable types
- POST to content-property without content-type results in NPE / HTTP-500 HOT 1
- Link relation and path configured with @RestResource ignored for content properties with multiple capital letters HOT 1
- Do not include junit as compile dependency
- Exception with unsetContent using SB3 and SC3.0.4 JPA Starter HOT 1
- File download not working on windows platform HOT 1
- How do I configure com.github.paulcwarren:spring-content-bom for spring boot kotlin gradle? HOT 1
- Hibernate dependency error HOT 4
- Investigation into the cause of `java.lang.NullPointerException: Cannot invoke "org.springframework.content.commons.storeservice.StoreInfo.getInterface()" because the return value of "internal.org.springframework.content.rest.io.StoreResource.getStoreInfo()" is null`
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-content.