spring-java-config

Spring Batch Java Config: Skip step when exception and go to next steps

我怕爱的太早我们不能终老 提交于 2019-12-17 21:07:40
问题 e.g. i have 3 Steps in Job (similar to Step1): @Autowired private StepBuilderFactory stepBuilderFactory; @Bean public Step step1() { return stepBuilderFactory .get("step1") .<String, String> chunk(1) .reader(reader()) .processor(processor()) .writer(writer()) .build(); } How go to Step 2 and 3 even after exception in Step 1? I mean configuration in Java. 回答1: Here is an example on how to configure it when creating a flow. That should be similar to configure it directly with the job builder:

Spring Security Java Config not generating logout url

杀马特。学长 韩版系。学妹 提交于 2019-12-17 18:55:19
问题 I am using Spring 4.0.5.RELEASE and Spring Security 3.2.4 . I am trying to create a simple sample app using java config (based on the Spring samples). The app starts up and the authentication works correctly, that is, I am redirected to a login form when accessing protected url /settings/profile However there is no /logout url generated? if I hit localhost:8080/logout I get a 404. I've used similar code on a previous project, so maybe has something to do with versions? Heres my Security

Weblogic datasource disappears from JNDI tree

寵の児 提交于 2019-12-17 18:35:14
问题 We are using weblogic version 12C. Steps to reproduce the issue: - Create the datasource. Deploy the application to weblogic. Application works fine. Update the deployed ear with the new one. Application is not able to connect the datasource. Datasource not available in the JNDI tree. We need to create either a new datasource everytime or save the datasource setting again. Can someone please check and let me know if you know some solution for this? 回答1: I had the same problem. Adding

Configuring AspectJ aspects using Spring IoC with JavaConfig?

怎甘沉沦 提交于 2019-12-17 14:44:13
问题 According to Spring's Documentation Configuring AspectJ aspects using Spring IoC in order to configure an aspect for Spring IOC, the following has to be added to the xml configuration: <bean id="profiler" class="com.xyz.profiler.Profiler" factory-method="aspectOf"> <property name="profilingStrategy" ref="jamonProfilingStrategy"/> </bean> As suggested by @SotiriosDelimanolis, rewriting this as the following in JavaConfig should to work: @Bean public com.xyz.profiler.Profiler profiler() { com

disabling spring security in spring boot app

无人久伴 提交于 2019-12-17 08:56:17
问题 I have a spring boot web app with spring security configured. I want to disable authentication for a while (until needed). I add this to the application.properties : security.basic.enable: false management.security.enabled: false Here is some part of my But I still have a basic security included : There is a default security password generated at startup and I am still getting HTTP Authentication prompt box. My pom.xml : <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www

CharacterEncodingFilter don't work together with Spring Security 3.2.0

二次信任 提交于 2019-12-17 04:54:53
问题 I'm new to Spring MVC framework and I have got an issue that I can not resolve by myself. Everything started when I integrated spring security with my application, after that all unicode values from HTML form were not encoded (spring security works correctly). I came to conclusion that this is happening probably because my DelegatingFilterProxy is called as the first filter in the chain. Here is my configuration that I thought will work, but it doesn't: 1)I'm extending

Using GZIP compression with Spring Boot/MVC/JavaConfig with RESTful

不羁岁月 提交于 2019-12-17 02:58:13
问题 We use Spring Boot/MVC with annotation-based java-config for series of RESTful services and we want to selectively enable HTTP GZIP stream compression on some API responses. I know I can do this manually in my controller and a byte[] @ResponseBody , however we'd prefer to rely on the SpringMVC infrastructure (filters/etc) and have it automatically do the JSON conversion and compression (ie the method returns a POJO). How can I enable GZIP compression in the ResponseBody or embedded Tomcat

Spring MVC - Spring uses sometimes RequestMappingHandlerMapping and sometimes SimpleUrlHandlerMapping

二次信任 提交于 2019-12-13 03:58:47
问题 I have been trying to solve this problem for past 2 days and found no answer so far. I reaserched a lot of google concerning this ;) So the problem is that I'm trying to develop Spring MVC app using Hibernate and deploying it on Tomcat 8 local server. The thing is that on 10 runs I have about 6 times 404 Not Found page and 4 times my app i working fine and showing what I want. I made a little digging and found out in Debug logs that when request mapping fails Spring uses

How to covert xml based spring-integration-email configuration to java based config?

我只是一个虾纸丫 提交于 2019-12-13 01:14:57
问题 I am using spring-integration-email in a spring boot application to receive emails. All example I found online use xml based config. I am using java based config in my application and I want to use the same for the spring-integration-email. Below is my xml based config, which works properly. How Can I convert it to java based config? <util:properties id="javaMailProperties"> <prop key="mail.imap.socketFactory.class">javax.net.ssl.SSLSocketFactory</prop> <prop key="mail.imap.socketFactory

How to define Remote EJBs Beans in Spring using annotation-based configuration (ie: JavaConfig)

半城伤御伤魂 提交于 2019-12-12 19:13:17
问题 I'm trying to figure out the best way to define Remote EJB 3 beans in Spring 4.x using JavaConfig (annotation-based configuration). I've looked at the Spring Docs for <jee:remote-slsb> and have hacked together a functional configuration, but it is terrible: @Bean public LoginManager getLoginManager(){ SimpleRemoteStatelessSessionProxyFactoryBean factory = new SimpleRemoteStatelessSessionProxyFactoryBean(); String beanName = "jndi.ejb3.LoginManager"; factory.setJndiName(beanName); factory