Java-buildpack: Java Buildpack error

Created on 3 Nov 2016  ·  26Comments  ·  Source: cloudfoundry/java-buildpack

I am trying push spring boot application to cloud foundry but getting the following error.

ERROR Compile failed with exception #<RuntimeError: No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. 
Failed to compile droplet
Exit status 223.

I am giving Java buildpack in manifest.yml file

Most helpful comment

Did you push your artifact using -p like this cf push appname -p yourapp.jar

All 26 comments

Did you push your artifact using -p like this cf push appname -p yourapp.jar

No I have used the below command
cf push -f C:\Users\arjun\Desktop\SpringBoot\manifest.yml

Insode menifest.yml I have mentioned the path to Jar file and buildpack as java_buildpack. My menifet.ymli looks below

applications:
- name: SpringBootExample
  host: springcalcapp
  memory: 1024M
  buildpack: java_buildpack
  domain: cfapps.io
  path: ./springboot.jar

both jar and menifest file are in the smae folder. I am not sure about-p . What is appanme? in the mentioned statement.

Thanks in advance. I am sorry I am new to this editor.

@Arjun09 The app name is just the name of your app you want in CF

If you can confirm that your application can start with java -jar springboot.jar then I'd recommend taking this question to cloudfoundry.slack.com and ask in the java_buildpack channel. There you can get more interactive help for issues like this. Then come back and file an issue if it turns out this is really a bug of some sort.

Yes application is running with the mentioned commands. Thanks for your support. I will try to ask this cloudfoundry slack.

@Arjun09 I wonder if "path" is relative to where cf push is run and not relative to where the manifest is? If you run cf push -f manifest.yml from the same directory springboot.jar is in does that work?

Yes it is running without path. Executing until Successfully destroyed container and getting failed with below error

Error restarting application: BuildpackCompileFailed. I have been trying with different options but it is giving me this Buildpack error. I am sure I am missing something but couldn't find it no where. 

Help is appreciated

@Arjun09 The buildpack's debug logging should tell us what is going on. To enable it you need to run the following command cf set-env <APP-NAME> JBP_LOG_LEVEL DEBUG and then re-push your application. Once you have the output of that command (should be more than 1000 lines), we can diagnose the problem.

@nebhale I did that and could see the log. But I am bit new to this and doesn't know how to trace it. I am giving https://github.com/cloudfoundry/java-buildpack as build pack and it is failing to download the JDK as I have seen in some other posts.

Java Buildpack Version: 46826a0 | https://github.com/cloudfoundry/java-buildpack.git#46826a0
[Buildpack]                      ERROR Compile failed with exception #<RuntimeError: No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation.
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
Successfully destroyed container

@Arjun09 I need the output of that log and I can trace it for you.

Here it is. Thanks for your support.

C:\Users\arjun\Desktop\SpringBoot>cf push springbootexample -b https://github.com/cloudfoundry/java-buildpack
Using manifest file C:\Users\arjun\Desktop\SpringBoot\manifest.yml

Updating app springbootexample in org Spring-App / space development as [email protected]...
OK

Using route springcalcapp.cfapps.io
Uploading springbootexample...
Uploading app files from: C:\Users\arjun\AppData\Local\Temp\unzipped-app832163055
Uploading 54.9K, 17 files
Done uploading
OK

Starting app springbootexample in org Spring-App / space development as [email protected]...
Creating container
Successfully created container
Downloading app package...
Downloaded app package (54.6K)
Staging...
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/version.yml: {"version"=>"v3.8.1"}
[BuildpackVersion]               DEBUG v3.8.1 | https://github.com/cloudfoundry/java-buildpack.git#7f47ec2
[Buildpack]                      DEBUG Environment Variables: {"LANG"=>"en_US.UTF-8", "JBP_LOG_LEVEL"=>"DEBUG", "CF_STACK"=>"cflinuxfs2", "VCAP_APPLICATION"=>"{\"limits\":{\"fds\":16384,\"mem\":1024,\"disk\":4096},\"application_name\":\"springbootexample\",\"application_uris\":[\"springcalcapp.cfapps.io\"],\"name\":\"springbootexample\",\"space_name\":\"development\",\"space_id\":\"7305671b-c6fe-4032-8f6b-f64c03f753be\",\"uris\":[\"springcalcapp.cfapps.io\"],\"users\":null,\"application_id\":\"a789a26e-c28c-44e8-8180-e20a67a06fa6\",\"version\":\"27ecf026-5c25-4263-8dab-e20c346d5183\",\"application_version\":\"27ecf026-5c25-4263-8dab-e20c346d5183\"}", "MEMORY_LIMIT"=>"1024m", "VCAP_SERVICES"=>"{}", "CF_INSTANCE_IP"=>"10.10.147.78", "CF_INSTANCE_PORT"=>"", "CF_INSTANCE_ADDR"=>"", "CF_INSTANCE_PORTS"=>"[]", "PATH"=>"/usr/local/bin:/usr/bin:/bin", "USER"=>"vcap", "HOME"=>"/home/vcap"}
[Buildpack]                      DEBUG Application Contents: [".", ".classpath", ".project", ".settings", ".settings/org.eclipse.buildship.core.prefs", "META-INF", "META-INF/MANIFEST.MF", "build.gradle", "gradle", "gradle/wrapper", "gradle/wrapper/gradle-wrapper.jar", "gradle/wrapper/gradle-wrapper.properties", "gradlew", "gradlew.bat", "sample", "sample/SampleApplication.class", "sample/SampleController.class", "settings.gradle"]
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/components.yml: {"containers"=>["JavaBuildpack::Container::DistZip", "JavaBuildpack::Container::Groovy", "JavaBuildpack::Container::JavaMain", "JavaBuildpack::Container::PlayFramework", "JavaBuildpack::Container::Ratpack", "JavaBuildpack::Container::SpringBoot", "JavaBuildpack::Container::SpringBootCLI", "JavaBuildpack::Container::Tomcat"], "jres"=>["JavaBuildpack::Jre::OpenJdkJRE"], "frameworks"=>["JavaBuildpack::Framework::AppDynamicsAgent", "JavaBuildpack::Framework::ContainerCertificateTrustStore", "JavaBuildpack::Framework::ContainerCustomizer", "JavaBuildpack::Framework::Debug", "JavaBuildpack::Framework::DynaTraceAgent", "JavaBuildpack::Framework::Jmx", "JavaBuildpack::Framework::JrebelAgent", "JavaBuildpack::Framework::LunaSecurityProvider", "JavaBuildpack::Framework::MariaDbJDBC", "JavaBuildpack::Framework::NewRelicAgent", "JavaBuildpack::Framework::PlayFrameworkAutoReconfiguration", "JavaBuildpack::Framework::PlayFrameworkJPAPlugin", "JavaBuildpack::Framework::PostgresqlJDBC", "JavaBuildpack::Framework::RuxitAgent", "JavaBuildpack::Framework::SpringAutoReconfiguration", "JavaBuildpack::Framework::SpringInsight", "JavaBuildpack::Framework::YourKitProfiler", "JavaBuildpack::Framework::JavaOpts"]}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Jre::OpenJdkJRE
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Jre::OpenJdkJRE
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/open_jdk_jre.yml: {"jre"=>{"version"=>"1.8.0_91-unlimited-crypto", "repository_root"=>"{default.repository.root}/openjdk/{platform}/{architecture}"}, "memory_calculator"=>{"version"=>"2.0.2_RELEASE", "repository_root"=>"{default.repository.root}/memory-calculator/{platform}/{architecture}", "stack_threads"=>300, "memory_sizes"=>{"heap"=>nil, "metaspace"=>"64m..", "native"=>nil, "permgen"=>"64m..", "stack"=>"228k.."}, "memory_heuristics"=>{"heap"=>65, "metaspace"=>10, "native"=>15, "permgen"=>10, "stack"=>10}, "memory_initials"=>{"heap"=>"100%", "metaspace"=>"100%", "permgen"=>"100%"}}}
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/repository.yml: {"default_repository_root"=>"https://download.run.pivotal.io"}
[RepositoryIndex]                DEBUG {default.repository.root}/memory-calculator/{platform}/{architecture} expanded to https://download.run.pivotal.io/memory-calculator/trusty/x86_64
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/cache.yml: {"remote_downloads"=>"enabled", "client_authentication"=>{"certificate_location"=>nil, "private_key_location"=>nil, "private_key_password"=>nil}}
[DownloadCache]                  DEBUG Proxy: , , ,
[DownloadCache]                  DEBUG Adding HTTP options for secure connection
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/cache.yml: {"remote_downloads"=>"enabled", "client_authentication"=>{"certificate_location"=>nil, "private_key_location"=>nil, "private_key_password"=>nil}}
[DownloadCache]                  DEBUG Adding HTTP options for secure connection
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/cache.yml: {"remote_downloads"=>"enabled", "client_authentication"=>{"certificate_location"=>nil, "private_key_location"=>nil, "private_key_password"=>nil}}
[DownloadCache]                  DEBUG HTTP: download.run.pivotal.io, 443, {:use_ssl=>true}
[DownloadCache]                  DEBUG SSL-Session:
    Protocol  : TLSv1.2
    Cipher    : ECDHE-RSA-AES128-GCM-SHA256
    Session-ID: 6EE996928F0233F12A2FF56EB9D50D108284F3D36D0C849FDE3AECE6BB7D3D7E
    Session-ID-ctx:
    Master-Key: 1A5468F30EFDA2961EABD8C2493E59ED5EE082AED27BAFFB109DF209B76B758DD0883319AA7042A301A13CAFCB4C7FC3
    Key-Arg   : None
    PSK identity: None
    PSK identity hint: None
    SRP username: None
    TLS session ticket lifetime hint: 10800 (seconds)
    TLS session ticket:
    0000 - 21 6a 84 07 53 65 48 90-c0 7b 86 d2 9e ff 80 c3   !j..SeH..{......
    0010 - a0 84 a3 e2 b2 cb a1 3b-c6 94 4d 0e 7a 1c c6 61   .......;..M.z..a
    0020 - 50 ac b6 9c 16 47 09 bf-8a eb d3 78 18 19 2e b8   P....G.....x....
    0030 - 9c 1a 26 4e cb ee 55 08-d6 47 06 34 3b 7c 8b 53   ..&N..U..G.4;|.S
    0040 - c7 b2 41 93 23 a2 1f 5c-ee 35 3d 96 e5 82 e5 f0   ..A.#..\.5=.....
    0050 - d9 d7 cc 2a d0 62 e0 40-3d 87 e6 c9 0f 89 3d 2a   ...*.b.@=.....=*
    0060 - b5 bb 69 4d 4c 67 9e 88-5a 35 55 db 38 a6 64 bc   ..iMLg..Z5U.8.d.
    0070 - 54 e3 62 94 db e2 af cf-33 86 3b ea b8 1d 46 be   T.b.....3.;...F.
    0080 - 28 76 34 ec 9b 3a 72 da-fb 67 25 b2 dc f9 7d 5f   (v4..:r..g%...}_
    0090 - af e5 3b b0 e6 c0 4f eb-10 76 91 bb df 9d 23 b7   ..;...O..v....#.
    00a0 - 11 05 ac 15 3f d0 5b 48-25 31 dc 28 51 f4 67 22   ....?.[H%1.(Q.g"
    Start Time: 1478276954
    Timeout   : 300 (sec)
    Verify return code: 0 (ok)
[DownloadCache]                  DEBUG Request: /memory-calculator/trusty/x86_64/index.yml, {"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], "accept"=>["*/*"], "user-agent"=>["Ruby"]}
[DownloadCache]                  DEBUG Response headers: {"content-type"=>["text/x-yaml"], "content-length"=>["739"], "connection"=>["keep-alive"], "date"=>["Tue, 30 Aug 2016 13:57:48 GMT"], "last-modified"=>["Tue, 30 Aug 2016 13:52:01 GMT"], "etag"=>["\"84c4af1a56708f9504cc7fec7946afd3\""], "x-amz-version-id"=>["Ky10baz5T2KAMZfqH3Fr0A0GGOih34VJ"], "accept-ranges"=>["bytes"], "server"=>["AmazonS3"], "age"=>["63565"], "x-cache"=>["Hit from cloudfront"], "via"=>["1.1 b06057d522f80c65400aebb1c06a2d72.cloudfront.net (CloudFront)"], "x-amz-cf-id"=>["EkGn6FRPmsQuDDfBFhzusQLFlFAQ996fMGn8H2LE9hhFy8Nh7GGPpg=="]}
[DownloadCache]                  DEBUG Response status: 200
[DownloadCache]                  DEBUG Persisting etag: "84c4af1a56708f9504cc7fec7946afd3"
[DownloadCache]                  DEBUG Persisting last-modified: Tue, 30 Aug 2016 13:52:01 GMT
[DownloadCache]                  DEBUG Persisting content to /tmp/https%3A%2F%2Fdownload.run.pivotal.io%2Fmemory-calculator%2Ftrusty%2Fx86_64%2Findex.yml.cached
[DownloadCache]                  DEBUG Validated content size 739 is 739
[RepositoryIndex]                DEBUG {"1.0.0_RELEASE"=>"https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-1.0.0_RELEASE", "1.1.0_RELEASE"=>"https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-1.1.0_RELEASE", "1.1.1_RELEASE"=>"https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-1.1.1_RELEASE", "2.0.0_RELEASE"=>"https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.0_RELEASE.tar.gz", "2.0.1_RELEASE"=>"https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.1_RELEASE.tar.gz", "2.0.2_RELEASE"=>"https://java-buildpack.cloudfoundry.org/memory-calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::AppDynamicsAgent
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::AppDynamicsAgent
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/app_dynamics_agent.yml: {"version"=>"4.2.3_0", "repository_root"=>"{default.repository.root}/app-dynamics", "default_application_name"=>nil, "default_node_name"=>"$(ruby -e \"require 'json' ; a = JSON.parse(ENV['VCAP_APPLICATION']); puts \\\"\#{a['application_name']}:\#{a['instance_index']}\\\"\")", "default_tier_name"=>nil}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::ContainerCertificateTrustStore
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::ContainerCertificateTrustStore
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/container_certificate_trust_store.yml: {"enabled"=>false}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::ContainerCustomizer
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::ContainerCustomizer
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/container_customizer.yml: {"version"=>"1.0.0_RELEASE", "repository_root"=>"{default.repository.root}/container-customizer"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::Debug
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::Debug
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/debug.yml: {"enabled"=>false, "port"=>8000, "suspend"=>false}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::DynaTraceAgent
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::DynaTraceAgent
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/dyna_trace_agent.yml: {"version"=>"6.3.0_1305", "repository_root"=>"http://downloads.dynatracesaas.com/cloudfoundry/buildpack/java", "default_agent_name"=>nil}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::Jmx
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::Jmx
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/jmx.yml: {"enabled"=>false, "port"=>5000}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::JrebelAgent
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::JrebelAgent
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/jrebel_agent.yml: {"version"=>"6.4.6", "repository_root"=>"https://dl.zeroturnaround.com/jrebel"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::LunaSecurityProvider
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::LunaSecurityProvider
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/luna_security_provider.yml: {"version"=>"6.2.0", "repository_root"=>"http://files.cf-hsm.io/luna-installer", "logging_enabled"=>false}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::MariaDbJDBC
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::MariaDbJDBC
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/maria_db_jdbc.yml: {"version"=>"1.4.6", "repository_root"=>"{default.repository.root}/mariadb-jdbc"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::NewRelicAgent
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::NewRelicAgent
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/new_relic_agent.yml: {"version"=>"3.30.0", "repository_root"=>"{default.repository.root}/new-relic"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::PlayFrameworkAutoReconfiguration
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::PlayFrameworkAutoReconfiguration
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/play_framework_auto_reconfiguration.yml: {"version"=>"1.10.0_RELEASE", "repository_root"=>"{default.repository.root}/auto-reconfiguration", "enabled"=>true}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::PlayFrameworkJPAPlugin
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::PlayFrameworkJPAPlugin
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/play_framework_jpa_plugin.yml: {"version"=>"1.10.0_RELEASE", "repository_root"=>"{default.repository.root}/play-jpa-plugin", "enabled"=>true}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::PostgresqlJDBC
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::PostgresqlJDBC
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/postgresql_jdbc.yml: {"version"=>"9.4.1208", "repository_root"=>"{default.repository.root}/postgresql-jdbc"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::RuxitAgent
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::RuxitAgent
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/ruxit_agent.yml: {"version"=>"1.95.149", "repository_root"=>"https://download.ruxit.com/agent/paas/cloudfoundry/java"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::SpringAutoReconfiguration
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::SpringAutoReconfiguration
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/spring_auto_reconfiguration.yml: {"version"=>"1.10.0_RELEASE", "repository_root"=>"{default.repository.root}/auto-reconfiguration", "enabled"=>true}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::SpringInsight
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::SpringInsight
[ConfigurationUtils]             DEBUG No configuration file /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/spring_insight.yml found
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::YourKitProfiler
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::YourKitProfiler
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/your_kit_profiler.yml: {"version"=>"2016.02.40", "repository_root"=>"{default.repository.root}/your-kit/{platform}/{architecture}", "enabled"=>false, "port"=>10001, "default_session_name"=>"$(ruby -e \"require 'json' ; a = JSON.parse(ENV['VCAP_APPLICATION']); puts \\\"\#{a['application_name']}:\#{a['instance_index']}\\\"\")"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Framework::JavaOpts
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Framework::JavaOpts
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/java_opts.yml: {"from_environment"=>true, "java_opts"=>nil}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::DistZip
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::DistZip
[ConfigurationUtils]             DEBUG No configuration file /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/dist_zip.yml found
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::Groovy
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::Groovy
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/groovy.yml: {"version"=>"2.4.7", "repository_root"=>"{default.repository.root}/groovy"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::JavaMain
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::JavaMain
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/java_main.yml: {"java_main_class"=>nil, "arguments"=>nil}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::PlayFramework
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::PlayFramework
[ConfigurationUtils]             DEBUG No configuration file /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/play_framework.yml found
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::Ratpack
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::Ratpack
[ConfigurationUtils]             DEBUG No configuration file /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/ratpack.yml found
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::SpringBoot
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::SpringBoot
[ConfigurationUtils]             DEBUG No configuration file /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/spring_boot.yml found
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::SpringBootCLI
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::SpringBootCLI
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/spring_boot_cli.yml: {"version"=>"1.3.5_RELEASE", "repository_root"=>"{default.repository.root}/spring-boot-cli"}
[Buildpack]                      DEBUG Instantiating JavaBuildpack::Container::Tomcat
[Buildpack]                      DEBUG Successfully required JavaBuildpack::Container::Tomcat
[ConfigurationUtils]             DEBUG Configuration from /tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/config/tomcat.yml: {"tomcat"=>{"version"=>"8.0.36", "repository_root"=>"{default.repository.root}/tomcat", "context_path"=>nil, "external_configuration_enabled"=>false}, "external_configuration"=>{"version"=>"1.+", "repository_root"=>nil}, "lifecycle_support"=>{"version"=>"2.5.0_RELEASE", "repository_root"=>"{default.repository.root}/tomcat-lifecycle-support"}, "logging_support"=>{"version"=>"2.5.0_RELEASE", "repository_root"=>"{default.repository.root}/tomcat-logging-support"}, "access_logging_support"=>{"version"=>"2.5.0_RELEASE", "repository_root"=>"{default.repository.root}/tomcat-access-logging-support", "access_logging"=>"disabled"}, "redis_store"=>{"version"=>"1.2.0_RELEASE", "repository_root"=>"{default.repository.root}/redis-store", "database"=>0, "timeout"=>2000, "connection_pool_size"=>2}, "gemfire_store"=>{"gemfire"=>{"version"=>"8.2.1", "repository_root"=>"{default.repository.root}/gem-fire"}, "gemfire_modules"=>{"version"=>"8.2.1", "repository_root"=>"{default.repository.root}/gem-fire-modules"}, "gemfire_modules_tomcat7"=>{"version"=>"8.2.1", "repository_root"=>"{default.repository.root}/gem-fire-modules-tomcat7"}, "gemfire_security"=>{"version"=>"8.2.1", "repository_root"=>"{default.repository.root}/gem-fire-security"}, "gemfire_logging"=>{"version"=>"1.7.7", "repository_root"=>"{default.repository.root}/slf4j-jdk14"}, "gemfire_logging_api"=>{"version"=>"1.7.7", "repository_root"=>"{default.repository.root}/slf4j-api"}, "gemfire_log4j_api"=>{"version"=>"2.1.0", "repository_root"=>"{default.repository.root}/log4j-api"}, "gemfire_log4j_core"=>{"version"=>"2.1.0", "repository_root"=>"{default.repository.root}/log4j-core"}, "gemfire_log4j_jcl"=>{"version"=>"2.1.0", "repository_root"=>"{default.repository.root}/log4j-jcl"}, "gemfire_log4j_jul"=>{"version"=>"2.1.0", "repository_root"=>"{default.repository.root}/log4j-jul"}, "gemfire_log4j_slf4j_impl"=>{"version"=>"2.1.0", "repository_root"=>"{default.repository.root}/log4j-slf4j-impl"}}}
-----> Java Buildpack Version: v3.8.1 | https://github.com/cloudfoundry/java-buildpack.git#7f47ec2
[Buildpack]                      ERROR Compile failed with exception #<RuntimeError: No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
[Buildpack]                      DEBUG Exception #<RuntimeError: No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. > backtrace:
/tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/lib/java_buildpack/buildpack.rb:190:in `no_container'
/tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/lib/java_buildpack/buildpack.rb:61:in `compile'
/tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/bin/compile:27:in `block in <main>'
/tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/lib/java_buildpack/buildpack.rb:225:in `with_buildpack'
/tmp/buildpacks/2d774c4a63c7f584e176471bcb9a8f25/bin/compile:26:in `<main>'
No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation.
Failed to compile droplet
Exit status 223
Staging failed: Exited with status 223
Destroying container
Successfully destroyed container

FAILED
Error restarting application: BuildpackCompileFailed

TIP: use 'cf logs springbootexample --recent' for more information

C:\Users\arjun\Desktop\SpringBoot>

@Arjun09 Breaking out the fourth line of output, you can see that what you've pushed is the following:

[Buildpack]                      DEBUG Application Contents: [

".",
".classpath",
".project",
".settings",
".settings/org.eclipse.buildship.core.prefs",
"META-INF",
"META-INF/MANIFEST.MF",
"build.gradle",
"gradle",
"gradle/wrapper",
"gradle/wrapper/gradle-wrapper.jar",
"gradle/wrapper/gradle-wrapper.properties",
"gradlew",
"gradlew.bat",
"sample",
"sample/SampleApplication.class",
"sample/SampleController.class",
"settings.gradle"

]

That is not a legal Java JAR or WAR file. You need to push a properly built Java artifact in order for the buildpack to recognize and start it.

I am just writing a simple Spring Boot application and exporting it as a jar.

@Arjun09 what are the contents of your META-INF/MANIFEST.MF file?

@youngm Even if there was a Main-Class in there (there won't be, otherwise it'd have been detected by the buildpack) a Spring Boot application needs a _ton_ more JARs. This application hasn't been built using the Spring Boot Gradle plugin, which means that it's unlikely to run, even if it stages.

For reference, a minimal Spring Boot JAR would look something like:

META-INF/
META-INF/MANIFEST.MF
BOOT-INF/
BOOT-INF/classes/
BOOT-INF/classes/io/
BOOT-INF/classes/io/pivotal/
BOOT-INF/classes/application.properties
BOOT-INF/classes/io/pivotal/HalDemoApplication.class
BOOT-INF/classes/io/pivotal/Name.class
BOOT-INF/classes/io/pivotal/Names.class
META-INF/maven/
META-INF/maven/io.pivotal/
META-INF/maven/io.pivotal/hal-demo/
META-INF/maven/io.pivotal/hal-demo/pom.xml
META-INF/maven/io.pivotal/hal-demo/pom.properties
BOOT-INF/lib/
BOOT-INF/lib/spring-boot-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/jul-to-slf4j-1.7.21.jar
BOOT-INF/lib/hibernate-validator-5.2.4.Final.jar
BOOT-INF/lib/tomcat-embed-websocket-8.5.5.jar
BOOT-INF/lib/jackson-databind-2.8.3.jar
BOOT-INF/lib/classmate-1.3.1.jar
BOOT-INF/lib/spring-web-4.3.3.RELEASE.jar
BOOT-INF/lib/jackson-annotations-2.8.3.jar
BOOT-INF/lib/jackson-core-2.8.3.jar
BOOT-INF/lib/spring-context-4.3.3.RELEASE.jar
BOOT-INF/lib/spring-boot-starter-hateoas-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/snakeyaml-1.17.jar
BOOT-INF/lib/spring-webmvc-4.3.3.RELEASE.jar
BOOT-INF/lib/spring-hateoas-0.21.0.RELEASE.jar
BOOT-INF/lib/spring-beans-4.3.3.RELEASE.jar
BOOT-INF/lib/slf4j-api-1.7.21.jar
BOOT-INF/lib/spring-boot-starter-logging-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/spring-boot-starter-web-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/spring-boot-autoconfigure-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/spring-aop-4.3.3.RELEASE.jar
BOOT-INF/lib/logback-classic-1.1.7.jar
BOOT-INF/lib/tomcat-embed-core-8.5.5.jar
BOOT-INF/lib/spring-plugin-core-1.2.0.RELEASE.jar
BOOT-INF/lib/tomcat-embed-el-8.5.5.jar
BOOT-INF/lib/spring-boot-starter-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/logback-core-1.1.7.jar
BOOT-INF/lib/validation-api-1.1.0.Final.jar
BOOT-INF/lib/spring-core-4.3.3.RELEASE.jar
BOOT-INF/lib/spring-boot-starter-tomcat-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/jcl-over-slf4j-1.7.21.jar
BOOT-INF/lib/log4j-over-slf4j-1.7.21.jar
BOOT-INF/lib/spring-boot-actuator-1.5.0.BUILD-SNAPSHOT.jar
BOOT-INF/lib/jboss-logging-3.3.0.Final.jar
BOOT-INF/lib/spring-expression-4.3.3.RELEASE.jar
BOOT-INF/lib/spring-boot-starter-actuator-1.5.0.BUILD-SNAPSHOT.jar
org/
org/springframework/
org/springframework/boot/
org/springframework/boot/loader/
org/springframework/boot/loader/LaunchedURLClassLoader$1.class
org/springframework/boot/loader/PropertiesLauncher$ArchiveEntryFilter.class
org/springframework/boot/loader/PropertiesLauncher$PrefixMatchingArchiveFilter.class
org/springframework/boot/loader/Launcher.class
org/springframework/boot/loader/ExecutableArchiveLauncher$1.class
org/springframework/boot/loader/jar/
org/springframework/boot/loader/jar/JarFile$1.class
org/springframework/boot/loader/jar/Handler.class
org/springframework/boot/loader/jar/JarEntry.class
org/springframework/boot/loader/jar/JarFile$3.class
org/springframework/boot/loader/jar/CentralDirectoryEndRecord.class
org/springframework/boot/loader/jar/CentralDirectoryVisitor.class
org/springframework/boot/loader/jar/JarFile$JarFileType.class
org/springframework/boot/loader/jar/JarFileEntries.class
org/springframework/boot/loader/jar/JarFile.class
org/springframework/boot/loader/jar/JarFileEntries$1.class
org/springframework/boot/loader/jar/JarURLConnection$1.class
org/springframework/boot/loader/jar/JarFile$2.class
org/springframework/boot/loader/jar/JarEntryFilter.class
org/springframework/boot/loader/jar/AsciiBytes.class
org/springframework/boot/loader/jar/CentralDirectoryParser.class
org/springframework/boot/loader/jar/Bytes.class
org/springframework/boot/loader/jar/ZipInflaterInputStream.class
org/springframework/boot/loader/jar/JarFileEntries$EntryIterator.class
org/springframework/boot/loader/jar/FileHeader.class
org/springframework/boot/loader/jar/JarURLConnection$JarEntryName.class
org/springframework/boot/loader/jar/JarURLConnection.class
org/springframework/boot/loader/jar/CentralDirectoryFileHeader.class
org/springframework/boot/loader/PropertiesLauncher$FilteredArchive$1.class
org/springframework/boot/loader/data/
org/springframework/boot/loader/data/ByteArrayRandomAccessData.class
org/springframework/boot/loader/data/RandomAccessDataFile$DataInputStream.class
org/springframework/boot/loader/data/RandomAccessDataFile$FilePool.class
org/springframework/boot/loader/data/RandomAccessData$ResourceAccess.class
org/springframework/boot/loader/data/RandomAccessDataFile.class
org/springframework/boot/loader/data/RandomAccessData.class
org/springframework/boot/loader/LaunchedURLClassLoader.class
org/springframework/boot/loader/JarLauncher.class
org/springframework/boot/loader/MainMethodRunner.class
org/springframework/boot/loader/PropertiesLauncher$FilteredArchive.class
org/springframework/boot/loader/PropertiesLauncher$1.class
org/springframework/boot/loader/ExecutableArchiveLauncher.class
org/springframework/boot/loader/WarLauncher.class
org/springframework/boot/loader/archive/
org/springframework/boot/loader/archive/JarFileArchive$EntryIterator.class
org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator.class
org/springframework/boot/loader/archive/ExplodedArchive$FileEntry.class
org/springframework/boot/loader/archive/JarFileArchive$JarFileEntry.class
org/springframework/boot/loader/archive/Archive$Entry.class
org/springframework/boot/loader/archive/JarFileArchive.class
org/springframework/boot/loader/archive/ExplodedArchive.class
org/springframework/boot/loader/archive/Archive.class
org/springframework/boot/loader/archive/ExplodedArchive$FileEntryIterator$EntryComparator.class
org/springframework/boot/loader/archive/Archive$EntryFilter.class
org/springframework/boot/loader/archive/ExplodedArchive$1.class
org/springframework/boot/loader/PropertiesLauncher.class
org/springframework/boot/loader/util/
org/springframework/boot/loader/util/SystemPropertyUtils.class

Anything less than that isn't actually a runnable application and the buildpack won't detect or stage it.

@youngm I don't see that file at all inside the project

@nebhale Right. It's definitely not a spring boot app. And won't start a web server correctly. But I'm curious why @Arjun09 claims it runs with java -jar yet the Java Main container doesn't detect it. I was just looking for a quick confirmation.

@Arjun09 It's the 7th line in the previous listing

@Arjun09 You might need to unzip the .jar to see it.

image

That is the structure and main class with @SpringBootApplication annotation

when I unzip jar file I see META-INF/MANIFEST.MF file and it has below info

Manifest-Version: 1.0

If that is the case, then the command that @youngm suggested you test (java -jar springboot.jar) could not possibly have worked. Without a Main-Class declaration in the manifest, that command would fail.

@Arjun09 Instead of doing an Eclipse "export" you need to do a gradle build to produce the spring boot .jar properly. Try reading this guide: https://spring.io/guides/gs/spring-boot/ Focusing on the area around how to execute a "build"

@Arjun09 This guide might be better: https://spring.io/guides/gs/gradle/

Huh it worked with gradle build. Thanks Guys :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ajay-dbs picture ajay-dbs  ·  21Comments

aknobloch picture aknobloch  ·  8Comments

metacubed picture metacubed  ·  6Comments

mkuratczyk picture mkuratczyk  ·  10Comments

pxie picture pxie  ·  20Comments