cloud-foundrysap-cloud-sdks4hana

Problem deploying S4SDK application in Cloud Foundry


The project is generated using: mvn archetype:generate -DarchetypeGroupId=com.sap.cloud.s4hana.archetypes -DarchetypeArtifactId=scp-cf-spring -DarchetypeVersion=2.3.1, The project runs fine on local. Added jars for spring security, defined env with name "destinations" and executed call to S/4HANA system, this works fine in local.

However I get the error below when I deploy it via cf push.

Please let me know if any other details needs to be furnished.

The logs look something like this:

2018-09-06T17:16:20.34+0530 [APP/PROC/WEB/0] OUT =========||==============|__/=///_/

2018-09-06T17:16:20.34+0530 [APP/PROC/WEB/0] OUT :: Spring Boot :: (v2.0.4.RELEASE)

2018-09-06T17:16:21.05+0530 [APP/PROC/WEB/0] OUT { "written_at":"2018-09-06T11:46:20.949Z","written_ts":100919511280466,"component_type":"application","component_id":"369864de-0a0b-4138-bb98-48928417e366","space_name":"dev","component_name":"mkt-agency-appl","component_instance":"0","organization_id":"-","correlation_id":"-","organization_name":"-","space_id":"1b0be89e-290e-4ae7-98f9-72a107f60e78","container_id":"10.0.138.125","type":"log","logger":"com.sap.cec.mkt.agency.Application","thread":"main","level":"INFO","categories":[],"msg":"Starting Application on 28673099-cf61-4378-41d5-4344 with PID 8 (/home/vcap/app/BOOT-INF/classes started by vcap in /home/vcap/app)" }

2018-09-06T17:16:21.05+0530 [APP/PROC/WEB/0] OUT { "written_at":"2018-09-06T11:46:21.055Z","written_ts":100919615470771,"component_type":"application","component_id":"369864de-0a0b-4138-bb98-48928417e366","space_name":"dev","component_name":"mkt-agency-appl","component_instance":"0","organization_id":"-","correlation_id":"-","organization_name":"-","space_id":"1b0be89e-290e-4ae7-98f9-72a107f60e78","container_id":"10.0.138.125","type":"log","logger":"com.sap.cec.mkt.agency.Application","thread":"main","level":"DEBUG","categories":[],"msg":"Running with Spring Boot v2.0.4.RELEASE, Spring v5.0.8.RELEASE" }

2018-09-06T17:16:21.05+0530 [APP/PROC/WEB/0] OUT { "written_at":"2018-09-06T11:46:21.056Z","written_ts":100919616000979,"component_type":"application","component_id":"369864de-0a0b-4138-bb98-48928417e366","space_name":"dev","component_name":"mkt-agency-appl","component_instance":"0","organization_id":"-","correlation_id":"-","organization_name":"-","space_id":"1b0be89e-290e-4ae7-98f9-72a107f60e78","container_id":"10.0.138.125","type":"log","logger":"com.sap.cec.mkt.agency.Application","thread":"main","level":"INFO","categories":[],"msg":"The following profiles are active: cloud" }

2018-09-06T17:16:23.05+0530 [APP/PROC/WEB/0] OUT { "written_at":"2018-09-06T11:46:23.054Z","written_ts":100921614055008,"component_type":"application","component_id":"369864de-0a0b-4138-bb98-48928417e366","space_name":"dev","component_name":"mkt-agency-appl","component_instance":"0","organization_id":"-","correlation_id":"-","organization_name":"-","space_id":"1b0be89e-290e-4ae7-98f9-72a107f60e78","container_id":"10.0.138.125","type":"log","logger":"org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext","thread":"main","level":"WARN","categories":[],"msg":"Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/home/vcap/app/BOOT-INF/lib/bapi-api-2.3.1.jar!/com/sap/cloud/sdk/s4hana/datamodel/bapi/functions/DefaultForeignExchangeDealGetFunction.class]; nested exception is java.util.zip.ZipException: invalid stored block lengths" }

2018-09-06T17:16:23.24+0530 [APP/PROC/WEB/0] OUT { "written_at":"2018-09-06T11:46:23.149Z","written_ts":100921709659596,"component_type":"application","component_id":"369864de-0a0b-4138-bb98-48928417e366","space_name":"dev","component_name":"mkt-agency-appl","component_instance":"0","organization_id":"-","correlation_id":"-","organization_name":"-","space_id":"1b0be89e-290e-4ae7-98f9-72a107f60e78","container_id":"10.0.138.125","type":"log","logger":"org.springframework.boot.SpringApplication","thread":"main","level":"ERROR","categories":[],"msg":"Application run failed","stacktrace":["org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/home/vcap/app/BOOT-INF/lib/bapi-api-2.3.1.jar!/com/sap/cloud/sdk/s4hana/datamodel/bapi/functions/DefaultForeignExchangeDealGetFunction.class]; nested exception is java.util.zip.ZipException: invalid stored block lengths","\tat org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:454)","\tat org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:316)","\tat org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:275)","\tat org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:132)","\tat org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:288)","\tat org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245


Solution

  • This seems to be an issue with a corrupted library in your maven cache, cf. https://github.com/spring-projects/spring-boot/issues/6443 and https://gitter.im/spring-projects/spring-boot/archives/2017/08/03. To fix this issue you should clean your maven cache. Some options to do this are described here.