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-url]/#/load-factory?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-mysql/devfile.yamlmaven build taskrun webapp taskWebapp should connect to database as expected
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: https://github.com/eclipse/che/issues/13416
Putting P1 as this affect the default stacks we are embedding
I'm getting this error https://gist.github.com/sparkoo/37d1f38811a24507ddf119f00bfa044d
@sparkoo could you please clarify when did you get that error. Is it still reproducible with this PR: https://github.com/eclipse/che-devfile-registry/pull/51?
@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.
@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 https://github.com/eclipse/che-devfile-registry/pull/51#pullrequestreview-266609816.
I've just checked and everything works fine.

I'm going to close this issue since https://github.com/eclipse/che-devfile-registry/pull/51 was merged.
@svor I've tested again. It works on minishift, but is still failing on minikube for me. How do you run Che here?
@sparkoo I tested it on minishift
@sparkoo I'm going to check it on minikube
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