I am facing a problem with one of my OSGi bundles. 
When I start it, I have the following error :

    

It is not blocking for starting my bundle, it is "Active". But when I try to
execute a SQL command through my Java code, it only works with native
queries. When I try to execute HQL queries/named queries, I always have
errors such as

    ClassCastException: com.example.MyBean cannot be cast to
com.example.MyBean

I guess it is linked to the first error. What do you think about that? Do
you know how to prevent the first error?

Additional information: 

- I have a bundle bundleA which contains persistence configuration, beans
(like MyBean), managers, etc. I also have bundleB which uses a service
exposed by bundleA. So the error appears when I call bundleA service through
bundleB. Alongside bundleA and bundleB, I have hibernate-osgi,
hibernate-entitymanager, hibernate-core and hibernate-commons-annotations
bundles in version 4.3.6.Final.

- Only bundleA contains MyBean class. BundleB has "Import-Package:
com.example" and "Import-Service: com.example.service" which is a service to
interact with managers contained in bundleA. When I show classes in bundleA
and bundleB with "bundle:classes" Karaf command, I find MyBean in both
bundles

- when I look at classes in my jars, I only find MyBean in bundleA. Not in
bundleB. Maybe "bundle:classes" shows classes in the bundle's jar and
classes imported by the bundle? 

Do not hesitate if you need more information.

Thanks a lot



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Reply via email to