I have a spring batch project exported as a runable Jar file, it has 4 main methods, only one main is working, the other main needs referenced jar jai-codec-1.1.3.jar, but when I put the jar in the classpath, the first main also could not working and it gives error message “An unexpected error occurred while trying to open jar”
here is my mainfest file:
Manifest-Version: 1.0 Class-Path: JARS/spring-jdbc-3.1.1.RELEASE.jar
I found out that it is not because the specific jar file, it is because the length of the classpath is exceeded the limit, is there a way to put more jars in the MAINFEST file classpath?
also I have defined all @autowired service and component classes but it still not working in jar, it only works when I defined those as bean in spring-config.
Anyone can Help me to figure out why?
Problem solved. I am not sure if it is the limitation of classpath size in MAINFEST file, but it really matters when it was too long, I changed all jar name as 1, 2 , 3… and be able to put all jars in the classpath, and it works. Please leave your comments if you have different opinion on this, Thanks.
Answered By – user3666635
Answer Checked By – Robin (BugsFixing Admin)