title: javax.sql.DataSource-Spring boot
body: <p>I'm a beginner and creating simple spring boot application with pi4j library, but i think have a problem with module-info.java. I don't know what's wrong. Is there a dependencies missing? I've tried different dependencies, changes in module-info.java, but nothing works. Anyone knows what's going on?
  Traceback</p>
  <pre><code>    Java HotSpot(TM) 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
  
    .   ____          _            __ _ _
   /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
  ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
   \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
    '  |____| .__|_| |_|_| |_\__, | / / / /
   =========|_|==============|___/=/_/_/_/
   :: Spring Boot ::                (v2.5.4)
  
  [restartedMain] INFO com.example.myprojectraspi.MyProjectRaspiApplication - Starting MyProjectRaspiApplication using Java 16.0.1 on DESKTOP-KPH6U2Q with PID 13620 (C:\Users\Gwiazdorz\IdeaProjects\MyProjectRaspi\target\classes started by Gwiazdorz in C:\Users\Gwiazdorz\IdeaProjects\MyProjectRaspi)
  [restartedMain] INFO com.example.myprojectraspi.MyProjectRaspiApplication - No active profile set, falling back to default profiles: default
  [restartedMain] INFO org.springframework.boot.devtools.env.DevToolsPropertyDefaultsPostProcessor - Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
  [restartedMain] INFO org.springframework.boot.devtools.env.DevToolsPropertyDefaultsPostProcessor - For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
  [restartedMain] ERROR org.springframework.boot.SpringApplication - Application run failed
  java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.devtools.autoconfigure.DevToolsDataSourceAutoConfiguration due to javax/sql/DataSource not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
      at spring.boot.autoconfigure@2.5.4/org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:54)
      at spring.context@5.3.9/org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
      at spring.context@5.3.9/org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:489)
      at spring.context@5.3.9/org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$TrackedConditionEvaluator.shouldSkip(ConfigurationClassBeanDefinitionReader.java:478)
      at spring.context@5.3.9/org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:140)
      at spring.context@5.3.9/org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:129)
      at spring.context@5.3.9/org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:343)
      at spring.context@5.3.9/org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)
      at spring.context@5.3.9/org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
      at spring.context@5.3.9/org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)
      at spring.context@5.3.9/org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
      at spring.context@5.3.9/org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
      at spring.boot@2.5.4/org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
      at spring.boot@2.5.4/org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
      at spring.boot@2.5.4/org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
      at spring.boot@2.5.4/org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
      at spring.boot@2.5.4/org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
      at spring.boot@2.5.4/org.springframework.boot.SpringApplication.run(SpringApplication.java:1332)
      at MyProjectRaspi/com.example.myprojectraspi.MyProjectRaspiApplication.main(MyProjectRaspiApplication.java:15)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:567)
      at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
  Caused by: java.lang.NoClassDefFoundError: javax/sql/DataSource
      at org.springframework.boot.devtools.autoconfigure.DevToolsDataSourceAutoConfiguration$DevToolsDataSourceCondition.getMatchOutcome(DevToolsDataSourceAutoConfiguration.java:183)
      at spring.boot.autoconfigure@2.5.4/org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
      ... 23 more
  Caused by: java.lang.ClassNotFoundException: javax.sql.DataSource
      at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
      ... 25 more
  </code></pre>
  <p>Module-info.java</p>
  <pre><code>module MyProjectRaspi {
          requires com.pi4j;
          requires com.pi4j.plugin.pigpio;
      
          // SLF4J MODULES
      requires org.slf4j;
      requires org.slf4j.simple;
      requires spring.context;
      requires spring.data.jpa;
      requires spring.web;
      requires java.persistence;
      requires java.transaction;
      requires spring.beans;
      requires spring.boot;
      requires spring.boot.autoconfigure;
      requires spring.security.config;
      requires lombok;
      requires org.hibernate.orm.core;
  
      uses com.pi4j.extension.Extension;
      uses com.pi4j.provider.Provider;
  
      // allow access to classes in the following namespaces for Pi4J annotation processing
      opens com.example.myprojectraspi to com.pi4j;
      exports com.example.myprojectraspi;
  
  }
  </code></pre>
  <p>Pom.xml</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
           xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;2.5.4&lt;/version&gt;
      &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
  &lt;/parent&gt;
  &lt;groupId&gt;com.example&lt;/groupId&gt;
  &lt;artifactId&gt;MyProjectRaspi&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;MyProjectRaspi&lt;/name&gt;
  &lt;description&gt;Demo project for Spring Boot&lt;/description&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;properties&gt;
      &lt;java.version&gt;11&lt;/java.version&gt;
   
      &lt;slf4j.version&gt;2.0.0-alpha0&lt;/slf4j.version&gt;
      &lt;pi4j.version&gt;2.0-SNAPSHOT&lt;/pi4j.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;exec-maven-plugin.version&gt;1.6.0&lt;/exec-maven-plugin.version&gt;
      &lt;maven-compiler-plugin.version&gt;3.8.1&lt;/maven-compiler-plugin.version&gt;
  &lt;/properties&gt;
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;oss-snapshots-repo&lt;/id&gt;
          &lt;name&gt;Sonatype OSS Maven Repository&lt;/name&gt;
          &lt;url&gt;https://oss.sonatype.org/content/groups/public&lt;/url&gt;
          &lt;releases&gt;
              &lt;enabled&gt;false&lt;/enabled&gt;
          &lt;/releases&gt;
          &lt;snapshots&gt;
              &lt;enabled&gt;true&lt;/enabled&gt;
          &lt;/snapshots&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.h2database&lt;/groupId&gt;
          &lt;artifactId&gt;h2&lt;/artifactId&gt;
          &lt;version&gt;1.4.200&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
          &lt;version&gt;${slf4j.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
          &lt;artifactId&gt;slf4j-simple&lt;/artifactId&gt;
          &lt;version&gt;${slf4j.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.pi4j&lt;/groupId&gt;
          &lt;artifactId&gt;pi4j-core&lt;/artifactId&gt;
          &lt;version&gt;${pi4j.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
  
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  
      &lt;artifactId&gt;spring-boot-starter-webflux&lt;/artifactId&gt;
  
  &lt;/dependency&gt;
  
  
  
     
      &lt;dependency&gt;
          &lt;groupId&gt;com.pi4j&lt;/groupId&gt;
          &lt;artifactId&gt;pi4j-plugin-raspberrypi&lt;/artifactId&gt;
          &lt;version&gt;${pi4j.version}&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.pi4j&lt;/groupId&gt;
          &lt;artifactId&gt;pi4j-plugin-pigpio&lt;/artifactId&gt;
          &lt;version&gt;${pi4j.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-devtools&lt;/artifactId&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
          &lt;optional&gt;true&lt;/optional&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;mysql&lt;/groupId&gt;
          &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
          &lt;version&gt;8.0.25&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-data-jpa&lt;/artifactId&gt;
      &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-tomcat&lt;/artifactId&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;javax.xml.bind&lt;/groupId&gt;
      &lt;artifactId&gt;jaxb-api&lt;/artifactId&gt;
      &lt;version&gt;2.3.0&lt;/version&gt;
  &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-core&lt;/artifactId&gt;
          &lt;version&gt;5.5.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.security&lt;/groupId&gt;
          &lt;artifactId&gt;spring-security-test&lt;/artifactId&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-rest-core&lt;/artifactId&gt;
          &lt;version&gt;3.4.8&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  
  &lt;build&gt;
  &lt;finalName&gt;MyProjectRaspiservice&lt;/finalName&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;${maven-compiler-plugin.version}&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;release&gt;${java.version}&lt;/release&gt;
                  &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                  &lt;showWarnings&gt;true&lt;/showWarnings&gt;
                  &lt;verbose&gt;false&lt;/verbose&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
              &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;${exec-maven-plugin.version}&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;java&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
              &lt;configuration&gt;
                  &lt;executable&gt;java&lt;/executable&gt;
                  &lt;arguments&gt;
                      &lt;argument&gt;--module-path&lt;/argument&gt;
                      &lt;argument&gt;${project.build.directory}/distribution&lt;/argument&gt;
                      &lt;argument&gt;--module&lt;/argument&gt;
                      &lt;argument&gt;com.example.myprojectraspi/com.example.myprojectraspi.MyProjectRaspiApplication&lt;/argument&gt;
                  &lt;/arguments&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;excludes&gt;
                      &lt;exclude&gt;
                          &lt;groupId&gt;org.projectlombok&lt;/groupId&gt;
                          &lt;artifactId&gt;lombok&lt;/artifactId&gt;
                      &lt;/exclude&gt;
                  &lt;/excludes&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1.2&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;outputDirectory&gt;${project.build.directory}/distribution&lt;/outputDirectory&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
              &lt;version&gt;1.8&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;configuration&gt;
                          &lt;target&gt;
                              &lt;copy todir=&quot;${project.build.directory}/distribution&quot; overwrite=&quot;true&quot; flatten=&quot;true&quot;&gt;
                                  &lt;fileset dir=&quot;assets&quot; includes=&quot;*.sh&quot; &gt;&lt;/fileset&gt;
                              &lt;/copy&gt;
                              &lt;chmod dir=&quot;${project.build.directory}/distribution&quot; perm=&quot;ugo+rx&quot; includes=&quot;**/*.sh&quot;/&gt;
                          &lt;/target&gt;
                      &lt;/configuration&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;run&lt;/goal&gt;
                      &lt;/goals&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-dependencies&lt;/id&gt;
                      &lt;phase&gt;process-sources&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;outputDirectory&gt;${project.build.directory}/distribution&lt;/outputDirectory&gt;
                          &lt;includeScope&gt;runtime&lt;/includeScope&gt;
                          &lt;excludeTransitive&gt;false&lt;/excludeTransitive&gt;
                          &lt;overWriteReleases&gt;false&lt;/overWriteReleases&gt;
                          &lt;overWriteSnapshots&gt;true&lt;/overWriteSnapshots&gt;
                          &lt;overWriteIfNewer&gt;true&lt;/overWriteIfNewer&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>Application.properties</p>
  <pre><code>spring.jpa.show-sql=true
  spring.jpa.hibernate.ddl-auto=update
  spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
  spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect
  spring.datasource.url=jdbc:mysql://localhost:3306/shades
  spring.datasource.username=root
  spring.datasource.password=root
  server.port=9090
  </code></pre>