Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java-MySQL devfile built app does not work #13938

Closed
1 of 3 tasks
amisevsk opened this issue Jul 20, 2019 · 12 comments
Closed
1 of 3 tasks

Java-MySQL devfile built app does not work #13938

amisevsk opened this issue Jul 20, 2019 · 12 comments
Assignees
Labels
area/languages Issues related to Language extensions or plugins integration. kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. status/in-progress This issue has been taken by an engineer and is under active development.
Milestone

Comments

@amisevsk
Copy link
Contributor

Describe the bug

The current java-mysql devfile and sample project build and run successfully, but on attempting to do any database operations in the app, an exception is thrown:

2019-07-20 01:40:58.181 ERROR 274 --- [nio-8080-exec-4] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet] with root cause

java.sql.SQLSyntaxErrorException: Table 'petclinic.owners' doesn't exist
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) ~[mysql-connector-java-8.0.16.jar!/:8.0.16]
        at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) ~[mysql-connector-java-8.0.16.jar!/:8.0.16]
        at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) ~[mysql-connector-java-8.0.16.jar!/:8.0.16]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955) ~[mysql-connector-java-8.0.16.jar!/:8.0.16]
        at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1005) ~[mysql-connector-java-8.0.16.jar!/:8.0.16]
        at 
[...]

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Create workspace: [che-url]/#/load-factory?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-mysql/devfile.yaml
  2. Use the maven build task
  3. Use the run webapp task
  4. Navigate to e.g. "Find owners" and attempt to "find" an owner

Expected behavior

Webapp should connect to database as expected

Additional context

@l0rd l0rd added this to the 7.0.0 milestone Jul 22, 2019
@l0rd l0rd added kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. area/languages Issues related to Language extensions or plugins integration. labels Jul 22, 2019
@l0rd l0rd assigned l0rd and tsmaeder and unassigned l0rd Jul 22, 2019
@l0rd l0rd added severity/P2 Has a minor but important impact to the usage or development of the system. and removed severity/P1 Has a major impact to usage or development of the system. labels Jul 23, 2019
@svor
Copy link
Contributor

svor commented Jul 24, 2019

The problem is that the "petclinic" database has to be exist with all tables for the app to work but it doesn't. To create it I added a new command to execute sql script (the script is already prepared in the project) which creates "petclinic" database and all necessary tables, but I got a problem when tried to execute mysql command in mysql container, the problem is described here: #13416

@tsmaeder tsmaeder assigned svor and unassigned tsmaeder Jul 24, 2019
@tsmaeder tsmaeder added the status/in-progress This issue has been taken by an engineer and is under active development. label Jul 24, 2019
@slemeur slemeur added severity/P1 Has a major impact to usage or development of the system. and removed severity/P2 Has a minor but important impact to the usage or development of the system. labels Jul 24, 2019
@slemeur
Copy link
Contributor

slemeur commented Jul 24, 2019

Putting P1 as this affect the default stacks we are embedding

@sparkoo
Copy link
Member

sparkoo commented Jul 24, 2019

@svor
Copy link
Contributor

svor commented Jul 25, 2019

@sparkoo could you please clarify when did you get that error. Is it still reproducible with this PR: eclipse-che/che-devfile-registry#51?

@sparkoo
Copy link
Member

sparkoo commented Jul 26, 2019

@svor I get this error when running run webapp task. Your PR don't fix it for me. It's the same. I ran prepare database and maven build first.

@svor
Copy link
Contributor

svor commented Jul 26, 2019

@sparkoo I can't reproduce this problem.
As I see @amisevsk also tested this devfile with my changes and he didn't find any problems eclipse-che/che-devfile-registry#51 (review).

@tolusha
Copy link
Contributor

tolusha commented Jul 29, 2019

I've just checked and everything works fine.
Screenshot from 2019-07-29 09-35-15

@svor
Copy link
Contributor

svor commented Jul 29, 2019

I'm going to close this issue since eclipse-che/che-devfile-registry#51 was merged.

@svor svor closed this as completed Jul 29, 2019
@sparkoo
Copy link
Member

sparkoo commented Jul 30, 2019

@svor I've tested again. It works on minishift, but is still failing on minikube for me. How do you run Che here?

@svor
Copy link
Contributor

svor commented Jul 30, 2019

@sparkoo I tested it on minishift

@svor
Copy link
Contributor

svor commented Jul 30, 2019

@sparkoo I'm going to check it on minikube

@svor
Copy link
Contributor

svor commented Jul 30, 2019

It works on Minikube on my side as well: https://youtu.be/vGqQDdcEd5U
Minikube version: v1.2.0
eclipse/che-server:nightly
eclipse/che-theia:7.0.0-next

@tsmaeder tsmaeder mentioned this issue Aug 14, 2019
24 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/languages Issues related to Language extensions or plugins integration. kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system. status/in-progress This issue has been taken by an engineer and is under active development.
Projects
None yet
Development

No branches or pull requests

7 participants