Comments (3)
I never tried it. Spring Batch Admin is designed to be embeddable and to use resources on the classpath, so it should be possible. It also uses freemarker, so you'll need to disable the template checks done by Spring Boot (unless you are using your own templates): "spring.freemarker.checkTemplateLocation=false".
from gs-batch-processing.
I tried lot of different combinations to get it working, but it seems impossible...
I write here some attempt I did just for reference, but I think that I won't be able to solve those issues
In one of the latest attempt I created a config class which should replace batch admin web.xml file
@Configuration
@ImportResource({
"classpath*:/org/springframework/batch/admin/web/resources/webapp-config.xml",
"classpath*:/org/springframework/batch/admin/web/resources/servlet-config.xml"
})
public class BatchAdminConfiguration {
@Bean
public FilterRegistrationBean shallowEtagHeaderFilter() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(new ShallowEtagHeaderFilter());
registrationBean.setOrder(1);
registrationBean.addUrlPatterns("/*");
return registrationBean;
}
@Bean
public FilterRegistrationBean hiddenHttpMethodFilter() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(new HiddenHttpMethodFilter());
registrationBean.setOrder(2);
registrationBean.addUrlPatterns("/*");
return registrationBean;
}
}
But the servlet-config context throw this exception when validating xml file.
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 20 in XML document from URL [jar:file:/Users/fabio/.m2/repository/org/springframework/batch/spring-batch-admin-manager/1.3.0.M1/spring-batch-admin-manager-1.3.0.M1.jar!/META-INF/spring/batch/servlet/manager/integration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 20; columnNumber: 104; cvc-complex-type.3.2.2: l'attributo "name" non รจ consentito nell'elemento "http:inbound-channel-adapter".
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:216)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:242)
... 32 more
If I remove it leaving the webapp-config.xml alone I get this other exception
Caused by: java.lang.ClassCastException: org.springframework.batch.core.repository.support.JobRepositoryFactoryBean$$EnhancerBySpringCGLIB$$316bbfdf cannot be cast to org.springframework.batch.core.repository.JobRepository
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$$EnhancerBySpringCGLIB$$850e79c.jobRepository(<generated>)
at org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration.jobBuilders(AbstractBatchConfiguration.java:60)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$$EnhancerBySpringCGLIB$$850e79c.CGLIB$jobBuilders$7(<generated>)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$$EnhancerBySpringCGLIB$$850e79c$$FastClassBySpringCGLIB$$35744317.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:312)
at org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration$$EnhancerBySpringCGLIB$$850e79c.jobBuilders(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:166)
... 24 more
I think that the main incompatibility is spring version, they seems to target older spring versions. Maybe I'll file an issue in BATCHADM Jira and ask them for help.
Thanks.
from gs-batch-processing.
I think it would be best to entertain creating a separate guide focused on that.
I opened spring-guides/getting-started-guides#4 to track such effort
from gs-batch-processing.
Related Issues (18)
- Add clarification about s1 argument in importUserJob HOT 4
- The tutorial on the Spring website is missing crucial files.
- Example of skip policy configuration in this example HOT 2
- Adding my own JobParameters - How to replace/intercept the 'jobLauncher.run(...)' method? HOT 1
- Guide without Spring Boot HOT 2
- HSQLException : user lacks privilege or object not found BATCH_JOB_INSTANCE HOT 1
- FlatFileItemReader with tab delimiter not working HOT 1
- Unnecessary Asciidoctor tags in code samples HOT 1
- Use SpringApplication.exit and System.exit to ensure that the JVM exits upon job completion HOT 3
- Java 11 doesn't work..! HOT 2
- Gradle build for the complete project is broken HOT 5
- JobExecutionListenerSupport is deprecated HOT 3
- Maven build fails to produce viable jar HOT 1
- Update Spring Boot to latest version HOT 3
- Update Spring Boot to the Latest Version HOT 1
- no scope "step" available HOT 6
- When running the tutorial, SELECT from the database happens before INSERT HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gs-batch-processing.