Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

Heroku Error "Application error" ao acessar aplicação

Segue stacktrace ao executar o comando heroku logs --tail

2019-08-13T12:50:32.755383+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=casadocodigo-gabriel.herokuapp.com request_id=485a0e5a-d859-4606-9bd8-e3376efe30e3 fwd="189.20.223.212" dyno= connect= service= status=503 bytes= protocol=https
2019-08-13T12:50:33.222058+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=casadocodigo-gabriel.herokuapp.com request_id=69330420-84d5-4e0b-9723-85874646047f fwd="189.20.223.212" dyno= connect= service= status=503 bytes= protocol=https
2019-08-13T12:53:06.180478+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=casadocodigo-gabriel.herokuapp.com request_id=e77cd769-ba8b-42a5-9eee-e81833064822 fwd="189.20.223.212" dyno= connect= service= status=503 bytes= protocol=https
2019-08-13T12:53:06.417954+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=casadocodigo-gabriel.herokuapp.com request_id=cd055586-7d14-4e08-9dc8-0f6780da220c fwd="189.20.223.212" dyno= connect= service= status=503 bytes= protocol=https
5 respostas

Manda o stack completo do erro, por favor.

 heroku logs --tail
2019-08-13T20:27:12.380735+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
2019-08-13T20:27:12.380737+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
2019-08-13T20:27:12.380739+00:00 app[web.1]: at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
2019-08-13T20:27:12.380742+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
2019-08-13T20:27:12.380744+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)
2019-08-13T20:27:12.380746+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2019-08-13T20:27:12.380749+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
2019-08-13T20:27:12.380751+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
2019-08-13T20:27:12.380753+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2019-08-13T20:27:12.380756+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2019-08-13T20:27:12.380758+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2019-08-13T20:27:12.380760+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:748)
2019-08-13T20:27:12.380762+00:00 app[web.1]: 
2019-08-13T20:27:12.564528+00:00 app[web.1]: Aug 13, 2019 8:27:12 PM org.apache.catalina.startup.ContextConfig processAnnotationsJar
2019-08-13T20:27:12.564533+00:00 app[web.1]: SEVERE: Unable to process Jar entry [org/hibernate/internal/jaxb/mapping/orm/JaxbJoinTable.class] from Jar [jar:jndi:/localhost/WEB-INF/lib/hibernate-core-4.3.0.Final.jar!/] for annotations
2019-08-13T20:27:12.564535+00:00 app[web.1]: java.io.EOFException
2019-08-13T20:27:12.564538+00:00 app[web.1]: at org.apache.tomcat.util.bcel.classfile.FastDataInputStream.readInt(FastDataInputStream.java:145)
2019-08-13T20:27:12.564540+00:00 app[web.1]: at org.apache.tomcat.util.bcel.classfile.ClassParser.readID(ClassParser.java:200)
2019-08-13T20:27:12.564542+00:00 app[web.1]: at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:78)
2019-08-13T20:27:12.564544+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2071)
2019-08-13T20:27:12.564546+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1947)
2019-08-13T20:27:12.564548+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1913)
2019-08-13T20:27:12.564551+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1898)
2019-08-13T20:27:12.564553+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1330)
2019-08-13T20:27:12.564555+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:889)
2019-08-13T20:27:12.564557+00:00 app[web.1]: at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:386)
2019-08-13T20:27:12.564559+00:00 app[web.1]: at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
2019-08-13T20:27:12.564561+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
2019-08-13T20:27:12.564563+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5380)
2019-08-13T20:27:12.564565+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2019-08-13T20:27:12.564567+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
2019-08-13T20:27:12.564569+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
2019-08-13T20:27:12.564572+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2019-08-13T20:27:12.564574+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2019-08-13T20:27:12.564576+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2019-08-13T20:27:12.564578+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:748)
2019-08-13T20:27:12.564581+00:00 app[web.1]: 
2019-08-13T20:27:17.149978+00:00 app[web.1]: Aug 13, 2019 8:27:17 PM org.apache.catalina.core.ApplicationContext log
2019-08-13T20:27:17.150008+00:00 app[web.1]: INFO: Spring WebApplicationInitializers detected on classpath: [br.com.alura.casadocodigo.loja.configuration.SpringSecurityFilterConfiguration@46ae52f2, br.com.alura.casadocodigo.loja.configuration.ServletSpringMVC@2e8ee6e3]
2019-08-13T20:27:17.245166+00:00 app[web.1]: log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
2019-08-13T20:27:17.245237+00:00 app[web.1]: log4j:WARN Please initialize the log4j system properly.
2019-08-13T20:27:17.245288+00:00 app[web.1]: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2019-08-13T20:27:17.354528+00:00 app[web.1]: Aug 13, 2019 8:27:17 PM org.apache.catalina.core.ApplicationContext log
2019-08-13T20:27:17.354534+00:00 app[web.1]: INFO: Initializing Spring root WebApplicationContext
2019-08-13T20:27:18.844302+00:00 app[web.1]: Aug 13, 2019 8:27:18 PM org.apache.catalina.core.StandardContext listenerStart
2019-08-13T20:27:18.844324+00:00 app[web.1]: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
2019-08-13T20:27:18.844329+00:00 app[web.1]: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class br.com.alura.casadocodigo.loja.configuration.JPAConfiguration: Unsatisfied dependency expressed through constructor argument with index 1 of type [java.util.Properties]: : No qualifying bean of type [java.util.Properties] is defined: expected single matching bean but found 2: aditionalProperties,systemProperties; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [java.util.Properties] is defined: expected single matching bean but found 2: aditionalProperties,systemProperties
2019-08-13T20:27:18.844332+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:751)
2019-08-13T20:27:18.844334+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:466)
2019-08-13T20:27:18.844336+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1113)
2019-08-13T20:27:18.844338+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1008)
2019-08-13T20:27:18.844341+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:505)
2019-08-13T20:27:18.844342+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
2019-08-13T20:27:18.844344+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
2019-08-13T20:27:18.844346+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:229)
2019-08-13T20:27:18.844347+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
2019-08-13T20:27:18.844349+00:00 app[web.1]: at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
2019-08-13T20:27:18.844350+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:956)
2019-08-13T20:27:18.844352+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:747)
2019-08-13T20:27:18.844353+00:00 app[web.1]: at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
2019-08-13T20:27:18.844355+00:00 app[web.1]: at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
2019-08-13T20:27:18.844356+00:00 app[web.1]: at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
2019-08-13T20:27:18.844357+00:00 app[web.1]: at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
2019-08-13T20:27:18.844359+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4992)
2019-08-13T20:27:18.844370+00:00 app[web.1]: at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
2019-08-13T20:27:18.844372+00:00 app[web.1]: at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2019-08-13T20:27:18.844373+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
2019-08-13T20:27:18.844374+00:00 app[web.1]: at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
2019-08-13T20:27:18.844376+00:00 app[web.1]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2019-08-13T20:27:18.844378+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2019-08-13T20:27:18.844379+00:00 app[web.1]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2019-08-13T20:27:18.844381+00:00 app[web.1]: at java.lang.Thread.run(Thread.java:748)
2019-08-13T20:27:18.844383+00:00 app[web.1]: Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [java.util.Properties] is defined: expected single matching bean but found 2: aditionalProperties,systemProperties
2019-08-13T20:27:18.844384+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1016)
2019-08-13T20:27:18.844386+00:00 app[web.1]: at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:904)
2019-08-13T20:27:18.844393+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:815)
2019-08-13T20:27:18.844395+00:00 app[web.1]: at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:743)
2019-08-13T20:27:18.844396+00:00 app[web.1]: ... 24 more
2019-08-13T20:27:18.844398+00:00 app[web.1]: 
2019-08-13T20:27:18.844790+00:00 app[web.1]: Aug 13, 2019 8:27:18 PM org.apache.catalina.core.StandardContext startInternal
2019-08-13T20:27:18.844793+00:00 app[web.1]: SEVERE: Error listenerStart
2019-08-13T20:27:18.877527+00:00 app[web.1]: Aug 13, 2019 8:27:18 PM org.apache.catalina.core.StandardContext startInternal
2019-08-13T20:27:18.877532+00:00 app[web.1]: SEVERE: Context [] startup failed due to previous errors
2019-08-13T20:27:18.878459+00:00 app[web.1]: SEVERE: Context [] failed in [org.apache.catalina.core.StandardContext] lifecycle. Allowing Tomcat to shutdown.
2019-08-13T20:27:18.879566+00:00 app[web.1]: Aug 13, 2019 8:27:18 PM org.apache.catalina.core.ApplicationContext log
2019-08-13T20:27:18.879570+00:00 app[web.1]: INFO: Closing Spring root WebApplicationContext
2019-08-13T20:27:18.889019+00:00 app[web.1]: Aug 13, 2019 8:27:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
2019-08-13T20:27:18.889080+00:00 app[web.1]: SEVERE: The web application [] registered the JDBC driver [com.mysql.cj.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2019-08-13T20:27:18.890287+00:00 app[web.1]: Aug 13, 2019 8:27:18 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
2019-08-13T20:27:18.890292+00:00 app[web.1]: SEVERE: The web application [] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it 
solução!

O problema é essa linha:

Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [java.util.Properties] is defined: expected single matching bean but found 2: aditionalProperties,systemProperties

Ambos implementam Properties, e por isso o spring não sabe qual deles você quer injetar.

Você vai ter que utilizar @Resource(name="namedFile") nesse caso: https://www.baeldung.com/spring-annotations-resource-inject-autowire