Cannot resolve reference to bean '__dwrConfiguration' - spring-mvc

Iam new to Spring MVC with DWR, Iam facing a problem to integrating the Annotation based spring 3.1 and DWR integrating.
while running my application I got an Exception like:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dwrController': Cannot resolve reference to bean '_dwrConfiguration' while setting bean property 'configurators' with key [0]; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '_dwrConfiguration' is defined.
Please help me what does it means.?
on which conditions we get this type of Exceptions.?
commons-logging-1.1.3,dwr.jar,org.springframework.aop-3.1.0.M1.jar.
i have some doubts regarding DWR configurations,*emphasized text*can any one please help me out.
1.What are the dwr/engine.js and dwr/util.js files, and what they do. where do i found, and where do I configure in my spring application. I referred several tutorials, but i didn't get clarify those tutorials, can any one clarify me briefly.
Thanks in advance.

Related

hibernate session is null with hibernate-envers

I am facing a serious problem with hibernate-Enver(auditing). My hibernate-5.0.0-final was working perfactly fine. Now I need to add auditing feature to my entities , so I added the #Audited annotation to my entities. When I deployed it on karaf OSGI. i am getting hibernate session null with the exception :
org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.envers.boot.internal.EnversService]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:184)
at org.hibernate.envers.boot.internal.TypeContributorImpl.contribute(TypeContributorImpl.java:22)
at org.hibernate.boot.internal.MetadataBuilderImpl.applyTypes(MetadataBuilderImpl.java:280)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.populate(EntityManagerFactoryBuilderImpl.java:798)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:187)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:34)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:165)
at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:114)
at org.hibernate.osgi.OsgiPersistenceProvider.createEntityManagerFactory(OsgiPersistenceProvider.java:78)
I install feature of Hibernate Enver also :
feature:install hibernate-orm
feature:install hibernate-envers
I am stuck with it.. Can anyOne help me out ?
Issue Resoved when Update the Hibernate from Hibernate-5.0.0.Final to Hibernate-5.2.0
helping link: https://hibernate.atlassian.net/browse/HHH-10365

Configure multiple content stores in Alfresco?

I followed the step given in below link to configure multiple content stores in Alfresco 5.0.d.
http://docs.alfresco.com/5.0/concepts/store-config-fullexample.html
Alfresco instance is not able to start and gives the exeption,
Cannot resolve reference to bean 'storeSelectorContentStore' while setting bean property 'store';
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'storeSelectorContentStore' defined in file [/opt/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension/content-store-selector-context.xml]:
I also tried the method stated in below link,
https://community.alfresco.com/docs/DOC-5156-content-store-configuration
This gives a different error, alfresco dir root not defined even though it's defined in the properties file.
This is an enterprise only feature. This is why you are getting this error on Community.
Marcus is right about this being an Enterprise only feature, but you could develop your own. It shouldn't be too much of a hassle.
Also, have you tried using this extension, I suspect it has everything you need and is maintained by a well know Alfresco contributor?
https://github.com/Acosix/alfresco-simple-content-stores

Unable to integrate Factory Pattern along with Spring-Swagger

I have implemented factory pattern using ServiceLocatorFactoryBean by following this reference.
It is working fine.
I am using swagger-springMVC (SpringFox), It is also working fine.
But, when I am trying to use factory pattern along with swagger then It is throwing below exceptions,
Could not autowire field: org.test.MyProject.MyFactory org.test.MyProject.controller.MyController.myFactory; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.test.MyProject.MyFactory] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {#org.springframework.beans.factory.annotation.Autowired(required=true)}
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
I have tried in all possible ways by following several resources but unable to find a solution. Can anyone please help me resolve this issue?
You need to provide a proper root path in your ComponentScan path. I have faced same kind of issue; after I fixed the ComponentScan path, it is working now as expected.

Unexpected "IllegalStateException: Ambiguous mappng found" thrown by Spring MVC in standalone tomcat

I noticed a weird behavior in my Spring MVC application:
My request mappings are all unique and I am positive there are no ambiguous mappings. I can run my app fine in STS's embedded tomcat.
However when I drop a jar in a standalone tomcat, I systematically get an ambiguous mapping error as show below.
Stacktrace:
IllegalStateException: Ambiguous mapping found. Cannot map 'preferenceController' bean method
public java.lang.String com.bignibou.controller.PreferenceController.modifyEmail(com.bignibou.controller.helpers.EmailInfo,org.springframework.validation.BindingResult,org.springframework.ui.Model)
to {[/preferences/email],methods=[POST],params=[],headers=[],consumes=[],produces=[text/html],custom=[]}: There is already 'preferencesController' bean method
public java.lang.String com.bignibou.controller.PreferencesController.modifyEmail(com.bignibou.controller.helpers.EmailInfo,org.springframework.validation.BindingResult,org.springframework.ui.Model) mapped.
Has anyone seen this problem before? FYI, I run tomcat 7.0.35 and spring 3.2.
It looks like you have two different classes: PreferenceController and PreferencesController with the same method. Just delete one of the modifyEmail methods and see if it works.

Asp.net 3.5 - Custom non-fatal exception

Custom non-fatal exception derive from which class in asp.net 3.5?
System.Exception.
If you're trying to create a custom exception (whether it's fatal or not) you would start by looking at extending from the System.Exception class. However, there is a pretty verbose hierarchy of exception classes already in the .NET framework. I would advise reviewing them before implementing your own custom exception class. Also, if your custom exception is inherently about something specific (like IO for example) you should consider extending from the most appropriate exception in that case.

Resources