title: @Autowired lateinit property '' has not been initialized
body: <p>I'm trying to create a web project using Spring-boot + Vaadin and i want to use spring-data-jpa with hibernate to fetch the data from PostgreSQL database.</p>
  
  <p>In my Vaadin's view i try to autowire my service class but i always get null and eror stack trace doesn't tell me why.</p>
  
  <blockquote>
    <p>kotlin.UninitializedPropertyAccessException: lateinit property
    clientService has not been initialized    at
    com.apache.vaadin.view.Index.getClientService(Index.kt:24)
    ~[classes/:na]    at
    com.apache.vaadin.view.Index$readButton$1.buttonClick(Index.kt:40)
    ~[classes/:na]    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method) ~[na:1.8.0_131]   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    ~[na:1.8.0_131]   at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    ~[na:1.8.0_131]   at java.lang.reflect.Method.invoke(Method.java:498)
    ~[na:1.8.0_131]   at
    com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.event.EventRouter.fireEvent(EventRouter.java:211)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.event.EventRouter.fireEvent(EventRouter.java:174)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1029)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.ui.Button.fireClick(Button.java:370)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.ui.Button$1.click(Button.java:57)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ~[na:1.8.0_131]   at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    ~[na:1.8.0_131]   at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    ~[na:1.8.0_131]   at java.lang.reflect.Method.invoke(Method.java:498)
    ~[na:1.8.0_131]   at
    com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:155)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:116)
    ~[vaadin-server-8.0.6.jar:8.0.6]  at
    com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:445)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:410)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1464)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    com.vaadin.server.VaadinServlet.service(VaadinServlet.java:381)
    [vaadin-server-8.0.6.jar:8.0.6]   at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    [tomcat-embed-websocket-8.5.15.jar:8.5.15]    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:105)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    [spring-web-4.3.9.RELEASE.jar:4.3.9.RELEASE]  at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    [na:1.8.0_131]    at
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    [na:1.8.0_131]    at
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    [tomcat-embed-core-8.5.15.jar:8.5.15]     at
    java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]</p>
  </blockquote>
  
  <p>My config for database:</p>
  
  <pre><code>@Configuration
  @EnableTransactionManagement
  @EnableJpaRepositories(basePackages = arrayOf("com.apache.vaadin.model"))
  @ComponentScan(basePackages = arrayOf("com.apache.vaadin.model"))
  open class DataSourceConfig {
      @Autowired
      lateinit var environment: Environment
  
      @Bean
      open fun entityManagerFactory(): LocalContainerEntityManagerFactoryBean {
          var entityManagerFactory: LocalContainerEntityManagerFactoryBean = LocalContainerEntityManagerFactoryBean()
  
          entityManagerFactory.apply {
              dataSource = dataSource()
              setPackagesToScan("com.apache.vaadin.model")
  
              var vendorAdapter: HibernateJpaVendorAdapter = HibernateJpaVendorAdapter()
  
              vendorAdapter.apply {
                  setGenerateDdl(true)
                  setShowSql(true)
              }
  
              var properties: Properties = Properties()
  
              properties.apply {
                  put("database.dialet", "org.hibernate.dialect.PostgreSQL95Dialect")
                  put("database.globally_quoted_identifiers", "false")
                  put("database.enable_lazy_load_no_trans", "true")
                  put("database.show_sql", "true")
              }
  
              jpaVendorAdapter = vendorAdapter
              setJpaProperties(properties)
          }
  
          return entityManagerFactory
      }
  
      @Primary
      @Bean
      open fun dataSource(): DataSource {
          var source: ComboPooledDataSource = ComboPooledDataSource()
  
          source.apply {
              driverClass = "org.postgresql.Driver"
              jdbcUrl = "jdbc:postgresql://localhost:5432/ignite"
              user = "postgres"
              password = "1111"
              acquireIncrement = 5
              idleConnectionTestPeriod = 60
              maxPoolSize = 20
              minPoolSize = 10
              initialPoolSize = 10
          }
  
          return source
      }
  
      @Bean
      open fun transactionManager() : PlatformTransactionManager {
          var manager: JpaTransactionManager = JpaTransactionManager()
  
          manager.apply {
              entityManagerFactory = entityManagerFactory().nativeEntityManagerFactory
          }
  
          return manager
      }
  
      @Bean
      open fun exceptionTranslator(): PersistenceExceptionTranslationPostProcessor  = PersistenceExceptionTranslationPostProcessor()
  }
  </code></pre>
  
  <p>View and UI:</p>
  
  <pre><code>@SpringUI
  @Title(value = "Apache")
  class Navigator : UI() {
      @Autowired
      lateinit var viewProvider: SpringViewProvider
  
      init {
      }
  
      private val INDEX = ""
  
      override fun init(p0: VaadinRequest?) {
          navigator = Navigator(this, this)
          navigator.addProvider(viewProvider)
          navigator.addView(INDEX, Index::class.java)
      }
  }
  
  @UIScope
  @SpringView
  open class Index : VerticalLayout(), View {
      private val logger: Logger = Logger.getLogger(Index::class.java)
  
      @Autowired
      lateinit var clientService: IClientService // &lt;--- error is here
  
      init {
          var menuBar: MenuBar = MenuBar()
          var file = menuBar.addItem("File", null, null)
          file.addItem("Save", {_ -&gt; logger.info("Save clicked")})
          file.addItem("Load", {_ -&gt; logger.info("Load clicked")})
          file.addItem("Open", {_ -&gt; logger.info("Open clicked")})
          file.addItem("Close", {_ -&gt; logger.info("Close clicked")})
  
          var settings = menuBar.addItem("Settings", null, null)
          settings.addItem("DataBase", {_ -&gt; logger.info("DataBase clicked")})
  
          addComponent(menuBar)
  
          var createButton: Button = Button("Create", { _ -&gt; logger.info("Create clicked")})
          var readButton: Button = Button("Read", { _ -&gt; logger.info(clientService.findAll())})
          var updateButton: Button = Button("Update", { _ -&gt; logger.info("Update clicked")})
          var deleteButton: Button = Button("Delete", { _ -&gt; logger.info("Delete clicked")})
  
          addComponent(createButton)
          addComponent(readButton)
          addComponent(updateButton)
          addComponent(deleteButton)
      }
  
      override fun enter(p0: ViewChangeListener.ViewChangeEvent?) {
          Notification.show("Welcome to the main com.ignite.app.view")
      }
  }
  </code></pre>
  
  <p>pom.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.apache.vaadin&lt;/groupId&gt;
      &lt;artifactId&gt;ignite&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;ignite&lt;/name&gt;
      &lt;description&gt;&lt;/description&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;1.5.4.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;vaadin.version&gt;8.0.6&lt;/vaadin.version&gt;
          &lt;kotlin.version&gt;1.1.3-2&lt;/kotlin.version&gt;
          &lt;hibernate&gt;5.2.9.Final&lt;/hibernate&gt;
          &lt;hibernate-validator&gt;5.4.1.Final&lt;/hibernate-validator&gt;
          &lt;postgres&gt;42.1.1&lt;/postgres&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
              &lt;artifactId&gt;vaadin-spring-boot-starter&lt;/artifactId&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-starter-data-jpa&lt;/artifactId&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
              &lt;artifactId&gt;kotlin-stdlib-jre8&lt;/artifactId&gt;
              &lt;version&gt;${kotlin.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
              &lt;artifactId&gt;kotlin-test&lt;/artifactId&gt;
              &lt;version&gt;${kotlin.version}&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-ehcache&lt;/artifactId&gt;
              &lt;version&gt;${hibernate}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-c3p0&lt;/artifactId&gt;
              &lt;version&gt;${hibernate}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-validator&lt;/artifactId&gt;
              &lt;version&gt;${hibernate-validator}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
              &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
              &lt;version&gt;${postgres}&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;com.vaadin&lt;/groupId&gt;
                  &lt;artifactId&gt;vaadin-bom&lt;/artifactId&gt;
                  &lt;version&gt;${vaadin.version}&lt;/version&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
                  &lt;artifactId&gt;kotlin-maven-plugin&lt;/artifactId&gt;
                  &lt;version&gt;${kotlin.version}&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;compile&lt;/id&gt;
                          &lt;phase&gt;compile&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                      &lt;execution&gt;
                          &lt;id&gt;test-compile&lt;/id&gt;
                          &lt;phase&gt;test-compile&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;test-compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
                  &lt;configuration&gt;
                      &lt;jvmTarget&gt;1.8&lt;/jvmTarget&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;compile&lt;/id&gt;
                          &lt;phase&gt;compile&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                      &lt;execution&gt;
                          &lt;id&gt;testCompile&lt;/id&gt;
                          &lt;phase&gt;test-compile&lt;/phase&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;testCompile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>My Service:</p>
  
  <pre><code>@NoRepositoryBean
  interface IClientService : CrudRepository&lt;Client, Long&gt;
  @Service
  class ClientService : IClientService {
      private val logger: Logger = Logger.getLogger(ClientService::class.java)
  
      @Autowired
      lateinit var clientRepository: ClientRepository
  
      override fun delete(p0: Long?) {
          clientRepository.delete(p0)
      }
  
      override fun delete(p0: MutableIterable&lt;Client&gt;?) {
          clientRepository.delete(p0)
      }
  
      override fun delete(p0: Client?) {
          clientRepository.delete(p0)
      }
  
      override fun &lt;S : Client?&gt; save(p0: MutableIterable&lt;S&gt;?): MutableIterable&lt;S&gt; = clientRepository.save(p0)
  
      override fun &lt;S : Client?&gt; save(p0: S): S = clientRepository.save(p0)
  
      override fun findAll(p0: MutableIterable&lt;Long&gt;?): MutableIterable&lt;Client&gt; = clientRepository.findAll(p0)
  
      override fun findAll(): MutableIterable&lt;Client&gt; = clientRepository.findAll()
  
      override fun exists(p0: Long?): Boolean = clientRepository.exists(p0)
  
      override fun findOne(p0: Long?): Client = clientRepository.findOne(p0)
  
      override fun count(): Long = clientRepository.count()
  
      override fun deleteAll() {
          clientRepository.deleteAll()
      }
  }
  </code></pre>
  
  <p>And repository:</p>
  
  <pre><code>@Repository
  interface ClientRepository : CrudRepository&lt;Client, Long&gt;
  </code></pre>
  
  <p>Project compiles correctly, but when i try to get any data from my database i get this error. I also tried to create connection and queries manually and when i did it i didn't get any errors. Probably, the error in the datasource config but i don't see it.</p>
  
  <p>Thank you for your help!</p>
  
  <p><strong>UPDATED</strong>
  Solution:</p>
  
  <pre><code>@SpringUI
  @Title(value = "Apache")
  class Navigator : UI() {
      @Autowired
      lateinit var viewProvider: SpringViewProvider
  
      @Autowired
      lateinit var index: Index// &lt;-
  
      private val INDEX = "index"
  
      override fun init(p0: VaadinRequest?) {
          navigator = Navigator(this, this)
          navigator.addProvider(viewProvider)
          navigator.addView(INDEX, index) // &lt;-
      }
  }
  
  @UIScope
  @SpringView
  @SpringComponent // &lt;-
  open class Index : VerticalLayout(), View {...}
  </code></pre>