spring-cloud-task
spring-cloud-task copied to clipboard
An exception is thrown when trying to run partition batch sample
14:29:19.343 [main] ERROR org.springframework.boot.SpringApplication - Application startup failed
java.lang.IllegalArgumentException: Invalid argument syntax: --sun.cpu.isalist=
at org.springframework.core.env.SimpleCommandLineArgsParser.parse(SimpleCommandLineArgsParser.java:75)
at org.springframework.core.env.SimpleCommandLinePropertySource.<init>(SimpleCommandLinePropertySource.java:89)
at org.springframework.boot.DefaultApplicationArguments$Source.<init>(DefaultApplicationArguments.java:76)
at org.springframework.boot.DefaultApplicationArguments.<init>(DefaultApplicationArguments.java:42)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
at io.spring.PartitionedBatchJobApplication.main(PartitionedBatchJobApplication.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
After further investigation the upgrade to the latest Spring-Cloud-Deployer-Local caused the issue. The current deployer adds all environment variables to the command line args, when running from the command line. https://github.com/spring-cloud/spring-cloud-deployer-local/issues/88 has been logged on the deployer on this issue.
We need to update the SimpleEnvironmentVariablesProvider to either set environment variables into the SPRING_APPLICATION_JSON. Or update the documentation to let the user's know that they should use SPRING_APPLICATION_JSON.
When PR https://github.com/spring-cloud/spring-cloud-task/pull/402 is merged this issue will be resolved.
Refer to https://github.com/spring-cloud/spring-cloud-task/issues/401
@cppwfs - I just hit this issue on K8s.
Just ran into this on k8s
PR has been merged and test case is resolved.