I'm working on One Hippo CMS, when I run the Tomcat server I'm getting this error
5.02.2019 18:23:45 ERROR main [DefaultHstSiteConfigurer.initializeComponentManager:264] HstSiteConfigurer: ComponentManager initialization failed.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.hippoecm.hst.content.beans.manager.ObjectConverter' defined in class path resource [org/hippoecm/hst/site/container/SpringComponentManager-content-beans.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Annotated class 'org.example.myproject.beans.Urldemo' for primarytype 'myproject:urldemo' is a duplicate of already registered class 'org.example.myproject.beans.Simple'. You might have configured a bean that does not have a annotation for the jcrType and inherits the jcrType from the bean it extends, resulting in 2 beans with the same jcrType. Correct your beans.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) ~[spring-beans-5.1.1.RELEASE.jar:5.1.1.RELEASE]
Check the annotations on:
org.example.myproject.beans.Urldemo
org.example.myproject.beans.Simple
They should each have an annotation similar to:
#Node(jcrType = "project:doctype")
Each needs a unique jcrType value.
Related
For Springboot application using optaplanner-spring-boot-starter, the cloudbalancing problem solution works fine with one planning solution and solverManager similar to
https://github.com/DuncanDoyle/optaplanner-sbs-cloud-balancing/tree/master/optaplanner-sbs , but when multiple planning solutions are defined and called using a solverManager it throws an error
Caused by:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'solverFactory' defined in class path
resource
[org/optaplanner/spring/boot/autoconfigure/OptaPlannerAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'solverFactory'
parameter 0; nested exception is
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'solverConfig' defined in class path resource
[org/optaplanner/spring/boot/autoconfigure/OptaPlannerAutoConfiguration.class]:
Bean instantiation via factory method failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate [org.optaplanner.core.config.solver.SolverConfig]: Factory
method 'solverConfig' threw exception; nested exception is
java.lang.IllegalStateException: Multiple classes ([class
com.test.model.PRCaseAssignment, class
com.test.model.CaseAssignment]) found with a
#PlanningSolution annotation.
How can we define multiple #PlanningSolution classes and call using the solverManager, are there any kind of Qualifiers which needs to be annotated? Any help is appreciated. Thanks.
May I ask what is the use case for having multiple solution classes?
The optaplanner-spring-boot-starter supports only a single solver configuration and thus only a single solution class. So does the SolverManager API: you can submit multiple planning problems to the SolverManager, but they have to be of the same type (solution class) and share the same solver configuration. To submit a planning problem of a different type, you have to create a new instance of the SolverManager. See the documentation on how to create an instance of the SolverManager manually.
I'm trying to migrate from spring 3.0.5 to spring 4.1.X .
Spring 3 has Class named as "org.springframework.scheduling.quartz.CronTriggerBean"
But Spring 4 doesn't include this class name.
[5/28/15 20:10:16:798 EDT] 00000092 ClassPathXmlA W
org.springframework.context.support.AbstractApplicationContext
__refresh Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [org.springframework.scheduling.quartz.CronTriggerBean] for
bean with name 'beanIdName' defined in class path resource
[config/spring/WxsCacheContext.xml]; nested exception is
java.lang.ClassNotFoundException:
org.springframework.scheduling.quartz.CronTriggerBean
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)
I have tried alternative like "spring-support" which has the same class. But no luck.
After getting that jar, it is giving errors about the quartz
[5/28/15 15:37:02:665 EDT] 0000006e SystemOut O ERROR (?:?) -
java.lang.Exception: Bean from
SpringUtils.getSpringBean(hostnameVerifierSetter) error message:
Unable to initialize group definition. Group resource name
[classpath*:beanRefFactory.xml], factory key [beanContext]; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'beanContext' defined in URL
[file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/cellName/Project.ear/configurations/beanRefFactory.xml]:
Bean instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.context.support.ClassPathXmlApplicationContext]:
Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org.quartz.impl.JobDetailImpl
From Spring 3.1+, Change the Class names for the CronTriggerFactoryBean & JobDetailFactoryBean as like below
org.springframework.scheduling.quartz.CronTriggerBean
org.springframework.scheduling.quartz.CronTriggerFactoryBean
org.springframework.scheduling.quartz.JobDetailBean
org.springframework.scheduling.quartz.JobDetailFactoryBean
So your steps are:
Change
CronTriggerBean to CronTriggerFactoryBean
JobDetailBean to
JobDetailFactoryBean
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/scheduling/quartz/CronTriggerFactoryBean.html
Since Spring3.1, it has changed.
I'm trying to set up a running service which uses Elasticsearch with Shield. However when I try to start the service I get the following error:
org.springframework.beans.factory.BeanCreationException:
Could not autowire field: private java.util.List com.company.AppConfig.identConfigs;
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'demoident' defined in URL [file:C:/path/to/config/foo.xml]:
Cannot resolve reference to bean 'bar_client' while setting bean property 'searchClients'
with key [TypedStringValue: value [default], target type [null]];
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'bar_client' defined in URL
[file:C:/path/to/config/foo.xml]: Bean instantiation via constructor failed;
nested exception is org.springframework.beans.BeanInstantiationException:
Failed to instantiate [com.company.ElasticSearchClient]:
Constructor threw exception; nested exception is
org.elasticsearch.common.inject.CreationException: Guice creation errors:
1) A binding to org.elasticsearch.shield.transport.filter.IPFilter was already configured
at _unknown_. at _unknown_
2) A binding to org.elasticsearch.shield.transport.ClientTransportFilter was already configured
at _unknown_. at _unknown_
3) A binding to org.elasticsearch.shield.ssl.ClientSSLService was already configured
at _unknown_. at _unknown_
4) A binding to org.elasticsearch.shield.ssl.ServerSSLService was already configured
at _unknown_. at _unknown_
4 errors
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
(Sorry for the ugly formatting of stacktrace, feel free to edit for readability)
If I remove the Maven dependency for Elasticsearch Shield then the service starts as expected, without stacktraces, but obviously won't be able to execute any queries because of the exclusion of Shield.
Any help or input at all would be very appreciated.
Edit: I realized that the error is thrown by the Java client, not Elastic itself.
I'm trying to migrate from spring 3.0.5 to spring 4.1.X .
Spring 3 has Class named as "org.springframework.scheduling.quartz.CronTriggerBean"
But Spring 4 doesn't include this class name.
[5/28/15 20:10:16:798 EDT] 00000092 ClassPathXmlA W
org.springframework.context.support.AbstractApplicationContext
__refresh Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot
find class [org.springframework.scheduling.quartz.CronTriggerBean] for
bean with name 'beanIdName' defined in class path resource
[config/spring/WxsCacheContext.xml]; nested exception is
java.lang.ClassNotFoundException:
org.springframework.scheduling.quartz.CronTriggerBean
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1328)
I have tried alternative like "spring-support" which has the same class. But no luck.
After getting that jar, it is giving errors about the quartz
[5/28/15 15:37:02:665 EDT] 0000006e SystemOut O ERROR (?:?) -
java.lang.Exception: Bean from
SpringUtils.getSpringBean(hostnameVerifierSetter) error message:
Unable to initialize group definition. Group resource name
[classpath*:beanRefFactory.xml], factory key [beanContext]; nested
exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'beanContext' defined in URL
[file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/cellName/Project.ear/configurations/beanRefFactory.xml]:
Bean instantiation via constructor failed; nested exception is
org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.springframework.context.support.ClassPathXmlApplicationContext]:
Constructor threw exception; nested exception is
java.lang.NoClassDefFoundError: org.quartz.impl.JobDetailImpl
From Spring 3.1+, Change the Class names for the CronTriggerFactoryBean & JobDetailFactoryBean as like below
org.springframework.scheduling.quartz.CronTriggerBean
org.springframework.scheduling.quartz.CronTriggerFactoryBean
org.springframework.scheduling.quartz.JobDetailBean
org.springframework.scheduling.quartz.JobDetailFactoryBean
So your steps are:
Change
CronTriggerBean to CronTriggerFactoryBean
JobDetailBean to
JobDetailFactoryBean
http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/scheduling/quartz/CronTriggerFactoryBean.html
Since Spring3.1, it has changed.
I'm trying to implement validation in a springmvc app, I followed the example described at
http://maestric.com/doc/java/spring/form_validation
When I run the app, I get the following error :
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'beanNameUrlHandlerMapping' defined in
ServletContext resource
[/WEB-INF/dispatcher-servlet.xml]:
Initialization of bean failed; nested
exception is
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name
'/update.html' defined in
ServletContext resource
[/WEB-INF/dispatcher-servlet.xml]:
Initialization of bean failed; nested
exception is
org.springframework.beans.InvalidPropertyException:
Invalid property 'commandClass' of
bean class
[training.springmvc.crud.controller.UpdatePersonController]:
No property 'commandClass' found
Anyone has an idea?
It looks like the bean declaration for /update.html is trying to set the value of a non-existent property called commandClass on an instance of your UpdatePersonController class.
(If you showed us the relevant code and XML wiring files we could confirm this.)