Entity class loading issue in karaf OSGI - spring
I am working a project which is using
spring 3.2.5.RELEASE
hibernate 4.2.15.Final
karaf 3.0.x
when i install my custom bundle (contain all entity classes), throwing PersistentClass name cannot be converted into a Class exception
please find below my karaf bundle lists
ID | State | Lvl | Version | Name
-------------------------------------------------------------------------------------
84 | Active | 80 | 2.7.7.5 | Apache ServiceMix :: Bundles :: antlr
85 | Active | 80 | 1.8.2.2 | Apache ServiceMix :: Bundles :: ant
86 | Active | 80 | 1.6.1.5 | Apache ServiceMix :: Bundles :: dom4j
87 | Active | 80 | 1.14.1.1 | Apache ServiceMix :: Bundles :: serp
88 | Active | 80 | 1.1.0 | ClassMate
89 | Active | 80 | 3.18.1.GA | Javassist
90 | Active | 80 | 1.0.2.Final | JACC 1.4 API
91 | Active | 80 | 1.2.2.Final | Java Annotation Indexer
92 | Active | 80 | 3.1.4.GA | JBoss Logging 3
93 | Active | 80 | 4.0.4.Final | hibernate-commons-annotations
94 | Active | 100 | 4.2.15.Final | hibernate-core
95 | Active | 100 | 4.2.15.Final | hibernate-entitymanager
96 | Active | 100 | 4.2.15.Final | hibernate-osgi
294 | Active | 80 | 3.2.5.RELEASE | Spring Context
295 | Active | 80 | 3.2.5.RELEASE | Spring Core
296 | Active | 80 | 3.2.5.RELEASE | Spring Expression Language
297 | Active | 80 | 3.2.5.RELEASE | Spring Transaction
298 | Active | 80 | 1.2.17 | Apache Log4j
299 | Active | 80 | 1.7.5 | slf4j-api, Fragments: 300
300 | Resolved | 80 | 1.7.5 | slf4j-log4j12, Hosts: 299
302 | Active | 80 | 0 | wrap_mvn_org.springframework.amqp_spring-amqp_1.2.2.RELEASE
303 | Active | 80 | 0 | wrap_mvn_org.springframework.amqp_spring-rabbit_1.2.2.RELEASE
304 | Active | 80 | 3.2.5.RELEASE | Spring ORM
305 | Active | 80 | 1.0.0 | AOP Alliance API
306 | Active | 80 | 3.2.5.RELEASE | Spring JDBC
307 | Active | 80 | 8.3.603 | PostgreSQL JDBC3 Driver
308 | Active | 80 | 0.9.1.2 | c3p0 Connection Pool
309 | Active | 80 | 2.0.0 | Java Persistence API
310 | Active | 80 | 0 | wrap_mvn_antlr_antlr_2.7.7
311 | Active | 80 | 3.1.0.GA | JBoss Logging 3
312 | Active | 80 | 0 | wrap_mvn_dom4j_dom4j_1.6.1
313 | Active | 80 | 1.0.1.Final | Java Transaction API
314 | Active | 80 | 0 | wrap_mvn_org.hibernate.javax.persistence_hibernate-jpa-2.0-api_1.0.1.Final
315 | Active | 80 | 4.0.2.Final | Hibernate Commons Annotations
316 | Active | 80 | 3.0.0 | Expression Language 3.0 API
317 | Active | 80 | 1.2 | javax.interceptor API
318 | Active | 80 | 0 | wrap_mvn_javax.inject_javax.inject_1
319 | Active | 80 | 1.2.0 | CDI APIs
320 | Active | 80 | 1.5.3 | Apache Commons Pool
321 | Active | 80 | 1.7.2.RELEASE | AspectJ Runtime
322 | Active | 80 | 1.7.1.RELEASE | AspectJ Weaver
323 | Active | 80 | 1.1.0 | Java Transaction API
324 | Active | 80 | 2.6.0 | Apache Commons Lang
325 | Active | 80 | 1.3.1 | MaxMind GeoIP Legacy API
326 | Active | 80 | 3.2.1 | Apache Commons Collections
327 | Active | 80 | 3.4.0 | Apache Commons Lang
328 | Active | 80 | 2.3.2 | Jackson-annotations
329 | Active | 80 | 0 | wrap_mvn_commons-collections_commons-collections_3.2
330 | Active | 80 | 1.0.1 | soautil
331 | Active | 80 | 0 | wrap_mvn_logkit_logkit_1.0.1
332 | Active | 80 | 0 | wrap_mvn_javax.servlet_servlet-api_2.3
333 | Active | 80 | 0 | wrap_mvn_commons-logging_commons-logging_1.1
334 | Active | 80 | 3.2.5.RELEASE | Spring AOP
335 | Active | 80 | 3.2.5.RELEASE | Spring Beans
336 | Active | 80 | 3.2.5.RELEASE | Spring Web
337 | Active | 80 | 0 | wrap_mvn_org.springframework_spring-remoting_2.0.8
339 | Active | 80 | 1.2.16 | Apache Log4J
340 | Active | 80 | 2.3.18 | Freemarker Templating Engine
341 | Active | 80 | 1.0.1 | utils-spring
342 | Active | 80 | 5.0.0.201203141902 | osgi.core
343 | Active | 80 | 1.2.1 | spring-osgi-io
344 | Active | 80 | 1.2.1 | spring-osgi-core
345 | Active | 80 | 1.2.1 | spring-osgi-extender
346 | Active | 80 | 5.0.0.201305092017 | osgi.cmpn
347 | Active | 80 | 0.5.4 | FasterXML ClassMate
348 | Active | 80 | 1.0.1 | MyServiceBundle
Find below exceptions
2016-03-26 01:04:41,934 | DEBUG | ExtenderThread-2 | OsgiBundleXmlApplicationContext | 294 - org.springframework.context - 3.2.5.RELEASE | Post refresh error
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geoService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.sample.repository.sampleRepository com.sample.impl.GeoServiceImpl.sampleRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleRepository': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:628)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)[294:org.springframework.context:3.2.5.RELEASE]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)[344:org.springframework.osgi.core:1.2.1]
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)[345:org.springframework.osgi.extender:1.2.1]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_71]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.sample.repository.sampleRepository com.sample.impl.GeoServiceImpl.sampleRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleRepository': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)[335:org.springframework.beans:3.2.5.RELEASE]
... 15 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sampleRepository': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:289)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)[335:org.springframework.beans:3.2.5.RELEASE]
... 17 more
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected org.hibernate.SessionFactory com.sample.repository.sampleRepository.sessionFactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:517)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)[335:org.springframework.beans:3.2.5.RELEASE]
... 28 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in URL [bundle://348.0:0/spring-data.xml]: Invocation of init method failed; nested exception is org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:912)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:855)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:770)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)[335:org.springframework.beans:3.2.5.RELEASE]
... 30 more
Caused by: org.hibernate.AssertionFailure: PersistentClass name cannot be converted into a Class
at org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:816)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2097)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:895)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:728)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3568)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3522)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1379)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1784)[94:org.hibernate.core:4.2.15.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1868)[94:org.hibernate.core:4.2.15.Final]
at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:247)[304:org.springframework.orm:3.2.5.RELEASE]
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:373)[304:org.springframework.orm:3.2.5.RELEASE]
at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:358)[304:org.springframework.orm:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)[335:org.springframework.beans:3.2.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)[335:org.springframework.beans:3.2.5.RELEASE]
... 40 more
Caused by: java.lang.ClassNotFoundException: com.sample.model.Country not found by org.hibernate.core [94]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_71]
at java.lang.Class.forName0(Native Method)[:1.7.0_71]
at java.lang.Class.forName(Class.java:274)[:1.7.0_71]
at org.hibernate.annotations.common.util.ReflectHelper.classForName(ReflectHelper.java:60)[93:org.hibernate.common.hibernate-commons-annotations:4.0.4.Final]
at org.hibernate.annotations.common.reflection.java.JavaReflectionManager.classForName(JavaReflectionManager.java:138)[93:org.hibernate.common.hibernate-commons-annotations:4.0.4.Final]
at org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:812)[94:org.hibernate.core:4.2.15.Final]
... 53 more
i guess, entity classes are not scanning properly. This is my configuration
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="hibernateProperties" ref="hibernateProperties"/>
<property name="annotatedClasses">
<list>
<value>com.sample.model.Country</value>
<value>com.sample.model.Location</value>
</list>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
EDITED :
Please find below manifest header entries
Manifest-Version = 1.0
Bnd-LastModified = 1458957186000
Tool = Bnd-2.4.0.201411031534
Spring-Context = /spring.xml
Created-By = 1.7.0_71 (Oracle Corporation)
Bundle-Vendor = demo
Bundle-Name = MyServiceBundle
Bundle-Description = MyService Bundle to create Amqp services
Bundle-SymbolicName = com.sample.MyServiceBundle
Bundle-Version = 1.0.1
Bundle-ManifestVersion = 2
Require-Capability =
osgi.ee;filter:=(&(osgi.ee=JavaSE)(version=1.7))
Import-Package =
com.maxmind.geoip;version="[1.3,2)",
javax.persistence;version="[2.0,3)",
org.hibernate;version="[4.2,5)",
org.hibernate.annotations;version="[4.2,5)",
org.hibernate.criterion;version="[4.2,5)",
org.slf4j;version="[1.7,2)",
org.springframework.beans.factory.annotation;version="[3.2,4)",
org.springframework.context.support;version="[3.2,4)",
org.springframework.stereotype;version="[3.2,4)",
org.springframework.transaction.annotation;version="[3.2,4)",
com.sample.api;version="[1.0,2)",
com.sample.utils.soa.exception;version="[1.0,2)",
org.springframework.amqp.rabbit.core,
org.springframework.orm.hibernate4;version="[3.2,4)",
com.mchange.v2.c3p0;version="[0.9,1)",
org.springframework.aop;version="[3.2,4)",
org.springframework.aop.framework;version="[3.2,4)",
org.springframework.cglib.proxy;version="[3.2,4)",
org.springframework.cglib.core;version="[3.2,4)",
org.aopalliance.aop;version="[1.0,2)",
org.springframework.amqp.rabbit.listener.adapter,
org.springframework.amqp.remoting.service,
com.sample.utils.spring;version="[1.0,2)",
org.springframework.remoting.support;version="[3.2,4)",
org.springframework.amqp.rabbit.transaction,
org.springframework.cglib.reflect;version="[3.2,4)",
org.springframework.jmx.export.annotation;version="[3.2,4)",
org.springframework.amqp.support.converter,
org.springframework.core.type;version="[3.2,4)",
org.springframework.context;version="[3.2,4)",
org.apache.felix.service.command,
org.apache.felix.gogo.commands,
org.apache.karaf.shell.console,
org.apache.karaf.shell.commands,
org.hibernate.cfg;version="[4.2,5)",
org.hibernate.service;version="[4.2,5)",
org.hibernate.proxy;version="[4.2,5)",
javassist.util.proxy;version="[3.18,4)",
com.sample.model;version="[1.0,2)"
Export-Package =
com.sample;uses:=com.sample.utils.soa.exception;version=1.0.1,
com.sample.repository;
uses:="org.hibernate,
org.springframework.beans.factory.annotation,
org.springframework.stereotype,
org.springframework.transaction.annotation,
com.sample.api,
com.sample.model,
com.sample.utils.soa.exception";
version=1.0.1,
com.sample.impl;uses:="org.springframework.stereotype,com.sample.api,com.sample.utils.soa.exception";version=1.0.1,
com.sample.model;uses:=javax.persistence;version=1.0.1
I cannot solve this problem. If anyone get idea please share with me
Thank you,
gopy
Edited : 4-april-2016
Still i am unable to solve .....
Now i upgraded spring to
Apache ServiceMix :: Bundles 4.2.5.RELEASE_1 and
hibernate-core 4.3.6.Final
But again same issue.
Caused by: org.hibernate.AssertionFailure: PersistentClass name cannot
be converted into a Class at
org.hibernate.cfg.BinderHelper.getPropertyOverriddenByMapperOrMapsId(BinderHelper.java:817)
at
org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:2169)
at
org.hibernate.cfg.AnnotationBinder.processIdPropertiesIfNotAlready(AnnotationBinder.java:963)
at
org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:796)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3788)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3742)
at
org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1410)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1844)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1928)
at
org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:372)
at
org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:454)
at
org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:439)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
Same bundle able to deploy in virgo osgi server. So i am sure hibernate configuration is not an issue. Some supporting libs are missing.
If anyone using karaf 3.x with hibernate please share your
bundle:list
i will compare with mine.
thank you in advance.
This seems to be the root cause:
Caused by: java.lang.ClassNotFoundException: com.sample.model.Country not found by org.hibernate.core [94]
Without seeing the manifest, or the output from
karaf> headers $bundleId
there isn't much else to go on.
Most likely, you are missing an Import-Package entry for com.sample.model
Related
Clarification YouTube Data API v3 Quotas
I have a Google project created on the Google developer console. This project retrieves information about all content on my channel (livestreams and posted videos) and keeps statistics updated for each one. The processes that gather this information run three times per day. I would like to run them more frequently, but after a total of 300 quota, I receive the dreaded error 403 that says, The request cannot be completed because you have exceeded your quota Here is a today's usage summary as an example: +------------+---------------------------------------------+------------------------------------+-------+-----------+--------+ | callDate | calledBy | serviceName | calls | totalCost | failed | +------------+---------------------------------------------+------------------------------------+-------+-----------+--------+ | 2022-04-14 | /www/htdocs/GetChats/someoneSingsVideos.php | search->listSearch | 53 | 106 | 3 | | 2022-04-14 | /www/htdocs/GetChats/someoneSingsVideos.php | videos->listVideos | 50 | 50 | NULL | | 2022-04-14 | /www/htdocs/GetChats/lives.php | liveBroadcasts->listLiveBroadcasts | 10 | 10 | NULL | | 2022-04-14 | /www/htdocs/GetChats/videos.php | search->listSearch | 48 | 96 | NULL | | 2022-04-14 | /www/htdocs/GetChats/videos.php | videos->listVideos | 48 | 48 | NULL | | 2022-04-14 | /www/htdocs/GetChats/someoneSingsVideos.php | --program total-- | 103 | 156 | 3 | | 2022-04-14 | /www/htdocs/GetChats/lives.php | --program total-- | 10 | 10 | NULL | | 2022-04-14 | /www/htdocs/GetChats/videos.php | --program total-- | 96 | 144 | NULL | | 2022-04-14 | --day total-- | | 209 | 310 | 3 | +------------+---------------------------------------------+------------------------------------+-------+-----------+--------+ So in essence, I can get about 50 searches and about 100 list calls done in a day... then I have to wait 24 hours to try again. But when I check my quotas and their usage at the IAM Admin Quotas page, I see a very different result: This page, intended to clarify API Quotas and their usage, just adds questions for me. For example, at face value, looks like there is a 10,000 quota-units limit per day but I can do 1.8M per minute. Clearly both cannot be true. But morr to the point, it seems to indicate that i'm way below my legal limit although it issues that error and stops me until the next day, after that 300 quota is reached. Can anyone help me understand what the real limits are, and maybe help me understand why I must keep my usage so low?
SonarQube 4.5 does not populate technical debt with mysql datasource
I mvn sonar:sonar a project and problems with our code is recorded in the technical debt in sonarqube when we use the default database - i.e. default install of version 4.5. It works, out of the box: Blocker 0 Critical 0 Major 88 Minor 70 Info 12 I change the datasource to mysql and Blocker 0 Critical 0 Major 0 Minor 0 Info 0 is recorded. No errors presented by mvn or sonar. I can see all drivers load during mvn run. In .m2/settings.xml I have <profile> <id>sonar</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <sonar.jdbc.url> jdbc:mysql://sonar.company.io:3306/sonar?useUnicode=true&characterEncoding=utf8 </sonar.jdbc.url> <sonar.jdbc.username>sonar</sonar.jdbc.username> <sonar.jdbc.password>pass</sonar.jdbc.password> <sonar.host.url> http://sonar.company.io:9000 </sonar.host.url> <sonar.verbose>true</sonar.verbose> </properties> </profile> I can am able to connect via the hostname using mysql -usonar -ppass -h sonar.company.io and there is content in the database. mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | sonar | mysql> show table status; +---------------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +---------------------------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+-----------+----------+----------------+---------+ | action_plans | InnoDB | 10 | Compact | 0 | 0 | 16384 | 0 | 16384 | 4194304 | 1 | 2014-09-30 14:30:17 | NULL | NULL | utf8_bin | NULL | | | | active_dashboards | InnoDB | 10 | Compact | 5 | 3276 | 16384 | 0 | 32768 | 4194304 | 6 | 2014-09-30 14:30:10 | NULL | NULL | utf8_bin | NULL | | | | active_rule_parameters | InnoDB | 10 | Compact | 42 | 390 | 16384 | 0 | 0 | 4194304 | 43 | 2014-09-30 14:30:16 | NULL | NULL | utf8_bin | NULL | | | | active_rules | InnoDB | 10 | Compact | 1099 | 74 | 81920 | 0 | 49152 | 4194304 | 992 | 2014-09-30 14:30:18 | NULL | NULL | utf8_bin | NULL | | | What could be the reason?
I get 404 Not found | Install war project in Karaf 3 from userguide
I can install a war but not to test it , why ???? From Karaf tuto I have done : karaf#root()> bundle:install -s "webbundle:http://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/sample.war?Bundle-SymbolicName=tomcat-sample&Web-ContextPath=/sample" Bundle ID: 150 karaf#root()> list |grep tom 150 | Active | 80 | 0 | tomcat-sample karaf#root()> web:list ID | State | Web-State | Level | Web-ContextPath | Name 123 | Active | Deployed | 80 | /sample | tomcat-sample (0) When I go to [http://loxcalhost:8181/sample] it's not working , why ???
The sample war doesn't contain a welcome section in it's web.xml and therefore nothing happens if you call localhost:8181/sample you have to go for localhost:8181/sample/hello as that's the registered servlet for this web-application. If you issue a http:list command you'll get the following listing: karaf#root()> http:list ID | Servlet | Servlet-Name | State | Alias | Url --------------------------------------------------------------------------------------------------------------------------- 103 | JspServletWrapper | jsp | Deployed | | [*.jsp, *.jspx, *.jspf, *.xsp, *.JSP, *.JSPX, *.JSPF, *.XSP] 103 | ResourceServlet | default | Deployed | / | [/] 103 | | HelloServlet | Deployed | | [/hello]
Ruby on Rails: Rake: rake stats didn't add my field to the correct value?
Before my rake stats modification +----------------------+-------+-------+---------+---------+-----+-------+ | Name | Lines | LOC | Classes | Methods | M/C | LOC/M | +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 5037 | 3936 | 31 | 292 | 9 | 11 | | Helpers | 150 | 128 | 0 | 17 | 0 | 5 | | Models | 1523 | 1166 | 42 | 123 | 2 | 7 | | Libraries | 633 | 415 | 4 | 65 | 16 | 4 | | Functional tests | 289 | 228 | 13 | 0 | 0 | 0 | | Unit tests | 560 | 389 | 30 | 0 | 0 | 0 | | Model specs | 1085 | 904 | 0 | 3 | 0 | 299 | | View specs | 88 | 75 | 0 | 0 | 0 | 0 | | Controller specs | 468 | 388 | 0 | 2 | 0 | 192 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 9833 | 7629 | 120 | 502 | 4 | 13 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 5645 Test LOC: 1984 Code to Test Ratio: 1:0.4 now, when I add: #Factories ::STATS_DIRECTORIES << %w(Factories\ specs test/factories) if File.exist?('test/factories') ::CodeStatistics::TEST_TYPES << "Factory specs" if File.exist?('test/factories') around line 120, it should increase test LOC, right? +----------------------+-------+-------+---------+---------+-----+-------+ | Controllers | 5037 | 3936 | 31 | 292 | 9 | 11 | | Helpers | 150 | 128 | 0 | 17 | 0 | 5 | | Models | 1523 | 1166 | 42 | 123 | 2 | 7 | | Libraries | 633 | 415 | 4 | 65 | 16 | 4 | | Functional tests | 289 | 228 | 13 | 0 | 0 | 0 | | Unit tests | 560 | 389 | 30 | 0 | 0 | 0 | | Model specs | 1085 | 904 | 0 | 3 | 0 | 299 | | View specs | 88 | 75 | 0 | 0 | 0 | 0 | | Controller specs | 468 | 388 | 0 | 2 | 0 | 192 | | Factories specs | 144 | 119 | 0 | 0 | 0 | 0 | +----------------------+-------+-------+---------+---------+-----+-------+ | Total | 9977 | 7748 | 120 | 502 | 4 | 13 | +----------------------+-------+-------+---------+---------+-----+-------+ Code LOC: 5764 Test LOC: 1984 Code to Test Ratio: 1:0.3 Instead of adding tho 144 lines from factories to test LOC, it adds them to code LOC =\ How do I get the line count to be in Test LOC?
You're adding something called "Factories specs" (plural) to the STATS_DIRECTORIES array, but you call it "Factory specs" (singular) when you add it to TEST_TYPES array -- so when rake:stat hits your test/factories folder, it looks for "Factories specs" in TEST_TYPES, doesn't find it, and assumes it's code, not tests. You need to call it the same thing in both places: ::STATS_DIRECTORIES << %w(Factory\ specs test/factories) if File.exist?('test/factories') ::CodeStatistics::TEST_TYPES << "Factory specs" if File.exist?('test/factories')
Load jndi.xml before beans.xml
I have two files beans.xml and jndi.xml. We want to retrieve something in beans.xml that is put into JNDI through jndi.xml. Unfortunately, beans in beans.xml are created before jndi.xml is loaded, so when we try to do the JNDI lookup in beans.xml, nothing is in JNDI. Is there a way to get jndi.xml to be loaded before beans.xml? beans.xml ... <bean id="geronimoTransactionManager" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiName" value="java:comp/UserTransaction" /> </bean> ... jndi.xml <beans> <bean id="jndi" class="org.apache.xbean.spring.jndi.SpringInitialContextFactory" factory-method="makeInitialContext" singleton="true"> <property name="entries" ref="jndiEntries" /> </bean> <map id="jndiEntries"> <entry key="java:comp/UserTransaction" value-ref="geronimoTransactionManager" /> </map> <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="userTransaction" ref="geronimoTransactionManager" /> </bean> <bean id="geronimoTransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl" /> </beans> Here is the log that makes me believe beans.xml is loaded before jndi.xml. 21:43:26,927 | INFO | l Console Thread | ultOsgiApplicationContextCreator | 72 - org.springframework.osgi.extender - 1.2.0 | Discovered configurations {osgibundle:/META-INF/spring/*.xml} in bundle [SWIM Prototype :: AqMqJDBC Pooling (camel-osgi-aqmq)] 21:43:26,939 | INFO | ExtenderThread-4 | OsgiBundleXmlApplicationContext | 61 - org.springframework.context - 3.0.5.RELEASE | Refreshing OsgiBundleXmlApplicationContext(bundle=camel-osgi-aqmq, config=osgibundle:/META-INF/spring/*.xml): startup date [Wed Apr 20 21:43:26 GMT+00:00 2011]; root of context hierarchy 21:43:26,939 | INFO | ExtenderThread-4 | OsgiBundleXmlApplicationContext | 61 - org.springframework.context - 3.0.5.RELEASE | Unpublishing application context OSGi service for bundle SWIM Prototype :: AqMqJDBC Pooling (camel-osgi-aqmq) 21:43:26,973 | INFO | ExtenderThread-4 | XmlBeanDefinitionReader | 59 - org.springframework.beans - 3.0.5.RELEASE | Loading XML bean definitions from URL [bundleentry://202.fwk22939763/META-INF/spring/beans.xml] 21:43:27,295 | INFO | ExtenderThread-4 | CamelNamespaceHandler | 75 - org.apache.camel.camel-spring - 2.6.0.fuse-01-09 | OSGi environment detected. 21:43:29,167 | INFO | ExtenderThread-4 | WaiterApplicationContextExecutor | 72 - org.springframework.osgi.extender - 1.2.0 | No outstanding OSGi service dependencies, completing initialization for OsgiBundleXmlApplicationContext(bundle=camel-osgi-aqmq, config=osgibundle:/META-INF/spring/*.xml) 21:43:29,283 | INFO | ExtenderThread-5 | DefaultListableBeanFactory | 59 - org.springframework.beans - 3.0.5.RELEASE | Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory#77e77a: defining beans [template,consumerTemplate,camel-1:beanPostProcessor,camel-1,required,jtaTransactionManager,geronimoTransactionManager,activeMQ,jmsConnectionFactory,jmsManagedConnectionFactory,jmsResourceAdapter,jencksConnectionManager,jencksPoolingSupport,requiredBeanForOracleAq,oracleQueue,oracleQueueCredentials,aqConnectionFactoryQueue,aqXADataSource,jdbcXADataSource,managedXADataSource,myTransform,preProps,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0]; root of factory hierarchy 21:43:29,736 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | JMX enabled. Using ManagedManagementStrategy. 21:43:29,839 | INFO | ExtenderThread-5 | JtaTransactionManager | 74 - org.springframework.transaction - 3.0.5.RELEASE | Using JTA UserTransaction: org.apache.geronimo.transaction.manager.TransactionManagerImpl#1f07586 21:43:29,839 | INFO | ExtenderThread-5 | JtaTransactionManager | 74 - org.springframework.transaction - 3.0.5.RELEASE | Using JTA TransactionManager: org.apache.geronimo.transaction.manager.TransactionManagerImpl#1f07586 21:43:29,839 | INFO | ExtenderThread-5 | JtaTransactionManager | 74 - org.springframework.transaction - 3.0.5.RELEASE | Using JTA TransactionSynchronizationRegistry: org.apache.geronimo.transaction.manager.TransactionManagerImpl#1f07586 21:43:30,104 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Apache Camel 2.6.0-fuse-01-09 (CamelContext: 202-camel-3) is starting21:43:30,430 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 13 #Converter classes to load 21:43:30,469 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 1 #Converter classes to load 21:43:30,473 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 1 #Converter classes to load 21:43:30,477 | INFO | ExtenderThread-5 | Activator | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Found 2 #Converter classes to load 21:43:34,173 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Route: route1 started and consuming from: Endpoint[activeMQ://queue:BROKER2.QUEUE?concurrentConsumers=10] 21:43:34,194 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Total 1 routes, of which 1 is started. 21:43:34,196 | INFO | ExtenderThread-5 | OsgiSpringCamelContext | 68 - org.apache.camel.camel-core - 2.6.0.fuse-01-09 | Apache Camel 2.6.0-fuse-01-09 (CamelContext: 202-camel-3) started in 4.089 seconds 21:43:34,204 | INFO | ExtenderThread-5 | OsgiBundleXmlApplicationContext | 61 - org.springframework.context - 3.0.5.RELEASE | Publishing application context as OSGi service with properties {org.springframework.context.service.name=camel-osgi-aqmq, Bundle-SymbolicName=camel-osgi-aqmq, Bundle-Version=4.3.0.fuse-03-00} 21:43:34,205 | INFO | ExtenderThread-5 | ContextLoaderListener | 72 - org.springframework.osgi.extender - 1.2.0 | Application context successfully refreshed (OsgiBundleXmlApplicationContext(bundle=camel-osgi-aqmq, config=osgibundle:/META-INF/spring/*.xml)) 21:43:41,674 | INFO | tenerContainer-7 | SpringInitialContextFactory | 110 - org.apache.xbean.spring - 3.7 | Loading JNDI context from: class path resource [jndi.xml] 21:43:41,685 | INFO | tenerContainer-7 | XBeanXmlBeanDefinitionReader | 59 - org.springframework.beans - 3.0.5.RELEASE | Loading XML bean definitions from class path resource [jndi.xml]
In jndi.xml, you should try : <beans> <import resource="beans.xml"/> (...)