5
respostas

heroku error H14

Ola, Estou com erro ao tentar executar minha aplicação no heroku

Para o erro do log, no suporte do heroku orienta-se executar o comando abaixo, mas o comando não é executado com sucesso, vocês sabem o que pode ser ?

C:\Users\marcosrocha\workspace\casadocodigo>heroku ps:scale web=1
Scaling dynos... !
 !    Couldn't find that formation.

Segue o log do heroku

2016-12-15T18:49:21.736494+00:00 heroku[java.1]: State changed from up to crashed
2016-12-15T18:50:00.120188+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=cdcspringmvc-estudo.herokuapp.com request_id=150699cd-4572-451b-a23b-6cfb4484dd4e fwd="187.72.178.193" dyno= connect= service= status=503 bytes=
2016-12-15T18:50:00.584202+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=cdcspringmvc-estudo.herokuapp.com request_id=3db29413-bec9-43ee-b781-6037f4c4dd24 fwd="187.72.178.193" dyno= connect= service= status=503 bytes=
2016-12-15T18:54:42.456274+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/" host=cdcspringmvc-estudo.herokuapp.com request_id=58bdc5c6-2e6e-4254-bc39-40a08be16bec fwd="187.72.178.193" dyno= connect= service= status=503 bytes=
2016-12-15T18:54:42.937535+00:00 heroku[router]: at=error code=H14 desc="No web processes running" method=GET path="/favicon.ico" host=cdcspringmvc-estudo.herokuapp.com request_id=06320621-e94d-4757-8d15-5188a1c2d08f fwd="187.72.178.193" dyno= connect= service= status=503 bytes=
2016-12-15T18:59:18.056335+00:00 heroku[java.1]: State changed from crashed to starting
2016-12-15T18:59:23.377331+00:00 heroku[java.1]: Starting process with command `$JAVA_OPTS -jar -Dspring.profiles.active=prod target/dependency/webapp-runner.jar --port 23086 target/*.war`
2016-12-15T18:59:24.036984+00:00 heroku[java.1]: State changed from starting to up
2016-12-15T18:59:25.847969+00:00 heroku[java.1]: Process exited with status 127
2016-12-15T18:59:25.782225+00:00 app[java.1]: bash: -Xmx350m: command not found
2016-12-15T18:59:25.861692+00:00 heroku[java.1]: State changed from up to crashed
5 respostas

Fala aí Marcos, blz?

Seu arquivo Procfile está com alguma extensão?

Blz Fernando,

está sem extensão, e o coloquei na raiz do projeto o seguinte codigo:

java $JAVA_OPTS -jar -Dspring.profiles.active=prod target/dependency/webapp-runner.jar --port $PORT target/*.war

Aparentemente está correto Marcos,

Quando pesquisei sobre esse problema em windows, a maioria das soluções é a existência da extensão no arquivo. =/

Mas só por desencargo pode fazer um teste?

Renomeia esse arquivo Procfile e execute o seguinte comando:

echo "java $JAVA_OPTS -jar -Dspring.profiles.active=prod target/dependency/webapp-runner.jar --port $PORT target/*.war" > Procfile

Outro erro é relacionado com Procfilee windows é com relação as variáveis de ambientes que usam %NOME_DA_VARIAVEL% ao invés de $NOME_DA_VARIAVEL para rodar localmente.

E ai Marcos blz? Cara você teve algum problema as dependências do Spring Security? Você pode disponibilizar seu pom.xml para eu comparar com o meu. Estou com um problema desde ontem e não consigo resolver. Abraço.

Ola Carlos, blz Tive problemas com ele sim mas resolvi pegando a versão de RELEASE

segue meu pom.xml completo pra vc dar uma olhada

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.casadocodigo</groupId>
    <artifactId>casadocodigo</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>casadocodigo Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <!-- Frame de gerenciamento de cache -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>18.0</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>4.1.0.RELEASE</version>
        </dependency>
        <!-- fim cache  -->

        <!-- Spring Framework -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.1.0.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-servlet-api</artifactId>
            <version>7.0.30</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jstl-impl</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.6.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
            <scope>runtime</scope>
        </dependency>
        <!-- fim spring framework -->

        <!-- Dependencias para Persistencia de dados -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>4.3.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.3.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate.javax.persistence</groupId>
            <artifactId>hibernate-jpa-2.1-api</artifactId>
            <version>1.0.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>4.1.0.RELEASE</version>
        </dependency>

        <!-- Bancos de Dados -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.15</version>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>9.4-1201-jdbc41</version>
        </dependency>

        <!-- Validações -->
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>

        <!-- Usar Json no spring -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.5.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.5.1</version>
        </dependency>

        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>4.0.0.RELEASE</version>
        </dependency>

        <!-- Biblioteca de Tests -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>4.1.0.RELEASE</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <version>4.0.0.RELEASE</version>
            <scope>test</scope>
        </dependency>

        <!-- Envio de e-mail -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.7</version>
        </dependency>

    </dependencies>

    <pluginRepositories>

    </pluginRepositories>

    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <finalName>casadocodigo</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.github.jsimone</groupId>
                                    <artifactId>webapp-runner</artifactId>
                                    <version>7.0.57.2</version>
                                    <destFileName>webapp-runner.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- CONFIGURAR VERSÃO DO JAVA PARA 1.7 -->
            <!-- <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin> -->

        </plugins>
    </build>
</project>