spring-3

ConstraintViolationException: User Entity with transient confirmPassword field

梦想与她 提交于 2019-12-08 04:41:15
问题 I'm not able to submit my spring form. I'm getting this exception and don't know why: javax.validation.ConstraintViolationException: validation failed for classes [com.example.my.entities.User] during persist time for groups [javax.validation.groups.Default, ] And here's my User entity: @Entity @Table( name = "tbl_user" ) public class User implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue @Column( name = "id", nullable = false, columnDefinition =

Spring Security java.lang.IllegalArgumentException: Failed to evaluate expression 'ROLE_ADMIN' [duplicate]

浪尽此生 提交于 2019-12-08 04:19:41
问题 This question already has answers here : It throws me 500 Failed to evaluate expression 'ROLE_USER' in spring security (2 answers) Closed 2 years ago . I'm working with the book " Amuthan G - Spring MVC Beginner's Guide ". Currently I'm trying to implement security using the next security-context.xml : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework

Spring 3.1.3 + Hibernate Configuration with annotations and with (Dynamic) AbstractRoutingDataSource

不打扰是莪最后的温柔 提交于 2019-12-08 02:38:19
问题 I'm trying to change an annotation hibernate with only one datasource, to have as many as are saved in a database. In order to make an user have its assigned connection, and add new type of connections with only a server restart (avoiding .war recompile) The server first loads a SecurityHibernateConfiguration Without any Problem: @Configuration @EnableTransactionManagement public class SecurityHibernateConfiguration { @Autowired public Parameters parameters; @Bean DataSource

What is the equivalent of destination-type from jms:listener-container in JavaConfig?

六眼飞鱼酱① 提交于 2019-12-08 01:38:41
问题 What is the equivalent of destination-type from jms:listener-container in JavaConfig? I have checked in the API these two following classes without results. DefaultMessageListenerContainer MessageListenerAdapter I am trying to create consumers for a topic , many tutorials in the web use destination-type="topic" According with the 23.6 JMS Namespace Support section, there is the Table 23.2. Attributes of the JMS element table. Where for the destination-type attribute says: The JMS destination

complete jms:listener migration to JavaConfig

*爱你&永不变心* 提交于 2019-12-07 12:16:31
问题 Like the title says.. I have read this valuable How to add multiple JMS MessageListners in a single MessageListenerContainer for Spring Java Config link The author of that post is working through messageListenerContainer.setMessageListener(new TaskFinished()); BTW: I use @Autowired private ConsumerListener consumerListener; defaultMessageListenerContainer.setMessageListener(consumerListener); I am not using the new operator. OK, the restriction of the setMessageListener method is: the class

Spring Error - java.lang.NoSuchMethodError: > org.springframework.beans.factory.annotation.InjectionMetadata.<init>

拜拜、爱过 提交于 2019-12-07 11:33:30
Folks, I am trying to run a simple spring example of using @Required. But, when I run the main method class, I get below exception trace ? Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.beans.factory.annotation.InjectionMetadata.(Ljava/lang/Class;Ljava/util/Collection;)V at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findPersistenceMetadata(PersistenceAnnotationBeanPostProcessor.java:377) at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessMergedBeanDefinition(PersistenceAnnotationBeanPostProcessor

Two-way converter in spring

强颜欢笑 提交于 2019-12-07 07:27:18
问题 Spring 3 has such a nice feature as type conversion. It provides a converter SPI( Converter<S, T> ) to be used to implement differenet conversion logic. The subclass of Converter type allow to define one-way conversion(only from S to T), so if I want a conversion also to be performed from T to S I need to define another converter class that implement Converter<T, S> . If I have many classes which are subject to conversion, i need to define many converters. Is there any posibility to define

Spring 3.1: Redirect after login not working

笑着哭i 提交于 2019-12-07 03:10:06
问题 I have a page which has multiple links to other pages in the application. When a user visits the website, the systems page is shown which is accessible even if user is not logged in. However, if user clicks on some other link, that expects the user to be logged in, user is rightly redirected to the login page. However, after login, the user is not redirected to link that was clicked, instead the user is taken to the systems page (systems page is the default target url). Here is snippet from

Spring 3 : Can't find AuthenticationProcessingFilter

我与影子孤独终老i 提交于 2019-12-07 01:21:21
问题 I'm not able to find AuthenticationProcessingFilter when migrating from Spring 2 to Spring 3 (using spring-core) 回答1: This class has been renamed to UsernamePasswordAuthenticationFilter in Spring security 3.x. ref : http://static.springsource.org/spring-security/site/docs/3.0.x/apidocs/org/springframework/security/web/authentication/AuthenticationProcessingFilter.html 回答2: If you're looking for constants which were available in spring 3 in AbstractAuthenticationProcessingFilter.SPRING

WebRequest and HttpServletRequest in Spring MVC

最后都变了- 提交于 2019-12-06 22:41:28
问题 What is the difference between the two? Both have a getParameter method as well as setAttribute method, then where comes the difference between the two? 1) Which one is better to use in general? 2) Please explain specific scenarios where they can be used. 回答1: The javadoc of WebRequest is pretty clear on the subject: Generic interface for a web request. Mainly intended for generic web request interceptors, giving them access to general request metadata, not for actual handling of the request.