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?
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
Thanks!
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
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!
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 {
Files.createDirectory(pathToMusics);
} catch (FileAlreadyExistsException e) {
return pathToMusics.toFile();
} catch (IOException e) {
throw new RuntimeException(e);
}
return pathToMusics.toFile();
}
@Bean
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
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)
Converter
like this
new Converter<File, S3ObjectId>() {
@Override
public S3ObjectId convert(File file) {
return new S3ObjectId(file.getBucketName(), file.getContentId());
}
}
software.amazon.awssdk.services.s3.model.NoSuchBucketException: The specified bucket does not exist...
error..
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.