spring-3

when a quartz job fires, is it a new job class instance?

谁说我不能喝 提交于 2019-12-06 18:55:54
问题 I am very new to Quartz and I have some doubts about the jobs lifecycle. Let's suppose I have a single job configured to do some stuff. The job fires and ends its work. When it fires again is it the same instance (maybe set to sleep and awaken by the scheduler) or is it a new job instance (once the job ends it is killed and when the trigger condition is met again a new job instance is created)? I ask such question because when I debug my application (spring 3 mvc with quartz support) I see

Could not open JPA EntityManager for transaction; org.hibernate.exception.GenericJDBCException: Could not open connection

我的梦境 提交于 2019-12-06 16:39:52
I am working on spring hibernate with jpa specification when my web application try to connect to database it gives the above exception Caused by: java.sql.SQLException: Access denied for user 'sandip'@'localhost' (using password: YES) , sandip is my linux user. data source set is like....... @Bean public DataSource getDataSource() { DriverManagerDataSource ds = new DriverManagerDataSource( env.getProperty("url")); ds.setDriverClassName(env.getProperty("driver")); ds.setUsername(env.getProperty("user")); ds.setPassword(env.getProperty("pass")); // Set up JPA and transactionManager @Bean public

Reverse ajax using DeferredResult of Spring 3.2.0.RELEASE. Not working in IE

左心房为你撑大大i 提交于 2019-12-06 13:16:54
问题 I am trying to create a demo of Group Chat using reverse ajax in Spring. I am using Spring 3.2.0.RELEASE version. I am using DeferredResult to perform reverse ajax in my controller. Following is the snippet of my Controller class. @Autowired private AsyncRepository asyncRepository; Map<Integer, List<DeferredResult<String>>> watchers = new ConcurrentHashMap<Integer, List<DeferredResult<String>>>(); @RequestMapping(value="/asyncRequest/getMessages/{id}", method=RequestMethod.GET) @ResponseBody

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

不羁岁月 提交于 2019-12-06 12:24:06
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 datasourcesecurity() { org.apache.commons.dbcp.BasicDataSource dataSource = new org.apache.commons.dbcp.BasicDataSource(

@IfProfileValue import set from env variable, test not executing

一笑奈何 提交于 2019-12-06 06:55:54
As a follow up to Is there any way to conditionally ignore a test with JUnit of Spring? , If I want to do this with @IfProfileValue @RunWith(SpringJUnit4ClassRunner.class) ... @Resource ConfigurableEnvironment env; @Before public void env () { log.debug( "profiles {} {}", env.getDefaultProfiles(), env.getActiveProfiles()); } @Test @IfProfileValue( name = "integration" ) public void testExecute() throws JobExecutionException {...} the output of the log is profiles [default] [integration] , but testExecute is ignored, what am I missing to get this test to run when I enable integration. I am

Spring 3.0 junit test DispatcherServlet

烈酒焚心 提交于 2019-12-06 06:09:47
问题 I am trying to test my application with junit. Therefore I've setup the following class: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = "/META-INF/spring/applicationContext-test.xml" ) @TransactionConfiguration @Transactional public class DispatcherServletTest extends AbstractJUnit4SpringContextTests { private MockHttpServletRequest request; private MockHttpServletResponse response; private DispatcherServlet dispatcher; @Before public void setUp() throws Exception {

complete jms:listener migration to JavaConfig

£可爱£侵袭症+ 提交于 2019-12-06 01:25:17
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 must implements the MessageListener interface, I have tested and works My problem is, according with 23

Two-way converter in spring

故事扮演 提交于 2019-12-05 13:03:25
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 two-way conversion logic(from S to T and from T to S) in one converter? and how it will be used? PS. now

Spring 3.1: Redirect after login not working

落花浮王杯 提交于 2019-12-05 05:58:00
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 config file - <logout logout-url="/logout" logout-success-url="/login" invalidate-session="true"

Spring 3 : Can't find AuthenticationProcessingFilter

半腔热情 提交于 2019-12-05 05:27:22
I'm not able to find AuthenticationProcessingFilter when migrating from Spring 2 to Spring 3 (using spring-core) 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 If you're looking for constants which were available in spring 3 in AbstractAuthenticationProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY That is no longer available in that class. Alternative is spring has added WebAttributes