第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Heroku 上的 Java Spring MVC 錯誤:無法訪問 jarfile 目標(biāo)/依賴項/

Heroku 上的 Java Spring MVC 錯誤:無法訪問 jarfile 目標(biāo)/依賴項/

BIG陽 2022-01-19 10:37:27
我使用 Heroku 將我的 Spring MVC java 應(yīng)用程序與 PostgreSQL 數(shù)據(jù)庫一起部署。鏈接到數(shù)據(jù)庫工作正常,PostgreSQL 已成功初始化。部署成功,沒有錯誤或奇怪的警告消息,但現(xiàn)在應(yīng)用程序失敗。以下是日志:    heroku[web.1]: State changed from crashed to starting    heroku[web.1]: Starting process with command `java $JAVA_OPTS -Dspring.profiles.active="datajpa,heroku" -DMISIC_ROOT="." -jar target/dependency/webapp-runner.jar --port 28363 target/*.war`    heroku[web.1]: State changed from starting to crashed    heroku[web.1]: Process exited with status 1    app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.    app[web.1]: Error: Unable to access jarfile target/dependency/webapp-runner.jar    heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=misic.herokuapp.com request_id=a242ee89-5594-4f48-9d14-432d46b17600 fwd="178.21.66.110" dyno= connect= service= status=503 bytes= protocol=https我沒有在stackoverflow上找到任何答案,這可以解決我的問題。為什么 Heroku 找不到 webapp-runner.jar,我不知道!在本地主機上一切正常。我的 pom.xml(部分)    <profiles>        <profile>            <id>postgres</id>            <dependencies>                <dependency>                    <groupId>org.postgresql</groupId>                    <artifactId>postgresql</artifactId>                    <version>${postgresql.version}</version>                </dependency>版本 Tomcat:8.5.29檔案:    web: java $JAVA_OPTS -Dspring.profiles.active="datajpa,heroku" -DMISIC_ROOT="." -jar target/dependency/webapp-runner.jar --port $PORT target/*.warGithub 鏈接:https ://github.com/MisicSlavisa/misic我解決了這個問題。出于某種原因,Heroku 不使用文件 settings.xml。當(dāng)我將此文件的內(nèi)容傳輸?shù)?pom.xml 并刪除它時,一切正常。
查看完整描述

3 回答

?
小唯快跑啊

TA貢獻(xiàn)1863條經(jīng)驗 獲得超2個贊

確保你有這樣的東西在你的pom.xml:


        <plugin>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-dependency-plugin</artifactId>

            <executions>

                <execution>

                    <phase>package</phase>

                    <goals><goal>copy</goal></goals>

                    <configuration>

                        <artifactItems>

                            <artifactItem>

                                <groupId>com.github.jsimone</groupId>

                                <artifactId>webapp-runner</artifactId>

                                <version>9.0.13.0</version>

                                <destFileName>webapp-runner.jar</destFileName>

                            </artifactItem>

                        </artifactItems>

                    </configuration>

                </execution>

            </executions>

        </plugin>


查看完整回答
反對 回復(fù) 2022-01-19
?
寶慕林4294392

TA貢獻(xiàn)2021條經(jīng)驗 獲得超8個贊

請參閱我的答案找到 webrunner 所在的文件夾,以便您的 Procfile 找到它。這是我的配置


<build>

        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-compiler-plugin</artifactId>

                <version>2.3.2</version>

                <configuration>

                    <source>1.6</source>

                    <target>1.6</target>

                    <compilerArguments>

                        <endorseddirs>${endorsed.dir}</endorseddirs>

                    </compilerArguments>

                </configuration>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-war-plugin</artifactId>

                <version>2.1.1</version>

                <configuration>

                    <failOnMissingWebXml>false</failOnMissingWebXml>

                </configuration>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-dependency-plugin</artifactId>

                <version>2.1</version>

                <executions>

                    <execution>

                        <phase>validate</phase>

                        <goals>

                            <goal>copy</goal>

                        </goals>

                        <configuration>

                            <outputDirectory>${endorsed.dir}</outputDirectory>

                            <silent>true</silent>

                            <artifactItems>

                                <artifactItem>

                                    <groupId>javax</groupId>

                                    <artifactId>javaee-endorsed-api</artifactId>

                                    <version>6.0</version>

                                    <type>jar</type>

                                </artifactItem>

                            </artifactItems>

                        </configuration>

                    </execution>

                </executions>

            </plugin>

            <plugin>

            <groupId>org.apache.maven.plugins</groupId>

            <artifactId>maven-dependency-plugin</artifactId>

            <executions>

                <execution>

                    <phase>package</phase>

                    <goals><goal>copy</goal></goals>

                    <configuration>

                        <artifactItems>

                            <artifactItem>

                                <groupId>com.github.jsimone</groupId>

                                <artifactId>webapp-runner</artifactId>

                                <version>9.0.24.0</version>

                                <destFileName>webapp-runner.jar</destFileName>

                            </artifactItem>

                        </artifactItems>

                    </configuration>

                </execution>

            </executions>

        </plugin>

        </plugins>

    </build>



查看完整回答
反對 回復(fù) 2022-01-19
?
回首憶惘然

TA貢獻(xiàn)1847條經(jīng)驗 獲得超11個贊

對我來說 1) 我在嘗試設(shè)置 jhipster upp 以通過 git 部署而不是通過 jarfile 時遇到過這種情況。我擁有它是因為 Node.js buildpack 是在 java 之前啟動的,所以我被迫使用heroku:buildpacks add --index 2 heroku/nodejsheroku:buildpacks add --index 1 heroku/java` 來設(shè)置它們,但即使在這個更改之后我仍然有同樣的錯誤。2)然后我意識到我在 pom,xml 中有 jar 包裝,而不是必需的 war 包裝。將此值更改為 pom.xml 對我有幫助。


查看完整回答
反對 回復(fù) 2022-01-19
  • 3 回答
  • 0 關(guān)注
  • 190 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號