Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    yes , version tree
    workingCopy doesn't set @SuccessorId, I think I have to use this method
    If I don't have field annotated with @SuccessorId, Is version can replaced with workingCopy?
    Paul Warren
    That's what it should do, yes. The idea is that the user creates a workingCopy that only they can see/edit and when they are ready (i.e. several days/edits later) they version that workingCopy and it becomes available to everyone.
    But it is a version series, not a tree I never intended workingCopy to be used as a version tree. I am not sure how you would do that actually. But if it works for you then great.
    I need to restore to history content when process is returned , and then create new version copy on that version
    Paul Warren
    That should be what workingCopy does. The editor should get the workingCopy content. Everyone else should get the original content until it is versioned
    Paul Warren
    But now you mention it I cant remember creating those tests actually so let me go check whether, or not, we have them. I can point you at them as a reference
    Hi @paulcwarren - Does Spring content has "store support" for "Google cloud storage" also? I can find examples for Amazon S3 only.
    12 replies
    Hi. I'm looking at spring content filesystem. Is there a way to customize the file paths? My customers would like the files be sorted by project and month for example. Is that possible with this library?
    4 replies
    Leon Galushko
    Hi. I have a problem, Hibernate generates 3 queries to fetch image for each product.
    How can we optimize image fetching? I created the question at stackoverflow with project that replicates the issue and generated queries https://stackoverflow.com/questions/65791927/spring-content-hibernate-executes-3-queries-to-fetch-image-for-each-product
    5 replies
    Martin Sefcik
    Hi, are there any plans to replace aws sdk to version 2.0 ?
    12 replies
    Martin Sefcik

    Is it theoretically possible to place two store systems on classpath e.g. s3 and filesystem and based on the application property switch which one should be used ?

    I tried something like this:

    @ConditionalOnProperty(prefix = "springcontentdemo.storage", name = "type", havingValue = "filesystem")
    public class FilesystemStorageConfig { ... }
    @ConditionalOnProperty(prefix = "springcontentdemo.storage.", name = "type", havingValue = "s3", matchIfMissing = true)
    public class S3StorageConfig { ... }

    and i have spring-content-fs and spring-content-s3 as project dependencies and it is not working ... content store beans are not created ... it looks like FilesystemStoreRegistrar and S3StoresRegistrar are in conflict in case they both are on classpath.
    Even in case I remove one of these two spring config classes then it does not help ... it starts working only when I remove one of these two dependencies (s3 or fs) from project

    7 replies
    Martin Sefcik

    Is it ok that in DefaultS3StoreImpl#setContent(S, java.io.InputStream) method os variable is closed twice ? one using IOUtils.closeQuietly(os) and the second time in finally block os.close() ?
    problem is that this second closing of output stream sometimes (not sure when and why) causes that SimpleStorageResource.finishSimpleUpload() method is invoked again, so s3client is uploading file twice and the second try fails with this error:
    Caused by: com.amazonaws.SdkClientException: Unable to verify integrity of data upload. Client calculated content hash (contentMD5: FQeFaRaSLRVt4MnXW7KyWQ== in base 64) didn't match hash (etag: 5289df737df57326fcdd22597afb1fac in hex) calculated by Amazon S3.

    I can reproduce it very easily when I try to call setContent method twice with different stream, e.g. something like this:

            designPlanAttachmentStore.setContent(attachment, new ByteArrayInputStream(FILE_DATA));
            designPlanAttachmentStore.setContent(attachment2, new ByteArrayInputStream(FILE_DATA_2));

    the first setContent call is always successful (calling of os.close() in finally block does not trigger finishSimpleUpload()), but it always fails on the second setContent call as in this case os.close() in finally block trigger finishSimpleUpload()

    I'm not sure if problem is this os.close() in finally block or there is some issue in SimpleStorageResource

    10 replies
    Hello there, we are looking for a small CMS that allows us to manage news articles, videos and images. As we are a team of java developers, we have found this project. Is there an example that leads into that direction? I have found those: https://github.com/paulcwarren/spring-content-examples but I am lacking the overview/insights there :)
    1 reply
    Lauren Ward

    Hi @paulcwarren,

    My organization is reviewing CMS frameworks. Do you have any updates on spring-content graduating to spring-projects in GitHub? I saw your post from 2018 (paulcwarren/spring-content#45). Also, do you have any names you can share about companies or groups currently using spring-content?

    1 reply
    Piotr Jastrzebski
    Hi, Im getting this exception org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! JpaTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single JpaTransactionManager for all transactions on a single DataSource, no matter whether JPA or JDBC access. after I setContent with jpa with postgres db. latest spring boot + content. This seem to happen when TM is accessed on same thread from different source. Its probably config issue on my side, but Im not very well versed. Any ideas?
    4 replies
    Andy Elliott
    Hi Paul, just wondering when the 1.2.4-SNAPSHOT will be considered fro release?
    3 replies
    Hi @paulcwarren
    5 replies
    I've found out that spring.content.storage.type.default property is not working for jpa store, since every JpaStoresRegistrar child doesn't override getOverridePropertyValue method
    2 replies
    Hi Paul, I want to develop a module to support for aliyun OSS, where can I start?
    so far, spring has
    Minio is needed as well
    I have some problem , when I use s3 to connect to minio and alicloud oss,
    I can't find what is going on there,
    1 reply

    Hi Paul, I am having problems with S3ContentStore and aws-messaging dependencies.
    I am using S3ContentStore with no problems until I added the aws-messaging dependency to use amazon sqs service.

    Now, I can't start the app, this is the error at startup:
    Parameter 1 of constructor in internal.org.springframework.content.s3.config.S3StoreFactoryBean required a single bean, but 2 were found:

    - s3Client: defined by method 's3Client' in class path resource [internal/org/springframework/content/s3/boot/autoconfigure/S3ContentAutoConfiguration.class]
    - amazonS3: defined in null

    Without this dependency the application runs properly, any idea?
    I am using Spring Boot 2.4.5 and Spring Content 1.2.4

    2 replies
    Hi @paulcwarren , I'm using Spring Content Rest + S3 for creating audio player. I have a question about loading file from S3. If user start listening in the middle of audio, does spring content load a full file from S3, or only part of it?
    6 replies
    Hi @paulcwarren , No space left on /tmp device .
    When I deploy to production,"sc*bsce" file doesn't delete when file is uploaded.
    And , finaly reproduce this Exception:
    java.nio.file.FileSystemException: /tmp/sc3699270461306145586bsce: No space left on device
    at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
    at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
    at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
    at java.nio.file.Files.newByteChannel(Files.java:361)
    at java.nio.file.Files.createFile(Files.java:632)
    at java.nio.file.TempFileHelper.create(TempFileHelper.java:138)
    at java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:161)
    at java.nio.file.Files.createTempFile(Files.java:897)
    at internal.org.springframework.content.commons.repository.factory.StoreImpl.setContent(StoreImpl.java:50)
    at sun.reflect.GeneratedMethodAccessor614.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at internal.org.springframework.content.commons.repository.factory.StoreMethodInterceptor.invoke(StoreMethodInterceptor.java:66)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.versions.interceptors.PessimisticLockingInterceptor.invokeWithIntecept(PessimisticLockingInterceptor.java:57)
    at org.springframework.versions.interceptors.PessimisticLockingInterceptor.invoke(PessimisticLockingInterceptor.java:37)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.versions.interceptors.OptimisticLockingInterceptor.invoke(OptimisticLockingInterceptor.java:62)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
    at com.sun.proxy.$Proxy311.setContent(Unknown Source)
    Disk was fulled by "sc*bsce" file
    1 reply
    Leon Galushko

    Hi @paulcwarren , can you help with a couple of questions? For the first problem with ".docx" extension created demo to reproduce issue, attached to SO ticket



    2 replies
    i have a question about Elasticsearch.
    Is is possible to use Elasticserch as contentstore or is it only for search purposes in springContent?
    4 replies
    Noor Khan
    Spring content looks very interesting but I am wondering why it is not endorsed by spring yet. It is not listed on spring website as other spring projects are listed.
    1 reply
    Zsombor Joel Gyurkovics

    Hi @paulcwarren and everyone else!
    I'm creating a poc with spring content (gradle - java 8 - spring boot 2.4.9)
    I was able to use Spring Content Filesystem properly.
    Im following the documentation about Spring Content Azure Storage (1.2.6) - but I get bean not found exception.

    "Field contentStore in com.example.demospringcontentazure.services.SopDocumentService required a bean of type 'com.example.demospringcontentazure.repositories.SopDocumentContentStore' that could not be found."

    Where can I go wrong here? Thank you for the answer!

    • Added @EnableAzureStorage
    • I have @Repository annotation
    • extended AzureStorageContentStore<SopDocument, UUID> (or just ContentStore)
    • added spring.content.storage.type.default=azs
    1 reply

    Hello everyone,
    I have an entity Music which store mp3 (in d:\work\musics) and now i have a Person entity with a profile picture and i would like to store it in an other directory (d:\work\profilePictures)
    Is it possible to specify on ContentStore where the files are stored ?

    I found something like this on replies, it works but its set for all content store.

       @Bean(name = "filesystemRoot")
    File filesystemRoot() {
        Path pathToMusics = Paths.get("D:\\WORK\\musics");
        try {
        } catch (FileAlreadyExistsException e) {
            return pathToMusics.toFile();
        } catch (IOException e) {
            throw new RuntimeException(e);
        return pathToMusics.toFile();
    FileSystemResourceLoader fileSystemResourceLoader() {
        return new FileSystemResourceLoader(filesystemRoot().getAbsolutePath());

    I would like to set the global setting on d:\work and then configure the subdirectory for each content store, but i don't know how to manage it.
    If someone has an idea, he s welcome :)
    Thx all

    2 replies
    John Thompson

    Hi all, I'm in the process of updating a Spring Boot 2.0.x application to Spring Boot 2.4.13, and migrating from spring-content 0.0.9 to 2.1.0 and getting a StackoverflowError. On Java 11 (11.0.6 Oracle & azul 11.0.3 (for M1)) same results. Any ideas???

    Caused by: java.lang.StackOverflowError at java.base/java.lang.reflect.Field.getAnnotation(Field.java:1142) at java.base/java.lang.reflect.AnnotatedElement.isAnnotationPresent(AnnotatedElement.java:274) at java.base/java.lang.reflect.AccessibleObject.isAnnotationPresent(AccessibleObject.java:517) at org.springframework.content.commons.mappingcontext.ContentPropertyBuilderVisitor.visitField(ContentPropertyBuilderVisitor.java:92) at org.springframework.content.commons.mappingcontext.ClassWalker.accept(ClassWalker.java:24)

    24 replies
    Joshua J. A. Harwood
    Hi all, newbie question. Using the Github examples, I have a JPA entity (‘Image’), an ImageRepository and an ImageStore. How do I execute my own behaviour when GET is called on ‘’, for example? What if I wanted to create an entity and store its content in a single POST request? Many thanks, Josh.
    5 replies
    Hello, I am in the process of using com.github.paulcwarren:content-s3-spring-boot-starter for some POC. I have added a converter to customize the S3ObjectId
    I want to group files in S3 buckets similar to files in a filesystem, so i have configured a Converter like this
    new Converter<File, S3ObjectId>() {
        public S3ObjectId convert(File file) {
            return new S3ObjectId(file.getBucketName(), file.getContentId());        
    the problem tho is that I now get a software.amazon.awssdk.services.s3.model.NoSuchBucketException: The specified bucket does not exist... error..
    is there any way to configure am implicit creation on new buckets without having to invoke the aws sdk createBucket everytime .. ?
    14 replies
    Michael Hill
    Hi All, I am using spring-content-jpa via spring boot starter. I'm connecting to a SQL Server database. Is there a way to force the creation and access to the BLOBS table to a specific schema? BLOBS seems to always be created in the dbo schema.
    1 reply
    Joshua J. A. Harwood
    Hey, does anyone have an elegant solution to limit the mime-type of content PUT over REST? Ideally, if the wrong content type was sent, the server would respond with 415 Unsupported Media Type
    1 reply
    Joshua J. A. Harwood

    Can Stores be injected in to Spring Data tests?

    This code: https://pastebin.com/SWyP6KkW

    returns the following exception:


    The Repository injects successfully, but it can’t find the Store.

    6 replies