Skip to content
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

file don't upload using spring content #38

Closed
ghost opened this issue Jun 13, 2018 · 5 comments
Closed

file don't upload using spring content #38

ghost opened this issue Jun 13, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Jun 13, 2018

try to upload file using spring but can't.
here is stack trace,

java.lang.IllegalStateException: Error processing condition on internal.org.springframework.content.jpa.boot.autoconfigure.JpaContentAutoConfiguration.databaseInitializer
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:180) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:141) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:328) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:93) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243) [spring-boot-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at com.onlineshopping.OnlineShoppingApplication.main(OnlineShoppingApplication.java:10) [main/:na]
Caused by: java.lang.IllegalStateException: @ConditionalOnMissingBean did not specify a bean using type, name or annotation and the attempt to deduce the bean's type failed
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.validate(OnBeanCondition.java:389) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:379) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:114) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
... 17 common frames omitted
Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for internal.org.springframework.content.jpa.boot.autoconfigure.JpaContentAutoConfiguration.databaseInitializer
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.addDeducedBeanTypeForBeanMethod(OnBeanCondition.java:442) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.addDeducedBeanType(OnBeanCondition.java:426) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.(OnBeanCondition.java:373) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
... 19 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/autoconfigure/AbstractDatabaseInitializer
at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.8.0_171]
at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[na:1.8.0_171]
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.8.0_171]
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[na:1.8.0_171]
at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[na:1.8.0_171]
at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[na:1.8.0_171]
at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[na:1.8.0_171]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_171]
at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[na:1.8.0_171]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_171]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_171]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_171]
at org.springframework.util.ClassUtils.forName(ClassUtils.java:274) ~[spring-core-5.0.6.RELEASE.jar:5.0.6.RELEASE]
at org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanSearchSpec.addDeducedBeanTypeForBeanMethod(OnBeanCondition.java:436) ~[spring-boot-autoconfigure-2.0.2.RELEASE.jar:2.0.2.RELEASE]
... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.autoconfigure.AbstractDatabaseInitializer
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_171]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_171]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_171]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_171]
... 35 common frames omitted

@paulcwarren
Copy link
Owner

paulcwarren commented Jun 13, 2018

Hi @adrian-carlitos. Looks like you are using Spring Boot 2. In my original SO post I told you to use SC dependencies version 0.0.11 - which is the Spring Boot 1 codeline. In Spring Boot one the AbstractDatabaseInitializer class was called something like AbstractDatasourceInitializer.

Try using 0.1.0 instead of 0.0.11 version of Spring Content. 0.1.0 is our Spring Boot 2 code-line.

I updated the SO post as well.

Let me know if that fixes this issue.

@ghost
Copy link
Author

ghost commented Jun 14, 2018

Thanks for you feedback.
You save my days.
Can you please give full tutorial for upload image or other file, which will stored in specific folder? I searched, but didn't get.

@paulcwarren
Copy link
Owner

We have getting started guides here and here. Are these what you are looking for? If not, what is missing from your perspective?

@ghost
Copy link
Author

ghost commented Jun 15, 2018

Thanks @paulcwarren. It's working.

@paulcwarren
Copy link
Owner

Awesome. Will close.

Don't forget there are plenty of interesting things that Spring Content can help you do with content like stream video, get renditions in different formats; i.e. get an image of a pdf or word doc for example, search inside documents and so on...

Let us know if you have any other issues or requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant