Can not add additional datastore

I have a working Flow UI 1.5.0 project with additional datastore:

main.datasource.url = jdbc:postgresql://localhost/sync
main.datasource.username = postgres
main.datasource.password =password
main.liquibase.change-log=com/company/sync/liquibase/changelog.xml
termo.datasource.url=jdbc:firebirdsql://termohost:3050/termo?charSet=utf-8
termo.datasource.username=sysdba
termo.datasource.password=password
termo.liquibase.change-log=com/company/sync/liquibase/termo-changelog.xml
jmix.data.dbmsType_termo = firebird
jmix.core.additional-stores=termo

I need to add another additional PostgreSQL datastore, but got an error:

java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at com.haulmont.jmixstudio.backend.ed.DataStoreWriter.getDriverDependency(DataStoreWriter.java:92)
	at com.haulmont.jmixstudio.backend.ed.DataStoreWriter.lambda$getDriversForDataStores$5(DataStoreWriter.java:86)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
	at one.util.streamex.TailConcatSpliterator.forEachRemaining(TailConcatSpliterator.java:75)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at one.util.streamex.AbstractStreamEx.forEach(AbstractStreamEx.java:360)
	at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:276)
	at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682)
	at one.util.streamex.AbstractStreamEx.rawCollect(AbstractStreamEx.java:109)
	at one.util.streamex.AbstractStreamEx.toMutableSet(AbstractStreamEx.java:1413)
	at one.util.streamex.AbstractStreamEx.toSet(AbstractStreamEx.java:1395)
	at com.haulmont.jmixstudio.backend.ed.DataStoreWriter.getDriversForDataStores(DataStoreWriter.java:87)
	at com.haulmont.jmixstudio.backend.ed.DataStoreWriter.updateDriverDependencies(DataStoreWriter.java:40)
	at com.haulmont.jmixstudio.backend.ed.DataStoreManager.lambda$editAdditionalDataStore$2(DataStoreManager.java:198)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$1(WriteCommandAction.java:150)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:980)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.lambda$doRunWriteCommandAction$2(WriteCommandAction.java:148)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:219)
	at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:184)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.doRunWriteCommandAction(WriteCommandAction.java:157)
	at com.intellij.openapi.command.WriteCommandAction$BuilderImpl.run(WriteCommandAction.java:124)
	at com.haulmont.jmixstudio.backend.ed.DataStoreManager.editAdditionalDataStore(DataStoreManager.java:179)
	at com.haulmont.jmixstudio.intellij.action.cubamenu.CreateAdditionalDataStoreProcess.run(CreateAdditionalDataStoreProcess.kt:17)
	at com.haulmont.jmixstudio.intellij.action.cubamenu.CreateAdditionalDsAction.doActionPerformed(CreateAdditionalDsAction.java:74)
	at com.haulmont.jmixstudio.intellij.action.JmixProjectAction.actionPerformed(JmixProjectAction.java:110)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:327)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:306)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:350)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:306)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$performAction$5(ActionMenuItem.java:296)
	at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:226)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.performAction(ActionMenuItem.java:289)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$new$0(ActionMenuItem.java:64)
	at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$4(ActionMenuItem.java:111)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:94)
	at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111)
	at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:526)
	at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:558)
	at java.desktop/java.awt.Component.processMouseEvent(Component.java:6648)
	at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3392)
	at java.desktop/java.awt.Component.processEvent(Component.java:6413)
	at java.desktop/java.awt.Container.processEvent(Container.java:2266)
	at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5022)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
	at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
	at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
	at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
	at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2802)
	at java.desktop/java.awt.Component.dispatchEvent(Component.java:4854)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)

Hi Serg,

Thank you for the bugreport!
Created issue: https://youtrack.jmix.io/issue/JST-3774/ArrayIndexOutOfBoundsException-when-adding-a-data-store-to-project-with-unsupported-database

Hi, i’m having the same issue in jmix 2.1

Have you tried this experimental feature: Connecting to Unsupported Databases?

Hi @krivopustov. I haven’t because it is a postgresql database I was adding as an additional data store.

The setup i’m using:
IntelliJ IDEA 2023.3.2 (Community Edition)
Java 17
Postgresql 13
Jmix 2.1.1, also tried the same with the recent 2.1.2-233 update and it is throwing the same error.

The error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘prueba01EntityManagerFactory’ defined in class path resource [com/rsoftr/myapp/Prueba01StoreConfiguration.class]: Index 0 out of bounds for length 0
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1158) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) ~[spring-boot-3.1.4.jar:3.1.4]
at com.rsoftr.myapp.MyAppApplication.main(MyAppApplication.java:33) ~[main/:na]
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[na:na]
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[na:na]
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[na:na]

So now i’ve tried it with a fresh project.

the main data store is hsqldb as well as the second one.

I’m getting the same error. Maybe i’m missing any additional steps?

06:45:25: Executing ‘bootRun’…

Starting Gradle Daemon…
Gradle Daemon started in 1 s 707 ms

Task :bootBuildInfo
Task :compileJava UP-TO-DATE
Task :vaadinPrepareFrontend
Task :processResources UP-TO-DATE
Task :classes
Task :resolveMainClassName

Task :bootRun
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts

. ____ _ __ _ _
/\ / __ _ () __ __ _ \ \ \
( ( )_
_ | '_ | '| | ’ / ` | \ \ \
\/ )| |)| | | | | || (| | ) ) ) )
’ |
| .__|| ||| |_, | / / / /
=========|
|==============|/=////
:: Spring Boot :: (v3.1.4)

2023-12-29T06:45:40.236-03:00 INFO 82966 — [ main] com.company.testprj.TestprjApplication : Starting TestprjApplication using Java 17.0.9 with PID 82966 (/Users/ronald/Downloads/jmix-enterprise-trial/testprj/build/classes/java/main started by ronald in /Users/ronald/Downloads/jmix-enterprise-trial/testprj)
2023-12-29T06:45:40.242-03:00 INFO 82966 — [ main] com.company.testprj.TestprjApplication : No active profile set, falling back to 1 default profile: “default”
2023-12-29T06:45:42.011-03:00 INFO 82966 — [ 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.datatools, io.jmix.gridexportflowui, io.jmix.datatoolsflowui, io.jmix.eclipselink, io.jmix.flowuidata, io.jmix.localfs, io.jmix.securitydata, com.company.testprj]
2023-12-29T06:45:42.483-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.core.impl.ManagedResourceAspect
2023-12-29T06:45:43.003-03:00 INFO 82966 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2023-12-29T06:45:43.013-03:00 INFO 82966 — [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2023-12-29T06:45:43.013-03:00 INFO 82966 — [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.13]
2023-12-29T06:45:43.139-03:00 INFO 82966 — [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2023-12-29T06:45:43.141-03:00 INFO 82966 — [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2600 ms
Standard Commons Logging discovery in action with spring-jcl: please remove commons-logging.jar from classpath in order to avoid potential conflicts
2023-12-29T06:45:43.266-03:00 INFO 82966 — [ main] i.j.c.i.s.JmixModulesClasspathScanner : Classpath scan completed in 75 ms
2023-12-29T06:45:43.290-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.core.CoreProperties
2023-12-29T06:45:43.318-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.core.CoreProperties$PessimisticLock
2023-12-29T06:45:43.469-03:00 INFO 82966 — [ main] io.jmix.core.impl.MetadataLoader : Metadata initialized in 57 ms
2023-12-29T06:45:43.574-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.data.DataProperties
2023-12-29T06:45:43.660-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.core.session.SessionProperties
2023-12-29T06:45:43.667-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.core.rememberme.RememberMeProperties
2023-12-29T06:45:43.848-03:00 WARN 82966 — [ main] ocalVariableTableParameterNameDiscoverer : Using deprecated ‘-debug’ fallback for parameter name resolution. Compile the affected code with ‘-parameters’ instead or avoid its introspection: io.jmix.security.SecurityProperties
2023-12-29T06:45:43.988-03:00 INFO 82966 — [ main] c.v.f.s.VaadinServletContextInitializer : Search for VaadinAppShell took 28 ms
2023-12-29T06:45:47.262-03:00 INFO 82966 — [ main] c.v.f.s.VaadinServletContextInitializer : Search for subclasses and classes with annotations took 3211 ms
2023-12-29T06:45:47.311-03:00 INFO 82966 — [ main] c.v.b.d.startup.DevModeStartupListener : Starting dev-mode updaters in /Users/ronald/Downloads/jmix-enterprise-trial/testprj folder.
2023-12-29T06:45:47.356-03:00 INFO 82966 — [ main] c.v.f.s.f.s.FullDependenciesScanner : Visited 155 classes. Took 35 ms.
2023-12-29T06:45:47.357-03:00 INFO 82966 — [ main] c.v.f.s.frontend.BundleValidationUtil : Checking if a development mode bundle build is needed
2023-12-29T06:45:47.600-03:00 INFO 82966 — [ main] c.v.f.s.frontend.BundleValidationUtil : A development mode bundle build is not needed
2023-12-29T06:45:47.669-03:00 INFO 82966 — [onPool-worker-1] c.v.f.s.frontend.TaskCopyFrontendFiles : Copying frontend resources from jar files …
2023-12-29T06:45:47.706-03:00 INFO 82966 — [onPool-worker-1] c.v.f.s.frontend.TaskCopyFrontendFiles : Visited 19 resources. Took 36 ms.
Vaadin application has been deployed and started to the context path “/”.
2023-12-29T06:45:47.951-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting…
2023-12-29T06:45:48.165-03:00 INFO 82966 — [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-1 - Driver does not support get/set network timeout for connections. (feature not supported)
2023-12-29T06:45:48.166-03:00 INFO 82966 — [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection org.hsqldb.jdbc.JDBCConnection@58a57b57
2023-12-29T06:45:48.167-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2023-12-29T06:45:48.199-03:00 INFO 82966 — [ main] liquibase.database : Set default schema name to PUBLIC
2023-12-29T06:45:48.729-03:00 INFO 82966 — [ main] liquibase.changelog : Reading resource: com/company/testprj/liquibase/changelog/010-init-user.xml
2023-12-29T06:45:48.844-03:00 INFO 82966 — [ main] liquibase.changelog : Reading from PUBLIC.DATABASECHANGELOG
2023-12-29T06:45:48.850-03:00 INFO 82966 — [ main] liquibase.executor : Changelog query completed.
Database is up to date, no changesets to execute
2023-12-29T06:45:48.991-03:00 WARN 82966 — [ main] i.j.d.i.JmixBaseEntityManagerFactoryBean : Cannot find persistence.xml for ‘test01’ store. Falling back to classpath scan for entity classes.
2023-12-29T06:45:48.996-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Starting…
2023-12-29T06:45:48.997-03:00 INFO 82966 — [ main] com.zaxxer.hikari.pool.PoolBase : HikariPool-2 - Driver does not support get/set network timeout for connections. (feature not supported)
2023-12-29T06:45:48.997-03:00 INFO 82966 — [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-2 - Added connection org.hsqldb.jdbc.JDBCConnection@3224f88d
2023-12-29T06:45:48.998-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Start completed.
2023-12-29T06:45:52.277-03:00 WARN 82966 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘test01EntityManagerFactory’ defined in class path resource [com/company/testprj/Test01StoreConfiguration.class]: Index 0 out of bounds for length 0
2023-12-29T06:45:52.282-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown initiated…
2023-12-29T06:45:52.296-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-2 - Shutdown completed.
2023-12-29T06:45:52.297-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated…
2023-12-29T06:45:52.299-03:00 INFO 82966 — [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2023-12-29T06:45:52.303-03:00 INFO 82966 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2023-12-29T06:45:52.328-03:00 INFO 82966 — [ main] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with ‘debug’ enabled.
2023-12-29T06:45:52.349-03:00 ERROR 82966 — [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘test01EntityManagerFactory’ defined in class path resource [com/company/testprj/Test01StoreConfiguration.class]: Index 0 out of bounds for length 0
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:598) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1158) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.12.jar:6.0.12]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:439) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1309) ~[spring-boot-3.1.4.jar:3.1.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1298) ~[spring-boot-3.1.4.jar:3.1.4]
at com.company.testprj.TestprjApplication.main(TestprjApplication.java:32) ~[main/:na]
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[na:na]
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[na:na]
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[na:na]
at java.base/java.util.Objects.checkIndex(Objects.java:361) ~[na:na]
at java.base/java.util.ArrayList.get(ArrayList.java:427) ~[na:na]
at org.springframework.core.annotation.AnnotationTypeMappings.get(AnnotationTypeMappings.java:159) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.annotation.TypeMappedAnnotation.of(TypeMappedAnnotation.java:618) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.annotation.MergedAnnotation.of(MergedAnnotation.java:612) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.type.classreading.MergedAnnotationReadingVisitor.visitEnd(MergedAnnotationReadingVisitor.java:98) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.asm.ClassReader.readElementValues(ClassReader.java:3010) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.asm.ClassReader.accept(ClassReader.java:610) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.asm.ClassReader.accept(ClassReader.java:426) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:48) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:122) ~[spring-core-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.persistenceunit.PersistenceManagedTypesScanner.scanPackage(PersistenceManagedTypesScanner.java:113) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.persistenceunit.PersistenceManagedTypesScanner.scan(PersistenceManagedTypesScanner.java:90) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.buildDefaultPersistenceUnitInfo(DefaultPersistenceUnitManager.java:537) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.readPersistenceUnitInfos(DefaultPersistenceUnitManager.java:515) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.preparePersistenceUnitInfos(DefaultPersistenceUnitManager.java:445) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.afterPropertiesSet(DefaultPersistenceUnitManager.java:429) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:339) ~[spring-orm-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1817) ~[spring-beans-6.0.12.jar:6.0.12]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1766) ~[spring-beans-6.0.12.jar:6.0.12]
… 16 common frames omitted

Task :bootRun FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:bootRun’.

Process ‘command ‘/Users/ronald/Library/Java/JavaVirtualMachines/azul-17.0.9/Contents/Home/bin/java’’ finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 26s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use ‘–warning-mode all’ to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to Command-Line Interface in the Gradle documentation.
7 actionable tasks: 5 executed, 2 up-to-date
06:45:52: Execution finished ‘bootRun’.

testprj.zip (3.8 MB)
This is the project.

Hi @ronaldsr ,

That’s a different runtime problem, while the topic starter reported about the problem in Studio.

You should create at least one entity belonging to your new data store. The problem will go away.

Thank you @krivopustov i will try by creating a “dummy” entity, since the only requirement is to read from the second data store with native queries and then save it to the main data store.

If you don’t have JPA entities in this data store, better remove the LocalContainerEntityManagerFactoryBean and JpaTransactionManager beans from your data store configuration class. Then you will not need a dummy entity and your application will start a bit faster.

1 Like