404 error on clicking job link on springbatch admin ui - spring

I am new to springbatch. I am trying to create a batch application and integrate with batch admin ui. Versions I used are spring-batch-2.2.7 and spring-batch-admin-1.3.0.M1. I am able to run my job using junit and also able to see all my jobs on admin ui. When i click on the job, I am getting 404 error.
Home Page -
http://myServer/ApplicationName
List of jobs link -
http://myServer/ApplicationName/batch/jobs
When i click on the job link url is missing 'batch' in the url.
http://myServer/ApplicationName/jobs/JOBNAME
Can anyone please help me resolve this issue? Thanks!

Please use the 1.3.0 release version of spring batch admin ( http://spring.io/blog/2014/07/28/spring-batch-admin-1-3-0-release-is-available ). This should work now with current spring batch versions (2.2.x and 3.0.x). I tested this successfully with spring batch version 3.0.1.
There is also a good starting point for configuring spring batch admin together with spring boot: https://blog.codecentric.de/en/2014/08/spring-batch-admin-spring-boot-2/

Related

springboot admin: How to display custom metrics in springboot admin GUI ("Metrics" tab)

We are using serveral microservices with springboot (Vers. 1.4.3) and for monitoring them springboot-admin (Vers. 1.5.0).
Inside our microservices we generate several custom metrics (using the
'#com.codahale.metrics.annotation.Timed' annotation).
While all these custom metrics are displayed through the ordinary actuator-endpoint "/metrics" they are sorrowly not shown in the springboot admin GUI -"Metrics" tab.
Obviously only "counter." and "gauge." metrics are displayed in the latter.
Is there any possibility to configure / modify springboot admin, so that these custom metrics also are shown - either in the existing 'metrics' tab or in another new tab ?
Ok, meanwhile I found out, that the new springboot-admin version 1.5.2 will solve our problem:
As I could see at a project from a colleague, this springboot-admin version will display ALL metrics without any restrictions regarding the metrics-key.
[ At the moment we can't upgrade to this version since our springboot-version dependency prevents it but in the future we'll be able to do so.]
So the problem is more or less solved.

how replace Spring Batch Admin by Spring Boot Admin

My straight question is: in Spring Batch Admin there is a clear concept and practical functionalities to manage the jobs. So, in Spring Batch Admin you can launch, stop one job, stop all jobs, reatart, abandon, see the status for each job and check if it was successful or failed. In case I use Spring Cloud Task deployed as war and Spring Boot Admin deployed as war in same server, how can I manage my jobs?
Explaining better my context: I have developed few Spring Batch jobs in the last 6 months. All them were designed in order to run periodically, in other words, to be schedulled. I wasn't planned deploy them in Web Server but I was informed in my company in the moment to publish to production that I must run any solution inside of our Mainframe Websphere.
It wasn't any issue at all since I realized that I could use Spring Batch Admin in order to start/stop all the Spring Batch deployed in the same EAR. Unfortunately, Websphere ND 8.5 isn't comply with Spring Batch Admin (you may heard someone telling he/she has managed to make Spring Batch Admin up and running in Websphere 8.5 ND but I got the final position from IBM that neither JSR352 nor Spring Batch Admin is safe to be used).
One week ago, I firstly got in touch with Spring Boot Admin thanks to certain comment to my question how to register org.springframework.integration.monitor.IntegrationMBeanExporter.
In such comment I read "...consider to get rid of batch-admin. This project is obsolete already in favor of cloud.spring.io/spring-cloud-task..." however it doesn't seem to me to really provide the same functionalities Spring Batch Admin does. It seems to me be a bit more generic and aimed for application boxes instead of job executions.
To make my question even more clear, let's say I have this project deployed as war https://github.com/spring-cloud/spring-cloud-task/blob/master/spring-cloud-task-samples/batch-job/src/main/java/io/spring/configuration/JobConfiguration.java and the two jobs are both schedulled for run every 5 minutes. Addtionally, in such project I added the necessary configuration to make it visible to Spring Boot Admin (e.g spring-boot-admin-starter-client). In the same server I have this Spring Boot Admin deployed as war too https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-war. Now, my question that is the same from title but a bit more exemplified is: will I be able to stop one job and let the other keep running from Spring Boot Admin? Can I launch one and leave other stopped?
If you, reader, has an overview of Spring Batch Admin will probably understand quickly what is my intention. I read in th Spring Boot Admin manual
http://codecentric.github.io/spring-boot-admin/1.4.1/#jmx-bean-management
3.2. JMX-bean management "... To interact with JMX-beans in the admin UI you have to include Jolokia in your application". Is there some trick via Jolokia in order to manage each job individually?

j_spring_security_check not invoked in tomcat

I'm using Tomcat 8.5.4 with myfaces 2.2.10 and primefaces 5.3. My local server works fine (tried to run it both standalone and eclipse) when I open the login screen and press the login button the following is visible in the logs:
...web.controller.LoginController] - <Validating login>
...AntPathRequestMatcher] - <Checking match of request : '/j_spring_security_check'; against '/external/**'>
After this a transaction started and the user is validated against the database as expected.
However when I copied the whole Tomcat distribution to a remote server and deployed the same application, j_spring_security_check is not executed anymore:
[org.springframework.faces.support.RequestLoggingPhaseListener] -
<Entering JSF Phase: RESTORE_VIEW(1)>
[org.springframework.faces.support.RequestLoggingPhaseListener] -
<Entering JSF Phase: RENDER_RESPONSE(6)>
[...web.controller.LoginController] - <No error messages during validation>
And after this the login screen is reloaded.
Can anyone help me why there is a difference in the behavior of the same servers and same applications? Any idea is appreciated!
I'm pretty sure that it does not have anything to do with myfaces or primefaces versions and I tried different versions but the behavior is the same...
for those who have the same issue I post my solution.
Of course there can be millions of reasons to cause this behavior but in my case it was the tomcat configuration... in Connector config in server.xml I've set
maxPostSize="0"
by mistake which I tought means no limit, however I should have set
maxPostSize="-1"
This resulted in the server cutting the post payload from the request... and causing me a lot of headache :)

Does a batch jobs admin page similiar to Spring batch admin page exist in TomEE server?

Is there any batch job manager console/GUI from where I can see the status of batch jobs in TomEE. I mean something like GUI in spring batch admin.
The OP is requesting information about TomEE, not Spring Framework ;)
The implementation TomEE uses is called BatchEE, which is an Apache project. It would seem a GUI is available in the incubator: http://batchee.incubator.apache.org/gui.html
You might try deploying that and report back if it works with TomEE or not.
Out of box , Spring Batch does not provide any GUI .
Spring batch Admin can be used as a GUI , but that need to be connected with your spring batch project .
For the job status you can always check spring batch tables .

Spring Roo web mvc setup generates error globalsearch.java class doesn't exists or has been deleted

I am quite new to Spring, now trying out Roo. I am following documentation from http://docs.spring.io/spring-roo/docs/2.0.0.M1/reference/html/
I was able to create the entity classes and fields, perform tests as well. Now when I run
roo> web mvc setup
it creates a few files in \config, \validatin, \html\converter but then produces undo create ... for the same files & folders. At the end it says
ERROR: GlobalSearch.java class doesn't exists or has been deleted.
I am running Windows 10 64 bit, STS 3.8 Release, Roo 2.0.0.M2, Maven 3.3.9, Jdk 1.8
Googling this as well as searching in StackOverflow gave just one slightly relevant result without resolution Spring Roo: 'web mvc setup' fails with 'display name required'.
In fact I have been facing many issues, each step of the way and googling my way through, so it has been a very painful experience so far, so any help is greatly appreciated.
I was using a separately downloaded roo (v 2)for this.
Alternatively I used STS and added roo (v 1.3.1RC1) extension thru Help>Dashboard and opened roo console in STS (Window>Show view>Roo shell), was able to run the commands for mvc web setup and mvc web all --package ~.web and generate required files!
But don't know why the separate roo console wouldn't work.
Thanks for all who viewed and tried to help.
First you need to create DAO layer:
repository jpa --all --package ~.repository
This will generate GlobalSearch.java in repository package.

Resources