You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to configure hibernate-orm as persistence store to InfiniSpan cache. Below is the configuration of Hibernate ORM in application.properties: quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:file:/path/to/db;DATABASE_TO_UPPER=false quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create
And InfiniSpan CacheManager:
GlobalConfigurationBuilder globalConfigBuilder = GlobalConfigurationBuilder.defaultClusteredBuilder(); globalConfigBuilder.transport().clusterName("AetherInfini"); DefaultCacheManager cacheManager = new DefaultCacheManager(globalConfigBuilder.build());
It ran into an NPE: ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.NullPointerException at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(FastBootHibernatePersistenceProvider.java:165) at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:61) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at org.infinispan.persistence.jpa.impl.EntityManagerFactoryRegistry.createEntityManagerFactory(EntityManagerFactoryRegistry.java:89) at org.infinispan.persistence.jpa.impl.EntityManagerFactoryRegistry.getEntityManagerFactory(EntityManagerFactoryRegistry.java:28) at org.infinispan.persistence.jpa.JpaStore.start(JpaStore.java:100) at org.infinispan.persistence.support.NonBlockingStoreAdapter.lambda$start$0(NonBlockingStoreAdapter.java:108) at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452) at java.base/java.lang.Thread.run(Thread.java:829)
Can someone tell me what is wrong or point me to related documents? Thank you.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to configure hibernate-orm as persistence store to InfiniSpan cache. Below is the configuration of Hibernate ORM in application.properties:
quarkus.datasource.db-kind=h2 quarkus.datasource.jdbc.url=jdbc:h2:file:/path/to/db;DATABASE_TO_UPPER=false quarkus.hibernate-orm.dialect=org.hibernate.dialect.H2Dialect quarkus.hibernate-orm.database.generation=drop-and-create
And InfiniSpan CacheManager:
GlobalConfigurationBuilder globalConfigBuilder = GlobalConfigurationBuilder.defaultClusteredBuilder(); globalConfigBuilder.transport().clusterName("AetherInfini"); DefaultCacheManager cacheManager = new DefaultCacheManager(globalConfigBuilder.build());
Cache configuration:
ConfigurationBuilder cacheConfigBuilder = new ConfigurationBuilder(); cacheConfigBuilder .clustering() .cacheMode(CacheMode.REPL_ASYNC) .persistence() .addStore(JpaStoreConfigurationBuilder.class) .persistenceUnitName("<default>") .entityClass(MyClass.class) .segmented(false); cacheManager.defineConfiguration("my-name", cacheConfigBuilder.build());
It ran into an NPE:
ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.NullPointerException at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(FastBootHibernatePersistenceProvider.java:165) at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:61) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at org.infinispan.persistence.jpa.impl.EntityManagerFactoryRegistry.createEntityManagerFactory(EntityManagerFactoryRegistry.java:89) at org.infinispan.persistence.jpa.impl.EntityManagerFactoryRegistry.getEntityManagerFactory(EntityManagerFactoryRegistry.java:28) at org.infinispan.persistence.jpa.JpaStore.start(JpaStore.java:100) at org.infinispan.persistence.support.NonBlockingStoreAdapter.lambda$start$0(NonBlockingStoreAdapter.java:108) at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736) at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452) at java.base/java.lang.Thread.run(Thread.java:829)
Can someone tell me what is wrong or point me to related documents? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions