[FlowUI] Composite project deployment problem

I am trying to deploy my FlowUI composite project in a Tomcat 9 server followed all the instructions from the user guide but it’s unable to find the suitable driver:

2023-01-30 05:40:14.146  INFO 7600 --- [           main] com.myapp.main.myappApplication      : Starting MyappApplication using Java 11.0.10 on HRIS-TEST with PID 7600 (C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\myapp\WEB-INF\classes started by LOCAL SERVICE in C:\Program Files\Apache Software Foundation\Tomcat 9.0)
2023-01-30 05:40:14.162  INFO 7600 --- [           main] com.myapp.main.myappApplication      : No active profile set, falling back to 1 default profile: "default"
2023-01-30 05:40:18.787  INFO 7600 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Jmix repositories in DEFAULT mode.
2023-01-30 05:40:18.834  INFO 7600 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 36 ms. Found 0 Jmix repository interfaces.
2023-01-30 05:40:19.365  INFO 7600 --- [           main] io.jmix.core.JmixModulesProcessor        : Using Jmix modules: [io.jmix.core, io.jmix.security, io.jmix.flowui, io.jmix.securityflowui, io.jmix.data, io.jmix.eclipselink, com.myapp.md, com.myapp.act, com.myapp.ops, com.myapp.ap, com.myapp.ar, com.myapp.ca, com.myapp.crm, com.myapp.gms, com.myapp.hr, com.myapp.red, com.myapp.sf, io.jmix.datatools, io.jmix.datatoolsflowui, io.jmix.flowuidata, io.jmix.localfs, io.jmix.securitydata, com.myapp.main]
2023-01-30 05:40:20.959  INFO 7600 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 6297 ms
2023-01-30 05:40:22.224  INFO 7600 --- [           main] i.j.c.i.s.JmixModulesClasspathScanner    : Classpath scan completed in 828 ms
2023-01-30 05:40:25.037  INFO 7600 --- [           main] io.jmix.core.impl.MetadataLoader         : Metadata initialized in 2500 ms
2023-01-30 05:40:25.506  WARN 7600 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'io.jmix.security.SecurityConfiguration': Unsatisfied dependency expressed through field 'rememberMeTokenRepository'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'io.jmix.securitydata.SecurityDataConfiguration': Unsatisfied dependency expressed through field 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class
2023-01-30 05:40:25.521  INFO 7600 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-01-30 05:40:25.584 ERROR 7600 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

I
Additional info:
Jamix latest version (1.4.3)
SQL server as database
JDK11
I have put “mssql-jdbc-11.2.3.jre11” to the tomcat lib folder as the application didn’t run after deployment, I have tried it with the same JDBC driver version (10.2.2.jre8) which is used in the studio but having the same error.

This error is not related to FlowUI or availablilty of the JDBC driver. It’s a DataSource configuration problem, see google results for Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

We’ll be able to help you if you provide a test project where the problem is reproduced.

Hi Konstantin
Thank you for providing that info, I tried to do what was suggested in that forum but it’s still the same.

As suggested, I have build a test composite project and could reproduce the issue. The size of the composite project with only a couple of Entities appears to be large and didn’t see the option to create a zip file with only the required files as we can do for a single project. However, here is the google drive link.

Here is other files that I copied into Tomcat server (location as suggested in user guide).
compositetest.xml (460 Bytes)
setenv.sh (45 Bytes)

Hi Mortoza,
Please give me access to this file (knstvk at gmail).

Access given

What is the name of your WAR file?
It must be compositetest.war for compositetest.xml to take effect.

Ok, trying the same name for both war file and xml file defining the database connection which is used in Tomcat. Can the database name be different or it has to be the same (compositetest)?

Yes! that worked perfectly! the database name can be anything which is defined in the XML file and placed inside the tomcat server.

Thank you so much Konstantin.

@Konstantin
While I build the war file, noticed that the war file size is more than 3 times to what it was in CUBA for the same application. Is it because of Flow framework or my composite project is packaging the same library files multiple times or anything wrong?

Not sure. In my test project WAR file is just slightly bigger than from a similar Classic UI project.

Hi @krivopustov
I noticed that my deployed application is not using the JNDI datasource (not using my xml file in tomcat server) where I have put the connection parameters. The application is running but it is using the connection parameters I used in the development environment. Note that I the following profiles:

@Profile("!prod")

and

@Profile("prod")

When I built the war file, I used the following command as suggested:

./gradlew -Pvaadin.productionMode=true bootWar

However, I realized that I didn’t update the application.propertiles file with the following -

spring.profiles.active = prod

though I did the following:
Create tomcat/bin/setenv.sh file with the following content:

CATALINA_OPTS="-Dspring.profiles.active=prod"

Is this the correct way to update the application.propertiles file and is there anything else could be the reason?

Thanks for your suggestions to resolve this.

I’m afraid I cannot suggest anything beyond described in the Using JNDI Data Source section.