zowe / sample-spring-boot-api-service

Zowe REST API service SDK and sample API service that integrates with Zowe API Mediation Layer
Other
26 stars 18 forks source link

Patched JAR does not start when a commons JAR is updated #62

Closed plavjanik closed 4 years ago

plavjanik commented 4 years ago

Spring Boot requires JARs inside the fat JAR to be stored without compression.

Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/zowe-rest-api-commons-spring-0.0.0-SNAPSHOT.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file

The workaround is to use:

zowe-api-dev deploy --force

Full error log:

Starting application in SSH z/OS UNIX session using command '/sys/java64bt/v8r0m0/usr/lpp/java/J8.0_64/bin/java -Djava.library.path="./lib:${LIBPATH}" -Xquickstart -jar bin/zowe-rest-api-sample-spring.jar --spring.config.additional-location=file:etc/application.yml' in directory '/a/plape03/zowe-rest-api-sample-spring'
ℹ You can stop it using Ctrl+C
Executing z/OS UNIX command '/sys/java64bt/v8r0m0/usr/lpp/java/J8.0_64/bin/java -Djava.library.path="./lib:${LIBPATH}" -Xquickstart -jar bin/zowe-rest-api-sample-spring.jar --spring.config.additional-location=file:etc/application.yml' in directory /a/plape03/zowe-rest-api-sample-spring

$ Exception in thread "main" java.lang.IllegalStateException: Failed to get nested archive for entry BOOT-INF/lib/zowe-rest-api-commons-spring-0.0.0-SNAPSHOT.jar
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:108)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchives(JarFileArchive.java:87)
        at org.springframework.boot.loader.ExecutableArchiveLauncher.getClassPathArchives(ExecutableArchiveLauncher.java:69)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.io.IOException: Unable to open nested jar file 'BOOT-INF/lib/zowe-rest-api-commons-spring-0.0.0-SNAPSHOT.jar'
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:258)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:244)
        at org.springframework.boot.loader.archive.JarFileArchive.getNestedArchive(JarFileArchive.java:104)
        ... 4 more
Caused by: java.lang.IllegalStateException: Unable to open nested entry 'BOOT-INF/lib/zowe-rest-api-commons-spring-0.0.0-SNAPSHOT.jar'. It has been compressed and nested jar files must be stored without compression. Please check the mechanism used to create your executable jar file
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromFileEntry(JarFile.java:284)
        at org.springframework.boot.loader.jar.JarFile.createJarFileFromEntry(JarFile.java:266)
        at org.springframework.boot.loader.jar.JarFile.getNestedJarFile(JarFile.java:255)
        ... 6 more
Error: empty JSON response from Zowe CLI
    at zoweSync (~/workspace/github.com/zowe/sample-spring-boot-api-service/zowe-api-dev/src/zowe.ts:65:23)
    at execSshCommand (~/workspace/github.com/zowe/sample-spring-boot-api-service/zowe-api-dev/src/zowe.ts:152:12)
    at Object.execSshCommandWithDefaultEnv (~/workspace/github.com/zowe/sample-spring-boot-api-service/zowe-api-dev/src/zowe.ts:161:12)
    at Start.run (~/workspace/github.com/zowe/sample-spring-boot-api-service/zowe-api-dev/src/commands/start.ts:59:13)
    at Start._run (~/workspace/github.com/zowe/sample-spring-boot-api-service/zowe-api-dev/node_modules/@oclif/command/lib/command.js:44:31)
dkelosky commented 4 years ago

I wonder if this is related:

$ zowe-api-dev deploy
Patching /tmp/kelda16/sample/bin/zowe-rest-api-sample-spring.jar to be same as build/libs/zowe-rest-api-sample-spring-0.0.1-SNAPSHOT.jar
Error: z/OSMF REST API Error:
Rest API failure with HTTP(S) status 404
category: 6
rc:       8
reason:   93651005
message:  File not found.
details:
  - EDC5129I No such file or directory. (errno2=0x0594003D)
    at Object.zoweSync (C:/dev/java/sample-spring-boot-api-service/zowe-api-dev/src/zowe.ts:65:23)
    at Object.transferFiles (C:/dev/java/sample-spring-boot-api-service/zowe-api-dev/src/files.ts:100:17)
    at Deploy.run (C:/dev/java/sample-spring-boot-api-service/zowe-api-dev/src/commands/deploy.ts:23:13)
    at Deploy._run (C:/dev/java/sample-spring-boot-api-service/zowe-api-dev/node_modules/@oclif/command/lib/command.js:44:31)

In this case, my zfs data sets were on WRK volumes that were deleted after three days. I redid zowe-api-dev zfs and other steps. I had to use zowe-api-dev deploy --force to get around this problem.

plavjanik commented 4 years ago

That is a different problem that will be fixed by checking if the file exists. Let's keep in this issue so we can fix it together.