hibernate 5.2.6 & karaf 4.1.0

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

hibernate 5.2.6 & karaf 4.1.0

Jason Reilly
Hi all,

Has anyone tried this combination yet?  I am giving it a whirl & am
getting the following exception when I add my persistence bundle:


Bundle org.apache.aries.jpa.container [65] EventDispatcher: Error during dispatch. (java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider)
java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider
     at org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84) [65:org.apache.aries.jpa.container:2.5.0]
     at org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44) [65:org.apache.aries.jpa.container:2.5.0]
     at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) [?:?]
.....

08:46:48.925 [FelixDispatchQueue] ERROR org.apache.aries.jpa.container - FrameworkEvent ERROR - org.apache.aries.jpa.container

java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to javax.persistence.spi.PersistenceProvider

     at org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84) [65:org.apache.aries.jpa.container:2.5.0]

     at org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44) [65:org.apache.aries.jpa.container:2.5.0]


I have tried using Hibernate 5.2.8.Final which issues the same exception.


Regards,

Jason

Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

jbonofre
Hi Jason,

Can you check the jpa API bundle installed ?

Christian and I investigated an issue about JPA API installed last week,
it could be related.

Regards
JB

On 02/28/2017 02:58 PM, Jason Reilly wrote:

> Hi all,
>
> Has anyone tried this combination yet?  I am giving it a whirl & am
> getting the following exception when I add my persistence bundle:
>
>
> Bundle org.apache.aries.jpa.container [65] EventDispatcher: Error during
> dispatch. (java.lang.ClassCastException:
> org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to
> javax.persistence.spi.PersistenceProvider)
> java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider
> cannot be cast to javax.persistence.spi.PersistenceProvider
>     at
> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
> [65:org.apache.aries.jpa.container:2.5.0]
>     at
> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
> [65:org.apache.aries.jpa.container:2.5.0]
>     at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
> [?:?]
> .....
>
> 08:46:48.925 [FelixDispatchQueue] ERROR org.apache.aries.jpa.container -
> FrameworkEvent ERROR - org.apache.aries.jpa.container
>
> java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider
> cannot be cast to javax.persistence.spi.PersistenceProvider
>
>     at
> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
> [65:org.apache.aries.jpa.container:2.5.0]
>
>     at
> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
> [65:org.apache.aries.jpa.container:2.5.0]
>
>
> I have tried using Hibernate 5.2.8.Final which issues the same exception.
>
>
> Regards,
>
> Jason
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

Jason Reilly
karaf@root()> feature:list | grep jpa
deltaspike-jpa                  │ 1.2.1            │          │ Uninstalled │ org.ops4j.pax.cdi-0.12.0          │ Apache Deltaspike jpa support
deltaspike-jpa                  │ 1.4.2            │          │ Uninstalled │ org.ops4j.pax.cdi-1.0.0.RC2       │ Apache Deltaspike jpa support
jpa                             │ 2.5.0            │ x        │ Started     │ enterprise-4.1.0                  │ OSGi Persistence Container
openjpa                         │ 2.4.1            │          │ Uninstalled │ enterprise-4.1.0                  │ Apache OpenJPA 2.4.x persistence engine support
karaf@root()> feature:list | grep transaction
transaction-api                 │ 1.2.0            │ x        │ Started     │ enterprise-4.1.0                  │
transaction-manager-geronimo    │ 1.3.2            │          │ Started     │ enterprise-4.1.0                  │ Geronimo Transaction Manager
transaction-manager-narayana    │ 5.5.0.Final      │          │ Uninstalled │ enterprise-4.1.0                  │ Narayana Transaction Manager
transaction                     │ 2.0.0            │ x        │ Started     │ enterprise-4.1.0                  │ OSGi Transaction Manager


On 02/28/2017 08:59 AM, Jean-Baptiste Onofré wrote:

> Hi Jason,
>
> Can you check the jpa API bundle installed ?
>
> Christian and I investigated an issue about JPA API installed last
> week, it could be related.
>
> Regards
> JB
>
> On 02/28/2017 02:58 PM, Jason Reilly wrote:
>> Hi all,
>>
>> Has anyone tried this combination yet?  I am giving it a whirl & am
>> getting the following exception when I add my persistence bundle:
>>
>>
>> Bundle org.apache.aries.jpa.container [65] EventDispatcher: Error during
>> dispatch. (java.lang.ClassCastException:
>> org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to
>> javax.persistence.spi.PersistenceProvider)
>> java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider
>> cannot be cast to javax.persistence.spi.PersistenceProvider
>>     at
>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
>>
>> [65:org.apache.aries.jpa.container:2.5.0]
>>     at
>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
>>
>> [65:org.apache.aries.jpa.container:2.5.0]
>>     at
>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
>>
>> [?:?]
>> .....
>>
>> 08:46:48.925 [FelixDispatchQueue] ERROR org.apache.aries.jpa.container -
>> FrameworkEvent ERROR - org.apache.aries.jpa.container
>>
>> java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider
>> cannot be cast to javax.persistence.spi.PersistenceProvider
>>
>>     at
>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
>>
>> [65:org.apache.aries.jpa.container:2.5.0]
>>
>>     at
>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
>>
>> [65:org.apache.aries.jpa.container:2.5.0]
>>
>>
>> I have tried using Hibernate 5.2.8.Final which issues the same
>> exception.
>>
>>
>> Regards,
>>
>> Jason
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

jbonofre
Hi,

can you do:

la|grep -i jpa

Thanks !
Regards
JB

On 02/28/2017 03:01 PM, Jason Reilly wrote:

> karaf@root()> feature:list | grep jpa
> deltaspike-jpa                  │ 1.2.1            │          │
> Uninstalled │ org.ops4j.pax.cdi-0.12.0          │ Apache Deltaspike jpa
> support
> deltaspike-jpa                  │ 1.4.2            │          │
> Uninstalled │ org.ops4j.pax.cdi-1.0.0.RC2       │ Apache Deltaspike jpa
> support
> jpa                             │ 2.5.0            │ x        │
> Started     │ enterprise-4.1.0                  │ OSGi Persistence
> Container
> openjpa                         │ 2.4.1            │          │
> Uninstalled │ enterprise-4.1.0                  │ Apache OpenJPA 2.4.x
> persistence engine support
> karaf@root()> feature:list | grep transaction
> transaction-api                 │ 1.2.0            │ x        │
> Started     │ enterprise-4.1.0                  │
> transaction-manager-geronimo    │ 1.3.2            │          │
> Started     │ enterprise-4.1.0                  │ Geronimo Transaction
> Manager
> transaction-manager-narayana    │ 5.5.0.Final      │          │
> Uninstalled │ enterprise-4.1.0                  │ Narayana Transaction
> Manager
> transaction                     │ 2.0.0            │ x        │
> Started     │ enterprise-4.1.0                  │ OSGi Transaction Manager
>
>
> On 02/28/2017 08:59 AM, Jean-Baptiste Onofré wrote:
>> Hi Jason,
>>
>> Can you check the jpa API bundle installed ?
>>
>> Christian and I investigated an issue about JPA API installed last
>> week, it could be related.
>>
>> Regards
>> JB
>>
>> On 02/28/2017 02:58 PM, Jason Reilly wrote:
>>> Hi all,
>>>
>>> Has anyone tried this combination yet?  I am giving it a whirl & am
>>> getting the following exception when I add my persistence bundle:
>>>
>>>
>>> Bundle org.apache.aries.jpa.container [65] EventDispatcher: Error during
>>> dispatch. (java.lang.ClassCastException:
>>> org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to
>>> javax.persistence.spi.PersistenceProvider)
>>> java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider
>>> cannot be cast to javax.persistence.spi.PersistenceProvider
>>>     at
>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
>>>
>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>     at
>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
>>>
>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>     at
>>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
>>>
>>> [?:?]
>>> .....
>>>
>>> 08:46:48.925 [FelixDispatchQueue] ERROR org.apache.aries.jpa.container -
>>> FrameworkEvent ERROR - org.apache.aries.jpa.container
>>>
>>> java.lang.ClassCastException: org.hibernate.osgi.OsgiPersistenceProvider
>>> cannot be cast to javax.persistence.spi.PersistenceProvider
>>>
>>>     at
>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
>>>
>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>
>>>     at
>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
>>>
>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>
>>>
>>> I have tried using Hibernate 5.2.8.Final which issues the same
>>> exception.
>>>
>>>
>>> Regards,
>>>
>>> Jason
>>>
>>
>

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

Jason Reilly
karaf@root()> la|grep -i jpa

  63 │ Active   │  80 │ 2.5.0                 │ Apache Aries JPA Container API

  64 │ Active   │  80 │ 2.5.0                 │ Apache Aries JPA blueprint

  65 │ Active   │  80 │ 2.5.0                 │ Apache Aries JPA container

  66 │ Active   │  80 │ 2.5.0                 │ Apache Aries JPA support

137 │ Active   │  80 │ 1.1                   │ Apache Geronimo JSR-317 JPA 2.0 Spec API

238 │ Active   │  80 │ 1.0.0.Final           │ hibernate-jpa-2.1-api

261 │ Active   │  80 │ 1.0.0.201505202024    │ org.osgi:org.osgi.service.jpa



On 02/28/2017 09:03 AM, Jean-Baptiste Onofré wrote:

> Hi,
>
> can you do:
>
> la|grep -i jpa
>
> Thanks !
> Regards
> JB
>
> On 02/28/2017 03:01 PM, Jason Reilly wrote:
>> karaf@root()> feature:list | grep jpa
>> deltaspike-jpa                  │ 1.2.1            │          │
>> Uninstalled │ org.ops4j.pax.cdi-0.12.0          │ Apache Deltaspike jpa
>> support
>> deltaspike-jpa                  │ 1.4.2            │          │
>> Uninstalled │ org.ops4j.pax.cdi-1.0.0.RC2       │ Apache Deltaspike jpa
>> support
>> jpa                             │ 2.5.0            │ x        │
>> Started     │ enterprise-4.1.0                  │ OSGi Persistence
>> Container
>> openjpa                         │ 2.4.1            │          │
>> Uninstalled │ enterprise-4.1.0                  │ Apache OpenJPA 2.4.x
>> persistence engine support
>> karaf@root()> feature:list | grep transaction
>> transaction-api                 │ 1.2.0            │ x        │
>> Started     │ enterprise-4.1.0                  │
>> transaction-manager-geronimo    │ 1.3.2            │          │
>> Started     │ enterprise-4.1.0                  │ Geronimo Transaction
>> Manager
>> transaction-manager-narayana    │ 5.5.0.Final      │          │
>> Uninstalled │ enterprise-4.1.0                  │ Narayana Transaction
>> Manager
>> transaction                     │ 2.0.0            │ x        │
>> Started     │ enterprise-4.1.0                  │ OSGi Transaction
>> Manager
>>
>>
>> On 02/28/2017 08:59 AM, Jean-Baptiste Onofré wrote:
>>> Hi Jason,
>>>
>>> Can you check the jpa API bundle installed ?
>>>
>>> Christian and I investigated an issue about JPA API installed last
>>> week, it could be related.
>>>
>>> Regards
>>> JB
>>>
>>> On 02/28/2017 02:58 PM, Jason Reilly wrote:
>>>> Hi all,
>>>>
>>>> Has anyone tried this combination yet?  I am giving it a whirl & am
>>>> getting the following exception when I add my persistence bundle:
>>>>
>>>>
>>>> Bundle org.apache.aries.jpa.container [65] EventDispatcher: Error
>>>> during
>>>> dispatch. (java.lang.ClassCastException:
>>>> org.hibernate.osgi.OsgiPersistenceProvider cannot be cast to
>>>> javax.persistence.spi.PersistenceProvider)
>>>> java.lang.ClassCastException:
>>>> org.hibernate.osgi.OsgiPersistenceProvider
>>>> cannot be cast to javax.persistence.spi.PersistenceProvider
>>>>     at
>>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
>>>>
>>>>
>>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>>     at
>>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
>>>>
>>>>
>>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>>     at
>>>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
>>>>
>>>>
>>>> [?:?]
>>>> .....
>>>>
>>>> 08:46:48.925 [FelixDispatchQueue] ERROR
>>>> org.apache.aries.jpa.container -
>>>> FrameworkEvent ERROR - org.apache.aries.jpa.container
>>>>
>>>> java.lang.ClassCastException:
>>>> org.hibernate.osgi.OsgiPersistenceProvider
>>>> cannot be cast to javax.persistence.spi.PersistenceProvider
>>>>
>>>>     at
>>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:84)
>>>>
>>>>
>>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>>
>>>>     at
>>>> org.apache.aries.jpa.container.impl.PersistenceProviderTracker.addingService(PersistenceProviderTracker.java:44)
>>>>
>>>>
>>>> [65:org.apache.aries.jpa.container:2.5.0]
>>>>
>>>>
>>>> I have tried using Hibernate 5.2.8.Final which issues the same
>>>> exception.
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Jason
>>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

jbonofre
Ok,

we have multiple JPA API installed (Geronimo and Hibernate API). Once in
2.0, the other in 2.1.

It's what we fixed with Christian. I think your issue could be related
as it might not cast on the right persistence API version.

Regards
JB

On 02/28/2017 03:04 PM, Jason Reilly wrote:
> 137 │ Active   │  80 │ 1.1                   │ Apache Geronimo JSR-317
> JPA 2.0 Spec API
>
> 238 │ Active   │  80 │ 1.0.0.Final           │ hibernate-jpa-2.1-api
>
> 261 │ Active   │  80 │ 1.0.0.201505202024    │
> org.osgi:org.osgi.service.jpa

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

Jason Reilly
I saw the following and installed it in place of the default 'jpa' feature.

http://repo1.maven.org/maven2/org/apache/aries/jpa/jpa-features/2.6.0/jpa-features-2.6.0-features.xml


I don't know if they work yet, but, at least my persistence bundles are
now started.


Thanks & keep up the great work.

Regards,
Jason





On 02/28/2017 09:07 AM, Jean-Baptiste Onofré wrote:

> Ok,
>
> we have multiple JPA API installed (Geronimo and Hibernate API). Once
> in 2.0, the other in 2.1.
>
> It's what we fixed with Christian. I think your issue could be related
> as it might not cast on the right persistence API version.
>
> Regards
> JB
>
> On 02/28/2017 03:04 PM, Jason Reilly wrote:
>> 137 │ Active   │  80 │ 1.1                   │ Apache Geronimo JSR-317
>> JPA 2.0 Spec API
>>
>> 238 │ Active   │  80 │ 1.0.0.Final           │ hibernate-jpa-2.1-api
>>
>> 261 │ Active   │  80 │ 1.0.0.201505202024    │
>> org.osgi:org.osgi.service.jpa
>

Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

Unreal
This post has NOT been accepted by the mailing list yet.
In reply to this post by Jason Reilly
hi jason,

i have the same problem, i tried to replicate this tutorial that work grate on karaf 4.0.8 and hibernate 4.3.6:

https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-blueprint-cdi

but on karaf 4.1.0 with provided hibernate 5.2.6 not work. I tried to substitute org.hibernate.osgi.OsgiPersistenceProvider in provider tag inside my persistence.xml, no more error but hibernate/jpa not start my persistence unit (no table was created/dropped with hbm2ddl.auto=crete).
Data source is ok becouse tested with jdbc:query or jdbc:execute.

Any help wil be appreciate....
Reply | Threaded
Open this post in threaded view
|

Re: hibernate 5.2.6 & karaf 4.1.0

Thomas PEREZ
This post has NOT been accepted by the mailing list yet.
Hi,

You maybe need to change the aries.jpa version to 2.6.0. ( ARIES-1695 i think)
For me https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-ds works on karaf 4.10, hibernate 5.2.6 and aries.jpa 2.6.0.

If you want to try (just an update of features/enterprise/src/main/feature/feature.xml aries.jpa 2.5.0 --> 2.6.0):

feature:uninstall jpa

feature:install transaction-api
bundle:install -s mvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1
bundle:install -s mvn:org.apache.felix/org.apache.felix.coordinator/1.0.2
bundle:install -s mvn:org.osgi/org.osgi.service.jpa/1.0.0
bundle:install -s mvn:org.osgi/org.osgi.service.jdbc/1.0.0
bundle:install -s mvn:org.apache.aries.jpa/org.apache.aries.jpa.api/2.6.0
bundle:install -s mvn:org.apache.aries.jpa/org.apache.aries.jpa.container/2.6.0
bundle:install -s mvn:org.apache.aries.jpa/org.apache.aries.jpa.support/2.6.0