Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Question: Unable to stage hello world java-see app #30

Open
Manish-Mj opened this issue Jan 28, 2019 · 5 comments
Open

Question: Unable to stage hello world java-see app #30

Manish-Mj opened this issue Jan 28, 2019 · 5 comments

Comments

@Manish-Mj
Copy link

Manish-Mj commented Jan 28, 2019

Hello Team,

I'm trying to understand cf local to see how I can use it in our project. Am pretty new to the cloud world as well. I installed cf local plugin & cloned a basic example from: https://github.com/18F/cf-hello-worlds
I ran the below commands but always get some certificate errors. I tried my best to import certs but still unable to go past this step. Any pointers would be helpful.

root@hostname:/code/cf-hello-worlds/java-see# update-ca-certificates
Updating certificates in /etc/ssl/certs...
1 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

Adding debian:java-bpCert-via_openssl_cmd.pem
done.
done.
root@hostname:/code/cf-hello-worlds/java-see# cf local stage java-see
Buildpack: will detect
[java-see] 2019-01-28T04:38:59.903285588Z [DownloadCache] WARN Unable to download https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml into cache /tmp: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
[java-see] 2019-01-28T04:38:59.903838075Z [Buildpack] ERROR Detect failed with exception #<RuntimeError: Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml>
[java-see] 2019-01-28T04:38:59.903878599Z Jvmkill Agent error: Unable to find cached file for https://java-buildpack.cloudfoundry.org/jvmkill/trusty/x86_64/index.yml
[java-see] 2019-01-28T04:39:00.433670968Z None of the buildpacks detected a compatible application
[java-see] 2019-01-28T04:39:00.434500600Z 2019/01/28 04:39:00 Error: failed to build: exit status 222
Error: container exited with status 7
FAILED
root@hostname:/code/cf-hello-worlds/java-see#

@Manish-Mj
Copy link
Author

Manish-Mj commented Jan 29, 2019

Hello @sclevine any help on this is appreciated, thanks.

@sclevine
Copy link
Contributor

sclevine commented Feb 5, 2019

Do you use an HTTP/HTTPS proxy to connect to the internet on your workstation?

@Manish-Mj
Copy link
Author

Yes there is. I exported the certificate chain and added to the /usr/share/ca-certificates, but still no luck @ all.

@Manish-Mj
Copy link
Author

Hi @sclevine I was finally stage the app using offline buildpack, but now another hurdle.
Its a maven app & am not able to run it. Error stack below. Any pointers are appreciated.

Running sample-java-app on port 46362...
[sample-java-app] 2019-02-12T07:24:10.241827894Z Exception in thread "main" java.lang.reflect.InvocationTargetException
[sample-java-app] 2019-02-12T07:24:10.247293545Z at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[sample-java-app] 2019-02-12T07:24:10.247447243Z at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[sample-java-app] 2019-02-12T07:24:10.251385438Z at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[sample-java-app] 2019-02-12T07:24:10.251416534Z at java.lang.reflect.Method.invoke(Method.java:497)
[sample-java-app] 2019-02-12T07:24:10.251422838Z at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
[sample-java-app] 2019-02-12T07:24:10.251427231Z at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
[sample-java-app] 2019-02-12T07:24:10.258500944Z at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
[sample-java-app] 2019-02-12T07:24:10.258532029Z at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
[sample-java-app] 2019-02-12T07:24:10.258539054Z Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.cloudfoundry.reconfiguration.spring.CloudPropertySourceApplicationContextInitializer
[sample-java-app] 2019-02-12T07:24:10.258547214Z at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:413)
[sample-java-app] 2019-02-12T07:24:10.258552252Z at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:392)
[sample-java-app] 2019-02-12T07:24:10.258557400Z at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:383)
[sample-java-app] 2019-02-12T07:24:10.258562118Z at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:249)
[sample-java-app] 2019-02-12T07:24:10.258566368Z at org.springframework.boot.SpringApplication.(SpringApplication.java:225)
[sample-java-app] 2019-02-12T07:24:10.258571293Z at com.emc.cm.sample.Application.main(Application.java:40)
[sample-java-app] 2019-02-12T07:24:10.258575425Z ... 8 more
[sample-java-app] 2019-02-12T07:24:10.258579427Z Caused by: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextInitializer
[sample-java-app] 2019-02-12T07:24:10.258584981Z at java.lang.ClassLoader.defineClass1(Native Method)
[sample-java-app] 2019-02-12T07:24:10.258590903Z at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
[sample-java-app] 2019-02-12T07:24:10.258594405Z at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
[sample-java-app] 2019-02-12T07:24:10.258598447Z at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
[sample-java-app] 2019-02-12T07:24:10.258602074Z at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
[sample-java-app] 2019-02-12T07:24:10.258606023Z at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
[sample-java-app] 2019-02-12T07:24:10.258609662Z at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
[sample-java-app] 2019-02-12T07:24:10.258615471Z at java.security.AccessController.doPrivileged(Native Method)
[sample-java-app] 2019-02-12T07:24:10.258619503Z at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
[sample-java-app] 2019-02-12T07:24:10.258634993Z at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[sample-java-app] 2019-02-12T07:24:10.258640265Z at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[sample-java-app] 2019-02-12T07:24:10.258644441Z at java.lang.ClassLoader.loadClass(ClassLoader.java:411)
[sample-java-app] 2019-02-12T07:24:10.258648831Z at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94)
[sample-java-app] 2019-02-12T07:24:10.258653409Z at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[sample-java-app] 2019-02-12T07:24:10.258657796Z at org.springframework.util.ClassUtils.forName(ClassUtils.java:251)
[sample-java-app] 2019-02-12T07:24:10.258661528Z at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:405)
[sample-java-app] 2019-02-12T07:24:10.258665472Z ... 13 more
[sample-java-app] 2019-02-12T07:24:10.258670375Z Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextInitializer
[sample-java-app] 2019-02-12T07:24:10.258674732Z at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[sample-java-app] 2019-02-12T07:24:10.268946917Z at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[sample-java-app] 2019-02-12T07:24:10.269052037Z at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[sample-java-app] 2019-02-12T07:24:10.269058650Z at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[sample-java-app] 2019-02-12T07:24:10.269063351Z ... 29 more

@Manish-Mj
Copy link
Author

I got this fixed by building offline: java-buildpack version 4.12 which supports running spring app > 1.4.
But still some other errors. My end goal is to link it to remote service running in our cloud envi.
Please point me to a sample or doc which can be referred to make progress.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants