[devworkspace] java-spring-petclinic sample cannot connect to mysql database, running in the separate container #20787
Labels
area/devfile-spec
Issues related to Devfile v2
area/samples
kind/bug
Outline of a bug - must adhere to the bug report template.
severity/P2
Has a minor but important impact to the usage or development of the system.
sprint/current
Milestone
Describe the bug
Java-Mysql sample does not work in devworkspace.
The sample tries to connect to mysql by uri
jdbc:mysql://localhost/petclinic
, but seems the host with mysql is not recognized as localhost.The same sample works fine on local minikube deployment (and on other dev clusters).
Che version
7.39@latest
Steps to reproduce
On devworkspace:
/projects/java-spring-petclinic/src/main/resources/db/mysql/data.sql
, go to first row for tableowners
and replace values ontest
(screenshot 1)My Workspace
view on the right and runprepare-database
commandbuild
command fromMy Workspace
view or by opening a terminal intools
container and launchingmvn clean install
mvn spring-boot:run -Dspring-boot.run.profiles=mysql
command to run the samleCheck the output, be sure
mysql
profile is using (screenshot 2)com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
(screenshot 3)
Expected behavior
Running sample as on screenshot 4.
Runtime
minikube
Screenshots
screenshot 1
screenshot 2
screenshot 3
screenshot 4 (working sample, workspace was created using devfile v1)
Installation method
chectl/next
Environment
Linux
Eclipse Che Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: