Enable DDL Hibernate Validator
We have a project using hibernate/karaf and we are trying to enable javax validation. We added the property to our persistence.xml file. But on the startup of the modules we get the following exception: 2017-05-03 16:10:25,770 | ERROR | aries.jpa.star]) | configadmin | 10 - org.apache.felix.configadmin - 1.8.8 | [org.osgi.service.cm.ManagedService, id=233, bundle=214/mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/2.3.0]: Unexpected problem updating configuration org.apache.aries.jpa.star org.hibernate.cfg.beanvalidation.IntegrationException: Bean Validation provider was not available, but 'ddl' validation was requested at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:104) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_92] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_92] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_92] at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_92] at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:148)[239:org.hibernate.core:4.3.6.Final] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:312)[239:org.hibernate.core:4.3.6.Final] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)[239:org.hibernate.core:4.3.6.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)[240:org.hibernate.entitymanager:4.3.6.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)[240:org.hibernate.entitymanager:4.3.6.Final] at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)[239:org.hibernate.core:4.3.6.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)[240:org.hibernate.entitymanager:4.3.6.Final] at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:112)[241:org.hibernate.osgi:4.3.6.Final] at org.apache.aries.jpa.container.impl.ManagedEMF.createAndPublishEMF(ManagedEMF.java:129)[214:org.apache.aries.jpa.container:2.3.0] at org.apache.aries.jpa.container.impl.ManagedEMF.updated(ManagedEMF.java:125)[214:org.apache.aries.jpa.container:2.3.0] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189)[10:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152)[10:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85)[10:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1444)[10:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1400)[10:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[10:org.apache.felix.configadmin:1.8.8] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[10:org.apache.felix.configadmin:1.8.8] at java.lang.Thread.run(Thread.java:745)[:1.8.0_92] Caused by: org.hibernate.cfg.beanvalidation.IntegrationException: Unable to build the default ValidatorFactory at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:462) at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:97) ... 22 more Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath. at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271) at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:110) at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:459) ... 23 more Karaf is version 4.0.6 and we are using Hibernate Validator 4.3.2.Final. The Is there a standar way to somehow register the hibernate provider to karaf classpath. The hibernate feature is overriden by our feature xml in order to use version 4.3.6 instead of 5.0.3 that is distributed by default with karaf 4.0.6. -- View this message in context: http://karaf.922171.n3.nabble.com/Enable-DDL-Hibernate-Validator-tp4050293.html Sent from the Karaf - User mailing list archive at
hibernate caching
Hi all, I tried to add caching to my persistence layer. I added the following to my persistence.xml: I added the necessary dependencies (test cases all run great), but this configuration doesn't seem to deploy nicely to Karaf (4.1.1). The exception thrown is the following: 2017-05-03 13:03:30,645 | ERROR | atures.logging]) | configadmin | 5 - org.apache.felix.configadmin - 1.8.14 | [org.osgi.service.cm.ManagedService, id=242, bundle=75/mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/2.6.0]: Unexpected problem updating configuration org.apache.aries.jpa.canvas org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.cache.spi.RegionFactory] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:271) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.boot.internal.MetadataBuilderImpl$MetadataBuildingOptionsImpl.(MetadataBuilderImpl.java:663) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.boot.internal.MetadataBuilderImpl.(MetadataBuilderImpl.java:127) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.boot.MetadataSources.getMetadataBuilder(MetadataSources.java:135) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:214) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:177) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:83) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:103) [249:org.hibernate.core:5.2.8.Final] at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:95) [253:org.hibernate.osgi:5.2.8.Final] at org.apache.aries.jpa.container.impl.ManagedEMF.createAndPublishEMF(ManagedEMF.java:129) [75:org.apache.aries.jpa.container:2.6.0] at org.apache.aries.jpa.container.impl.ManagedEMF.updated(ManagedEMF.java:125) [75:org.apache.aries.jpa.container:2.6.0] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1463) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1419) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [5:org.apache.felix.configadmin:1.8.14] at java.lang.Thread.run(Thread.java:745) [?:?] Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.cache.jcache.JCacheRegionFactory] as strategy [org.hibernate.cache.spi.RegionFactory] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.selectStrategyImplementor(StrategySelectorImpl.java:126) ~[?:?] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:194) ~[?:?] at org.hibernate.boot.registry.selector.internal.StrategySelectorImpl.resolveStrategy(StrategySelectorImpl.java:161) ~[?:?] at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:67) ~[?:?] at org.hibernate.cache.internal.RegionFactoryInitiator.initiateService(RegionFactoryInitiator.java:28) ~[?:?] at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259) ~[?:?] Checking for exports: karaf@root()> exports | grep org.hibernate.cache.spi org.hibernate.cache.spi.access │ 5.2.8.Final
Karaf 4.1.1 console issue with list and grep
bundle:list | grep -i "foo " On Mac the space and end quote is auto-completing when I the the first quote. I can't delete the space. So I can't search on "foo bar". Known issue/bug? Does not reproduce on Ubuntu. -- View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-1-1-console-issue-with-list-and-grep-tp4050295.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Karaf 4.1.1 console issue with list and grep
It's not really an auto-completion, as if you hit enter, the final space + quote won't appear in the command. They should appear in grey, and they are a hint that your command is incomplete. Just enter "foo bar" with the quotes and it should be fine. 2017-05-03 20:34 GMT+02:00 asookazian2 : > bundle:list | grep -i "foo " > > On Mac the space and end quote is auto-completing when I the the first > quote. I can't delete the space. So I can't search on "foo bar". Known > issue/bug? > > Does not reproduce on Ubuntu. > > > > -- > View this message in context: http://karaf.922171.n3.nabble. > com/Karaf-4-1-1-console-issue-with-list-and-grep-tp4050295.html > Sent from the Karaf - User mailing list archive at Nabble.com. > -- Guillaume Nodet
Re: hibernate caching
Quick update Adding the following to my dao-api/pom.xml file: org.hibernate.proxy,org.ehcache.jsr107,org.hibernate.cache.jcache,javassist.util.proxy,* I get the following at startup: 2017-05-03 15:21:08,067 | ERROR | pache.cxf.osgi]) | configadmin | 5 - org.apache.felix.configadmin - 1.8.14 | [org.osgi.service.cm.ManagedService, id=236, bundle=73/mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/2.6.1]: Unexpected problem updating configuration org.apache.aries.jpa.canvas javax.persistence.PersistenceException: [PersistenceUnit: canvas] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:967) [246:org.hibernate.core:5.2.10.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892) [246:org.hibernate.core:5.2.10.Final] at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:96) [251:org.hibernate.osgi:5.2.10.Final] at org.apache.aries.jpa.container.impl.ManagedEMF.createAndPublishEMF(ManagedEMF.java:129) [73:org.apache.aries.jpa.container:2.6.1] at org.apache.aries.jpa.container.impl.ManagedEMF.updated(ManagedEMF.java:125) [73:org.apache.aries.jpa.container:2.6.1] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1463) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1419) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [5:org.apache.felix.configadmin:1.8.14] at java.lang.Thread.run(Thread.java:745) [?:?] Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:271) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) ~[?:?] at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(SessionFactoryServiceRegistryImpl.java:77) ~[?:?] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:240) ~[?:?] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:452) ~[?:?] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889) ~[?:?] ... 11 more Caused by: javax.cache.CacheException: Failed to load the CachingProvider [org.ehcache.jsr107.EhcacheCachingProvider] at javax.cache.Caching$CachingProviderRegistry.loadCachingProvider(Caching.java:169) ~[?:?] at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:184) ~[?:?] at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:156) ~[?:?] at javax.cache.Caching.getCachingProvider(Caching.java:66) ~[?:?] at org.hibernate.cache.jcache.JCacheRegionFactory.getCachingProvider(JCacheRegionFactory.java:157) ~[?:?] at org.hibernate.cache.jcache.JCacheRegionFactory.getCacheManager(JCacheRegionFactory.java:166) ~[?:?] at org.hibernate.cache.jcache.JCacheRegionFactory.start(JCacheRegionFactory.java:68) ~[?:?] at org.hibernate.cache.spi.RegionFactory.start(RegionFactory.java:63) ~[?:?] at org.hibernate.internal.CacheImpl.(CacheImpl.java:71) ~[?:?] at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28) ~[?:?] at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20) ~[?:?] at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:58) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233) ~[?:?] at
Re: Karaf 4.1.1 console issue with list and grep
Understood, thx for the clarification. -- View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-1-1-console-issue-with-list-and-grep-tp4050295p4050298.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: hibernate caching
Another quick update... I removed the jsr107 ehcache option & tried out the hibernate ehcache factory. So, the persistence.xml file has the following: And the dao-api/pom.xml had the following Import-Package: org.hibernate.proxy,org.hibernate.cache.ehcache,javassist.util.proxy,* This works, but the log has a bunch of warnings, "Could not find a specific ehcache configuration for cache named". I can live with the warnings for now. On 05/03/2017 03:32 PM, Jason Reilly wrote: Quick update Adding the following to my dao-api/pom.xml file: org.hibernate.proxy,org.ehcache.jsr107,org.hibernate.cache.jcache,javassist.util.proxy,* I get the following at startup: 2017-05-03 15:21:08,067 | ERROR | pache.cxf.osgi]) | configadmin | 5 - org.apache.felix.configadmin - 1.8.14 | [org.osgi.service.cm.ManagedService, id=236, bundle=73/mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/2.6.1]: Unexpected problem updating configuration org.apache.aries.jpa.canvas javax.persistence.PersistenceException: [PersistenceUnit: canvas] Unable to build Hibernate SessionFactory at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:967) [246:org.hibernate.core:5.2.10.Final] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:892) [246:org.hibernate.core:5.2.10.Final] at org.hibernate.osgi.OsgiPersistenceProvider.createContainerEntityManagerFactory(OsgiPersistenceProvider.java:96) [251:org.hibernate.osgi:5.2.10.Final] at org.apache.aries.jpa.container.impl.ManagedEMF.createAndPublishEMF(ManagedEMF.java:129) [73:org.apache.aries.jpa.container:2.6.1] at org.apache.aries.jpa.container.impl.ManagedEMF.updated(ManagedEMF.java:125) [73:org.apache.aries.jpa.container:2.6.1] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1463) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1419) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) [5:org.apache.felix.configadmin:1.8.14] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) [5:org.apache.felix.configadmin:1.8.14] at java.lang.Thread.run(Thread.java:745) [?:?] Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.spi.CacheImplementor] at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:271) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233) ~[?:?] at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210) ~[?:?] at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(SessionFactoryServiceRegistryImpl.java:77) ~[?:?] at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:240) ~[?:?] at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:452) ~[?:?] at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:889) ~[?:?] ... 11 more Caused by: javax.cache.CacheException: Failed to load the CachingProvider [org.ehcache.jsr107.EhcacheCachingProvider] at javax.cache.Caching$CachingProviderRegistry.loadCachingProvider(Caching.java:169) ~[?:?] at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:184) ~[?:?] at javax.cache.Caching$CachingProviderRegistry.getCachingProvider(Caching.java:156) ~[?:?] at javax.cache.Caching.getCachingProvider(Caching.java:66) ~[?:?] at org.hibernate.cache.jcache.JCacheRegionFactory.getCachingProvider(JCacheRegionFactory.java:157) ~[?:?] at org.hibernate.cache.jcache.JCacheRegionFactory.getCacheManager(JCacheRegionFactory.java:166) ~[?:?] at org.hibernate.cache.jcache.JCacheRegionFactory.start(JCacheRegionFactory.java:68) ~[?:?] at org.hibernate.cache.spi.RegionFactory.start(RegionFactory.java:63) ~[?:?] at org.hibernate.internal.CacheImpl.(CacheImpl.java:71) ~[?:?] at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheI