Tag: heroku

Heroku,Java,Procfile,无法找到或加载主类

我正在使用heroku和maven来运行服务器。 我的目标是让heroku将java类server.class作为web dyno运行。 我如何编写proc文件来执行java程序server.class作为web? 我目前的Procfile web: java -cp $JAVA_OPTS target/classes/v1/a1/server 我的错误。(来自heroku日志) Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8 Error: Could not find or load main class target.classes.v1.a1.server State changed from starting to crashed 可能有用的信息 proc文件 web: java -cp $JAVA_OPTS target/classes/v1/a1/* 返回 Error: Could not find or load main class target.classes.v1.a1.myOtherClass 我原来的Procfile(也没用) web: java -cp target/classes/:target/dependency/* server […]

将Heroku App更新为Java 8

我有一个Play 2.2应用程序,我正在使用Java 8,我无法上class。 代码使用OpenJDK 1.8在本地编译,但是当我尝试将代码推送到Heroku时,我收到以下错误,这是我在本地早些时候出现的错误,当我在LambJas上偶然运行OpenJDK 1.7时。 java.lang.RuntimeException: Unknown constant: 18 我将system.properties设置为使用Java 1.8,我知道它正在运行,因为它启动时使用以下文本: Play 2.x – Java app detected —–> Installing OpenJDK 1.8…done 有没有我忘记更新到Java 8的东西? 我尝试更新PATH以及此处指定但没有做任何事情。

使用java 9和maven进行Spring启动应用程序的编译失败

我正在尝试构建使用java-9 spring-boot应用程序,并将其部署到heroku 。 作为构建工具,我使用maven 。 我使用initializr生成了spring boot 1.5应用程序。 我添加了heroku特定文件,并为maven-compiler-plugin添加了toolchains.xml到.m2存储库。 我的pom.xml看起来像这样 4.0.0 com.lapots.breed.platform.cloud java-cloud-sample 0.0.1-SNAPSHOT jar java-cloud-sample Demo project for Spring Boot org.springframework.boot spring-boot-starter-parent 1.5.6.RELEASE UTF-8 UTF-8 1.9 1.9 1.9 9 org.springframework.boot spring-boot-starter-actuator org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-devtools runtime org.postgresql postgresql runtime org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-maven-plugin build-info ${project.build.sourceEncoding} ${project.reporting.outputEncoding} ${maven.compiler.source} ${maven.compiler.target} org.apache.maven.plugins maven-compiler-plugin 3.6.0 org.apache.maven.plugins maven-toolchains-plugin […]

Heroku / Play / BoneCp连接问题

我在heroku上有一个使用游戏的应用程序。 它工作时间最长,但最近我开始得到这个: Caused by: java.sql.SQLException: Timed out waiting for a free available connection. at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:169) ~[hibernate-core-4.1.9.Final.jar:4.1.9.Final] at com.jolbox.bonecp.BoneCP.getConnection(BoneCP.java:503) ~[bonecp-0.7.1.RELEASE.jar:0.7.1.RELEASE] 这是由 org.postgresql.util.PSQLException: FATAL: too many connections for role “ejmatdbwywaugk” 现在这显然是一个连接泄漏,除了我正在使用JPA.em()。 Play示例永远不会关闭像这样获得的实体管理器。 我尝试关闭它,但随后应用程序爆炸说实体经理已经关闭。 有任何想法吗?