簡體   English   中英

Spring 引導戰爭文件 Tomcat 9 部署幫助狀態 500 錯誤

[英]Spring Boot War File Tomcat 9 Deployment Help Status 500 Error

2020 年 8 月 12 日更新約。 上午 11:00 - 我檢查了 tomcat9 ($CATALINA_BASE) 文件夾中的日志文件夾 catalina.2020-08-12.log 日志,發現三個異常“org.apache.catalina.LifecycleException:協議處理程序初始化失敗”、“java .net.BindException:地址已在使用中(綁定失敗)”,“java.lang.IllegalArgumentException:在 HTTP 協議 [HTTP/1.10x0aHost:] 中發現無效字符”。 Here is the full error log here: https://drive.google.com/file/d/1pSk5ESHLIRP5Srxwr4R1Tp_1TTcYMf2Y/view?usp=sharing and https://drive.google.com/file/d/1C-RALR3066_hYKeoo4dIJqTKwNDOQ0R0/view? usp=分享

2020 年 8 月 12 日更新約。 11:30 AM - I found that there are two servlet dispatchers running by checking the localhost.2020-08-12.log log when I restarted tomcat and tried to access my api again: https://drive.google.com/file /d/1GFKUIDLtZrAraHyMjyyWV9kXK33gQ-Mu/view?usp=sharing

2020 年 8 月 12 日更新約。 上午 11:35 - 哈哈哈 我查看了 catalina.out 日志(最后你們中的一些人可能對着屏幕大喊“檢查 CATALINA.OUT 文件”)。 我檢查了一下,發現異常:“java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required”: https://drive.google.com/file/d/1A7ZLh70IHOmWXfQ56bgtq951EE_AX68P/view?usp=sharing Now if I go to my PostgresDataSource class which is where my Hikari config is: https://drive.google.com/file/d/1lYN1dTqiAM4ZqliRGC5J5_VWhNeN-k2d/view?usp=sharing , and I review my application.yaml file from earlier : https://drive.google.com/file/d/1xvPhPneVjMU4BoN6F0Q63l2wCnF20BYq/view?usp=sharing , the jdbc url is present because it is the same one I used for developing. 現在 postgres 已經設置好了,我在 ubuntu 液滴上手動創建了所有表。 我還沒有下載 tomcat 的 jdbc postgresql 驅動程序。

2020 年 8 月 12 日更新約。 1:20 PM - 現在設置 jdbc 驅動程序后,我從 catalina.out 日志中收到此錯誤:“無法獲取 jdbcUrl=java:/comp/env/jdbc:postgresql://localhost:5432/** 的驅動程序實例**”,然后我得到“原因:java.sql.SQLException:沒有合適的驅動程序”。 I used the postgresql section of this link to set it up: https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html .

嗨,我正在使用帶有 apache tomcat 9 的 Digital Ocean 來部署使用 IntelliJ 生成的戰爭文件。 I have the war file generated using mvn clean install and I get the default tomcat page when I go to the droplet IP address on port 8080. I am not sure why I get a 500 error with no stack trace information even though my spring boot application當我在 IntelliJ 中運行它時工作正常。 當我對托管應用程序進行 go 時,我的 CSS 樣式也沒有顯示我試圖在我的 application.yml 文件中配置一些東西,但它仍然不起作用。 我認為這可能與 CORS 的 spring 安全問題有關,但我在該領域的知識不足,無法確定。 我使用 sudo $CATALINA_HOME/bin/startup.sh 啟動了我的服務器,它說 tomcat 已啟動,當我在瀏覽器中訪問時它顯示默認的 tomcat 頁面。 我在我的目標文件夾中使用了 hobynapi.war 文件 我的目標文件夾目錄的圖片可以在這里查看https://drive.google.com/file/d/1XXga1Bgf5-_81gceuWjpvVIX6J0jiNgQ/view?usp=sharing 我將使用 mvn clean install 后生成的 war 文件復制到 /var/lib/tomcat9/webapps 文件夾。 然后我再次運行 sudo $CATALINA_HOME/bin/startup.sh 並再次成功運行 tomcat 。 然后,當我嘗試使用具有 spring 安全基本身份驗證的管理員帳戶登錄時,錯誤發生了,我得到了 500 錯誤。 如果這意味着什么,我在項目結構設置的工件部分也沒有工件。

2020 年 8 月 12 日更新約。 上午 10:00 - 我刪除了 pom.xml 文件中的排除標記以及文件底部的配置文件標記。 這是因為我在這里讀到使用 spring-boot-starter-tomcat 依賴項會為您刪除嵌入式服務器: https://developer.okta.com/blog/2019/04/16/spring-boot-tomcat

這是沒有應該存在的 CSS 樣式的屏幕:

https://drive.google.com/file/d/1CEKuB556ek8pTZspvprNTa9M5XCI7qtT/view?usp=sharing

這是我在沒有堆棧跟蹤的情況下得到的錯誤:

https://drive.google.com/file/d/19gYGQFhZdZ_4IwwGE5tQzb4dTqlBpg9L/view?usp=sharing

這些是我的 pom.xml 文件的圖片:

https://drive.google.com/file/d/1ir5uBuBuJqCb_U8Jarly9mraO468QA_y/view?usp=sharing https://drive.google.com/file/d/1ma1_EPro4NvJiOy8lWPrAmGLMrVWHZPS/view?usp=sharing https://drive.google. com/file/d/11NDIwA9g02zkCKnsmYSLSNF5R-BrFpgt/view?usp=sharing https://drive.google.com/file/d/1p6T9-oOwyfj7NUsLxTRLtqXKHU4qHrZx/view?usp=sharing https://drive.google.com/file/ d/1spD7KT-3WBo7KFF0Hb_WgJ5dVKRHF-un/view?usp=sharing https://drive.google.com/file/d/16QtJQtT9zaU7nGcpnm2KXJ6jiLywNt5s/view?usp=sharing https://drive.google.com/file/d/1cnZJshFS5xW- HbeaH_C_e6KcDo9xYRdY/view?usp=sharing

這是我的 application.yml 文件:

https://drive.google.com/file/d/1xvPhPneVjMU4BoN6F0Q63l2wCnF20BYq/view?usp=sharing https://drive.google.com/file/d/1B9_5WueRvqQv4ODsJAfbUzGIm-xaaSYV/view?usp=sharing

這是我的主要應用程序 java 文件:

https://drive.google.com/file/d/1K9lzzlzIKT8irqXsPY1WeiBvN-9vsoWT/view?usp=sharing

這是我的配置 package 中的 web 配置文件:

https://drive.google.com/file/d/19EYa2kkqqPu9Wh8nN-U02szSVBT30lOP/view?usp=sharing https://drive.google.com/file/d/11Zw8dLrAu6c_OI29j0NsljvXdeDam0-t/view?usp=sharing

這是我的配置 package 中的 spring 安全配置文件:

https://drive.google.com/file/d/1inqlTjfxahcF6ZeJ_xkJM18UgsDu119n/view?usp=sharing https://drive.google.com/file/d/1nTeYiKhiNOH71Km-s_T4IT1BKRyJG4mS/view?usp=sharing

我希望這些圖片有助於診斷問題。

我想到了。 First I changed the postgres jdbc url back to the original one that I had and then I altered my data source config file to the following: https://drive.google.com/file/d/1Zmv8cfnVzW8NcQfjNxN14D4aKFaXpdfU/view?usp=sharing . 我還搞砸的一件重要事情是在下載 postgresql 時沒有為默認用戶“postgres”設置密碼。 我這樣做了我的電話“ALTER USER postgres PASSWORD 'myPassword';” 在 postgresql 命令行中。 還要確保在 postgresql 命令行中對 postgresql 進行任何更改后使用 systemctl restart postgresql。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM