为什么将gradle应用程序推送到heroku时会出现java.rmi.server.ExportException问题?

问题描述

好的,这是我的问题 我有这个gradle项目,我想在heroku上运行。每当我使用heroku local时,它都能正常工作,但是,每当我尝试通过heroku restart运行它并远程运行时,都会出现以下错误

sun.management.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use (Bind failed)

这是我的build.gradle文件

plugins {
    id 'java'
    id 'application'
}

mainClassName = 'bot/Main'
group 'org.hirshi001'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    compile 'net.dv8tion:JDA:4.1.1_140'
    compile 'org.mongodb:mongodb-driver-sync:4.0.5'
    compile 'com.googlecode.json-simple:json-simple:1.1.1'
}

/*
task stage {
    dependsOn installDist
}
 */


jar {
    manifest {
        attributes(
                'Main-Class': 'bot.Main'
        )
    }
}


task stage(dependsOn: ['build','clean'],group: 'build') {
    finalizedBy('installDist')
}

tasks.findByName("build")?.mustRunAfter('clean')

installDist {
    destinationDir file("$rootProject.buildDir/run")
}

还有我的Procfile(我不认为此命令是必需的,但是在线消息来源之一说这可能有效,但没有:./gradlew clean --no-daemon)

worker: ./gradlew clean --no-daemon; ./gradlew run --stacktrace

我尝试过在线搜索,但是他们都在谈论如何在本地解决问题,而且这些方法都无效。

那我该如何在没有错误的情况下将我的仓库回购至heroku?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)