Тема: Deploy Spring on heroku

Через пів доби я все ж таки задеплоїв свій сайт на heroku, локально він працює, а там ось що видає
2021-07-14T17:10:43.131553+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=1f0afc44-607e-4eb8-a836-6806fd5a15ab fwd="93.75.241.25" dyno= connect= service= status=503 bytes= protocol=https
2021-07-14T17:10:43.426994+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=a46d8119-d195-460e-9368-6defe18a1a68 fwd="93.75.241.25" dyno= connect= service= status=503 bytes= protocol=https

2

Re: Deploy Spring on heroku

А можна трішки більше інформації?

Пам'ятаю що на Heroku є/був ліміт по часу на розгортання додатку (можливо щось вже змінилося, але принаймні раніше таке було - 90 секунд). Тому цікавить ось цей момент:

...а там ось що видає...

Це відбувається відразу чи додаток розгортається й лише через певний час падає?

А ще більше цікавить вміст Procfile.

Також цікаво що саме відображається в логах?

heroku logs --tail --app {NAME_APP}

3

Re: Deploy Spring on heroku

це відбувається відразу і результат не міняється з часом... Ребут теж пробував робити, нічого...

Прихований текст

2021-07-14T17:10:41.262694+00:00 app[web.1]: 2021-07-14 17:10:41.262  INFO 4 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-07-14T17:10:41.262836+00:00 app[web.1]: 2021-07-14 17:10:41.262  INFO 4 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3638 ms
2021-07-14T17:10:41.680817+00:00 app[web.1]: 2021-07-14 17:10:41.680  WARN 4 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.spri
ngframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mapController': Unsatisfied dependency expressed through field 'db'; nested exception is org.springframework.beans.factory.UnsatisfiedDependenc
yException: Error creating bean with name 'firebaseRepository': Unsatisfied dependency expressed through field 'db'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'firebas
eInitializer': Invocation of init method failed; nested exception is java.lang.NullPointerException
2021-07-14T17:10:41.688780+00:00 app[web.1]: 2021-07-14 17:10:41.688  INFO 4 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-07-14T17:10:41.719389+00:00 app[web.1]: 2021-07-14 17:10:41.719  INFO 4 --- [           main] ConditionEvaluationReportLoggingListener :
2021-07-14T17:10:41.719391+00:00 app[web.1]:
2021-07-14T17:10:41.719391+00:00 app[web.1]: Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-07-14T17:10:41.756028+00:00 app[web.1]: 2021-07-14 17:10:41.755 ERROR 4 --- [           main] o.s.boot.SpringApplication               : Application run failed
2021-07-14T17:10:41.756030+00:00 app[web.1]:
2021-07-14T17:10:41.756032+00:00 app[web.1]: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mapController': Unsatisfied dependency expressed through field 'db'; nested exception is o
rg.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'firebaseRepository': Unsatisfied dependency expressed through field 'db'; nested exception is org.springframework.beans.factory.BeanCrea
tionException: Error creating bean with name 'firebaseInitializer': Invocation of init method failed; nested exception is java.lang.NullPointerException
2021-07-14T17:10:41.756034+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-
5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756035+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.8.jar!/
:5.3.8]
2021-07-14T17:10:41.756052+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756053+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756054+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756055+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756055+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756056+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756057+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756057+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756058+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756058+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756059+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756059+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756060+00:00 app[web.1]: at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.1.jar!/:2.5.1]
2021-07-14T17:10:41.756060+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) [spring-boot-2.5.1.jar!/:2.5.1]
2021-07-14T17:10:41.756060+00:00 app[web.1]: at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) [spring-boot-2.5.1.jar!/:2.5.1]
2021-07-14T17:10:41.756061+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) [spring-boot-2.5.1.jar!/:2.5.1]
2021-07-14T17:10:41.756061+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) [spring-boot-2.5.1.jar!/:2.5.1]
2021-07-14T17:10:41.756062+00:00 app[web.1]: at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) [spring-boot-2.5.1.jar!/:2.5.1]
2021-07-14T17:10:41.756062+00:00 app[web.1]: at com.example.photoReview.PhotoReviewApplication.main(PhotoReviewApplication.java:10) [classes!/:0.0.1-SNAPSHOT]
2021-07-14T17:10:41.756063+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756063+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756071+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756072+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756072+00:00 app[web.1]: at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [photoReview-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2021-07-14T17:10:41.756072+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) [photoReview-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2021-07-14T17:10:41.756082+00:00 app[web.1]: at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [photoReview-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2021-07-14T17:10:41.756083+00:00 app[web.1]: at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) [photoReview-0.0.1-SNAPSHOT.jar:0.0.1-SNAPSHOT]
2021-07-14T17:10:41.756090+00:00 app[web.1]: Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'firebaseRepository': Unsatisfied dependency expressed through field 'db'; neste
d exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'firebaseInitializer': Invocation of init method failed; nested exception is java.lang.NullPointerException
2021-07-14T17:10:41.756091+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:660) ~[spring-beans-
5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756092+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640) ~[spring-beans-5.3.8.jar!/
:5.3.8]
2021-07-14T17:10:41.756092+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:119) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756092+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756093+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1413) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756093+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756094+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756094+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756095+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756095+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756096+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756096+00:00 app[web.1]: at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756097+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756100+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756101+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-
5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756101+00:00 app[web.1]: ... 28 common frames omitted
2021-07-14T17:10:41.756102+00:00 app[web.1]: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'firebaseInitializer': Invocation of init method failed; nested exception is java.lang.Nu
llPointerException
2021-07-14T17:10:41.756102+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160) ~[spring-beans-5.3.
8.jar!/:5.3.8]
2021-07-14T17:10:41.756108+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) ~[spring-beans-5.3
.8.jar!/:5.3.8]
2021-07-14T17:10:41.756108+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756109+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756109+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756109+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756110+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756110+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756110+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756111+00:00 app[web.1]: at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756111+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1380) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756111+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1300) ~[spring-beans-5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756112+00:00 app[web.1]: at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:657) ~[spring-beans-
5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756112+00:00 app[web.1]: ... 42 common frames omitted
2021-07-14T17:10:41.756113+00:00 app[web.1]: Caused by: java.lang.NullPointerException: null
2021-07-14T17:10:41.756114+00:00 app[web.1]: at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:890) ~[guava-29.0-android.jar!/:na]
2021-07-14T17:10:41.756114+00:00 app[web.1]: at com.google.api.client.util.Preconditions.checkNotNull(Preconditions.java:125) ~[google-http-client-1.35.0.jar!/:1.35.0]
2021-07-14T17:10:41.756114+00:00 app[web.1]: at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:150) ~[google-auth-library-oauth2-http-0.20.0.jar!/:na]
2021-07-14T17:10:41.756115+00:00 app[web.1]: at com.google.auth.oauth2.GoogleCredentials.fromStream(GoogleCredentials.java:133) ~[google-auth-library-oauth2-http-0.20.0.jar!/:na]
2021-07-14T17:10:41.756115+00:00 app[web.1]: at com.example.photoReview.FirebaseInitializer.initDB(FirebaseInitializer.java:23) ~[classes!/:0.0.1-SNAPSHOT]
2021-07-14T17:10:41.756116+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756116+00:00 app[web.1]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756116+00:00 app[web.1]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756117+00:00 app[web.1]: at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_292-heroku]
2021-07-14T17:10:41.756117+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389) ~[spring-beans-5.3.8.jar!/:
5.3.8]
2021-07-14T17:10:41.756118+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333) ~[spring-beans-
5.3.8.jar!/:5.3.8]
2021-07-14T17:10:41.756118+00:00 app[web.1]: at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157) ~[spring-beans-5.3.
8.jar!/:5.3.8]
2021-07-14T17:10:41.756119+00:00 app[web.1]: ... 54 common frames omitted
2021-07-14T17:10:41.756119+00:00 app[web.1]:
2021-07-14T17:10:41.823665+00:00 heroku[web.1]: Process exited with status 1
2021-07-14T17:10:41.958502+00:00 heroku[web.1]: State changed from starting to crashed
2021-07-14T17:10:43.131553+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=1f0afc44-607e-4eb8-a836-6806fd5a15ab fwd="93.75.241.25" dyno= connect= service= stat
us=503 bytes= protocol=https
2021-07-14T17:10:43.426994+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=a46d8119-d195-460e-9368-6defe18a1a68 fwd="93.75.241.25" dyno= connect= se
rvice= status=503 bytes= protocol=https
2021-07-14T17:13:16.171410+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=fc243ca0-3d70-4b58-a09e-a8233f06dde9 fwd="93.75.241.25" dyno= connect= service= stat
us=503 bytes= protocol=https
2021-07-14T17:13:16.517546+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=1a877971-91d6-4789-927e-524a7d2d5456 fwd="93.75.241.25" dyno= connect= se
rvice= status=503 bytes= protocol=https
2021-07-14T17:30:43.784333+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=0c6b7a74-d595-4b88-8f9b-58c3c8907238 fwd="93.75.241.25" dyno= connect= service= stat
us=503 bytes= protocol=https
2021-07-14T17:30:44.147238+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=df2a8b7b-669c-443d-8a73-497a0df78f33 fwd="93.75.241.25" dyno= connect= se
rvice= status=503 bytes= protocol=https
2021-07-14T17:31:24.954699+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=3da495d8-7501-4c35-8c0b-e4c2ae724b82 fwd="93.75.241.25" dyno= connect= service= stat
us=503 bytes= protocol=https
2021-07-14T17:31:25.300489+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=0149074b-193c-4785-b361-33303ec0ad27 fwd="93.75.241.25" dyno= connect= se
rvice= status=503 bytes= protocol=https
2021-07-14T17:40:44.543779+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=099e4e3b-5d45-49bb-a447-f1f2f985a925 fwd="93.75.241.25" dyno= connect= service= stat
us=503 bytes= protocol=https
2021-07-14T17:40:44.906165+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=95dad9b0-192f-4a1b-ba7e-0bc16f4de093 fwd="93.75.241.25" dyno= connect= se
rvice= status=503 bytes= protocol=https
2021-07-14T17:44:49.461993+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=photoreview.herokuapp.com request_id=4a6f3eb9-1d7c-4b97-bbe3-1dde39edc8f4 fwd="93.75.241.25" dyno= connect= service= stat
us=503 bytes= protocol=https
2021-07-14T17:44:49.786416+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=photoreview.herokuapp.com request_id=b50202d9-7f9f-4ee8-b00f-0d9471bd3b64 fwd="93.75.241.25" dyno= connect= se
rvice= status=503 bytes= protocol=https

4 Востаннє редагувалося yan.volkovich (14.07.2021 19:48:57)

Re: Deploy Spring on heroku

коли запускаю локально - все працює, зараз бачу в цих логах що не все тоді побачив, не там дивився, це якась проблема з firebase ?

5 Востаннє редагувалося fed_lviv (14.07.2021 19:56:07)

Re: Deploy Spring on heroku

це якась проблема з firebase

Схоже на те. Можливо у вас при створенні біна відбувається певна взаємодія з Firebase. Локально вона норм проходить, а ось віддалено (в даному випадку Heroku) - ні.

Caused by: java.lang.NullPointerException: null
...
at com.google.auth.oauth2.GoogleCredentials...
...
at com.example.photoReview.FirebaseInitializer.initDB...
...

6

Re: Deploy Spring on heroku

у мене там є така штука, посилання на файл з конфігом... може справа в цьому?
InputStream serviceAccount = this.getClass().getClassLoader().getResourceAsStream("./photoapp-6ea36-firebase-adminsdk-24fkl-8194e2f26c.json");

7 Востаннє редагувалося fed_lviv (14.07.2021 20:18:39)

Re: Deploy Spring on heroku

InputStream serviceAccount = this.getClass().getClassLoader().getResourceAsStream("./photoapp-6ea36-firebase-adminsdk-24fkl-8194e2f26c.json");

...локально він працює,...

А, як саме він локально працює? Запуск з IDE? Спробуйте запустити локально, без IDE. Тобто зібрати jar й виконати команду:

 java -jar {JAR_NAME}

;)

Подякували: leofun011

8

Re: Deploy Spring on heroku

дивно, пише таку штуку... але ж там є цей класс
$ java -jar photoReview.jar
Error: Could not find or load main class com.example.photoReview.PhotoReviewApplication
Caused by: java.lang.ClassNotFoundException: com.example.photoReview.PhotoReviewApplication

9 Востаннє редагувалося fed_lviv (14.07.2021 20:39:15)

Re: Deploy Spring on heroku

дивно, пише таку штуку... але ж там є цей класс

Тут момент в тому, як саме збирався той jar файл, відповідно ... (дивіться ось тут - https://stackoverflow.com/questions/130 … -jar-file)

А, щодо:

this.getClass().getClassLoader().getResourceAsStream("./photoapp-6ea36-firebase-adminsdk-24fkl-8194e2f26c.json");

То в Spring є ось така допоміжна цяцька:

@Value("classpath:{FILE_NAME}") 
Resource resource;

й тоді все буде добре при запуску з IDE чи просто CLI (java -jar ...)

Подякували: yan.volkovich, leofun012

10

Re: Deploy Spring on heroku

запустилося, вирішив питання пальцем в небо, просто так вийшло що перейменував файл і забув поставити як було крапка і слеш перед назвою файла InputStream serviceAccount = this.getClass().getClassLoader().getResourceAsStream("service-account-file.json"); задеплоїв і воно запустилося... мдє...

11

Re: Deploy Spring on heroku

але щось працює дуже повільно, та деякі функціі JS взагалі чогось не працюють...

12

Re: Deploy Spring on heroku

Mixed Content: The page at 'https://photoreview.herokuapp.com/' was loaded over HTTPS, but requested an insecure script 'http://code.jquery.com/jquery-latest.js'. This request has been blocked; the content must be served over HTTPS.

13 Востаннє редагувалося yan.volkovich (14.07.2021 21:07:04)

Re: Deploy Spring on heroku

все зробив! просто додав у шлях 's' https://code.jquery.com/jquery-latest.js
дякую!