You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by manueld <ma...@gmail.com> on 2015/05/18 15:08:15 UTC

Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Hi,

We recently migrated our platform from Karaf 2.3.2 to Karaf 3.0.3.

Everything runs fine excepted JPA and Hibernate. 
When we start our custom distribution in some environments, persistence
bundles stay in GracePeriod and are never initialized, as if the persistence
context was never read. They end in the state "Failure".
It's a strange comportment because it's not happen on the same rate,
depending on the environment where the distribution is launched. On my
development machine, the distribution runs almost always fine. On one of our
staging environments, almost never ...

I noticed some suspect logs :
2015-05-18 14:42:47,653 | WARN  | Event Dispatcher | aries                           
| 192 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | Managed persistence
context support is no longer available for use with the Aries Blueprint
container.

2015-05-18 14:42:48,037 | WARN  | Event Dispatcher | container                       
| 193 - org.apache.aries.jpa.container - 1.0.2 | There are no providers
available.

2015-05-18 14:43:12,443 | ERROR | Event Dispatcher | aries                           
| 192 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | No
org.apache.aries.jpa.container.sync.Synchronization service registered.

But these logs appear also when distribution run fine, so maybe it's not
related to the problem.

I also noticed that in case of "GracePeriod then Failure" state, the bundle
"hibernate-osgi" stays indefinitely in the state "Starting".
And the bundle "Apache Aries Blueprint Core Compatiblity Fragment Bundle,
Hosts: 15" stays in the state Resolved. I don't know what is its purpose and
if it could be linked to our problem.

Here an example of one our persistence features :

<feature name="usersDAO"  version="${project.version}" description="usersDAO
feature">
<feature>transaction</feature>
<feature>jndi</feature>
<feature>pax-jdbc-h2</feature>
<feature>pax-jdbc-config</feature>
<feature>pax-jdbc-pool-dbcp2</feature>
<feature version="2.1.0">jpa</feature>
<feature version="4.3.6.Final">hibernate</feature>
<bundle>mvn:com.test.bundle.dao/users/1.1.2</bundle>
</feature>

As you can see it's very close to this example :
https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa

So, do you have an idea ?
I suspect the bundle order, or the start-level of some bundles. Maybe the
distribution runs too fast, or too slow, on some environments, and so
initialize some importants bundles too fast, or too slowly ?

Thank you for your help.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Charlie Mordant <cm...@gmail.com>.
I think that the start-order should be: hibernate-osgi < aries-jpa

2015-05-18 17:04 GMT+02:00 manueld <ma...@gmail.com>:

> Thank you for your answer.
>
> What bundle order do you recommand ?
>
> In the hibernate 4.3.X feature, the default start-level for hibernate-osgi
> is 100, so superior to the default start-level (80). Is that normal ?
> "hibernate-osgi" shouldn't be started before all the persistence bundles ?
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040441.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
No, I install only the jpa 2.1.

Good news, I've reorganized the features installed in my Karaf distribution,
and I don't encounter anymore the GracePeriod problems about the persistence
bundles. But I have an other recurring problem now ....
Sometimes (but not always), some bundles stay in "Waiting" state.

When I execute the "diag" command on these, I get this error :

---------------------------------------------------------
Status: Waiting
Spring DM
19/05/15 18:06

But there is no bundle with the GracePeriod state, and the logs say there is
no missing dependencies :

No unsatisfied OSGi service dependencies; completing initialization for
OsgiBundleXmlApplicationContext(bundle=com.XXXXX,
config=osgibundle:/META-INF/spring/*.xml)

Do you know what I could do to fix this issue ?

Thank you again for your help !




--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040497.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
Great, thank you for your help !

Manuel



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040479.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Christian Schneider <ch...@die-schneider.net>.
Can you check if maybe you accidently install the jpa 2.0 and 2.1 apis?
You should make sure you only install one of them.

Christian


On 19.05.2015 10:48, manueld wrote:
> We chose Hibernate because of JPA 2.1. I thought it was well supported on
> Karaf 3, ... but from what I read,  I'll have to be patient ;)
> So you advise me to go back to OpenJPA ? It's a lot of work so I would like
> to be certain about it.
> This situation is very frustrating, because, once again, our distribution
> with JPA 2.1 and Hibernate runs fine on some environments, and when the
> distribution itself is light (or when the persistence features are installed
> individually)
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040477.html
> Sent from the Karaf - User mailing list archive at Nabble.com.


-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com


Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hibernate with JPA 2.1 (and Aries JPA 2.1) should work. Let me try my 
example switch from OpenJPA to Hibernate.

Regards
JB

On 05/19/2015 10:48 AM, manueld wrote:
> We chose Hibernate because of JPA 2.1. I thought it was well supported on
> Karaf 3, ... but from what I read,  I'll have to be patient ;)
> So you advise me to go back to OpenJPA ? It's a lot of work so I would like
> to be certain about it.
> This situation is very frustrating, because, once again, our distribution
> with JPA 2.1 and Hibernate runs fine on some environments, and when the
> distribution itself is light (or when the persistence features are installed
> individually)
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040477.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
We chose Hibernate because of JPA 2.1. I thought it was well supported on
Karaf 3, ... but from what I read,  I'll have to be patient ;)
So you advise me to go back to OpenJPA ? It's a lot of work so I would like
to be certain about it.
This situation is very frustrating, because, once again, our distribution
with JPA 2.1 and Hibernate runs fine on some environments, and when the
distribution itself is light (or when the persistence features are installed
individually)



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040477.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK, that explains. OpenJPA (which is JPA 2.0) works in Karaf 3 (I tested 
it).

However, Hibernate has been tested by some users AFAIR, and hibernate is 
part of the itest (at least feature installation).

I will take a look after release preparation.

Regards
JB

On 05/19/2015 10:26 AM, manueld wrote:
> We used openjpa on Karaf 2, by default.
> With the migration to Karaf 3, we thought it was a good idea to migrate also
> to Hibernate, much more convenient and "compatible" with Karaf 3.
> I did not try the JPA 2.0 feature, I'm going to try it now, thank you for
> the advice.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040472.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Charlie Mordant <cm...@gmail.com>.
OpenJPA 2.4 is now JPA 2.0 compliant, and works well on Karaf 3!


2015-05-19 10:26 GMT+02:00 manueld <ma...@gmail.com>:

> We used openjpa on Karaf 2, by default.
> With the migration to Karaf 3, we thought it was a good idea to migrate
> also
> to Hibernate, much more convenient and "compatible" with Karaf 3.
> I did not try the JPA 2.0 feature, I'm going to try it now, thank you for
> the advice.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040472.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
We used openjpa on Karaf 2, by default.
With the migration to Karaf 3, we thought it was a good idea to migrate also
to Hibernate, much more convenient and "compatible" with Karaf 3. 
I did not try the JPA 2.0 feature, I'm going to try it now, thank you for
the advice.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040472.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Does it work with Karaf 2 ?

I guess that it works with JPA 2.0 and previous Hibernate release right ?
Did you try JPA 2.0 feature ?

Regards
JB

On 05/19/2015 10:07 AM, manueld wrote:
> Hi,
>
> Sorry to insist on this, but it's a major issue on our side and we will have
> to go back to Karaf 2 if we don't find a solution.
> Do you think that the upcoming Karaf 3.0.4 could fix this issue ?
>
> Thank you.
>
> Manuel
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040470.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
Hi,

Sorry to insist on this, but it's a major issue on our side and we will have
to go back to Karaf 2 if we don't find a solution.
Do you think that the upcoming Karaf 3.0.4 could fix this issue ?

Thank you.

Manuel




--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040470.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
I've omitted to said that, sometimes, one or many persistence bundles start
normally, while the others stay in GracePeriod. It seems to be random ...



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040450.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: NoSuchFieldError

Posted by Jurgen Voorneveld <ju...@redsocks.nl>.
problem solved.

On 05/19/2015 10:37 AM, Jurgen Voorneveld wrote:
> 
> Hello list,
> 
> I get the feeling what's happening to my code is a simple oversight but
> I can't figure it out.
> 
> I've been adding more separation to my code by turning all the libraries
> into bundles and by creating a bundle of my own with common code in it.
> I have a tool in its own bundle that depends on this common code. When I
> run it I get this error:
> 
> Caused by: java.lang.NoSuchFieldError: SCHEDULER
> 	at nl.redsocks.farm.analyzer.core.Analyzer.start(Analyzer.java:260)
> 	at
> org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
> 
> Line 260 says this:
> 
> Tools.SCHEDULER.scheduleAtFixedRate(this.fileUploader, 0,
> config.general.sleep);
> 
> The nl.redsocks.farm.common.app.Tools class contains this:
> 
> public static final FarmTimer SCHEDULER = new FarmTimer();
> 
> These are the relevant bundles in the list:
> 
> karaf@root()> list
> START LEVEL 100 , List Threshold: 50
>  ID | State    | Lvl | Version   | Name
> 
> -----------------------------------------------------------------------------
>  64 | Resolved |  80 | 1.0.143   | Analyzer
> 
>  92 | Active   |  80 | 1.00.07   | Farm-Common
> 
> 
> The relevant exports for the Farm-Common bundle:
> 
> karaf@root()> package:exports | grep farm
> nl.redsocks.farm.common.app                                 | 0.0.0
> | 92  | nl.redsocks.farm.common
> 
> The Analyzer bundle imports this package:
> 
> karaf@root()> package:imports | grep analyzer
> (&(osgi.wiring.package=nl.redsocks.farm.common.app))
>                                              |          | 64  |
> nl.redsocks.farm.analyzer                 | true
> 
> All code compiles normally without errors.
> 
> Where did I go wrong?
> 
> thnx, Jurgen
> 

NoSuchFieldError

Posted by Jurgen Voorneveld <ju...@redsocks.nl>.
Hello list,

I get the feeling what's happening to my code is a simple oversight but
I can't figure it out.

I've been adding more separation to my code by turning all the libraries
into bundles and by creating a bundle of my own with common code in it.
I have a tool in its own bundle that depends on this common code. When I
run it I get this error:

Caused by: java.lang.NoSuchFieldError: SCHEDULER
	at nl.redsocks.farm.analyzer.core.Analyzer.start(Analyzer.java:260)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)

Line 260 says this:

Tools.SCHEDULER.scheduleAtFixedRate(this.fileUploader, 0,
config.general.sleep);

The nl.redsocks.farm.common.app.Tools class contains this:

public static final FarmTimer SCHEDULER = new FarmTimer();

These are the relevant bundles in the list:

karaf@root()> list
START LEVEL 100 , List Threshold: 50
 ID | State    | Lvl | Version   | Name

-----------------------------------------------------------------------------
 64 | Resolved |  80 | 1.0.143   | Analyzer

 92 | Active   |  80 | 1.00.07   | Farm-Common


The relevant exports for the Farm-Common bundle:

karaf@root()> package:exports | grep farm
nl.redsocks.farm.common.app                                 | 0.0.0
| 92  | nl.redsocks.farm.common

The Analyzer bundle imports this package:

karaf@root()> package:imports | grep analyzer
(&(osgi.wiring.package=nl.redsocks.farm.common.app))
                                             |          | 64  |
nl.redsocks.farm.analyzer                 | true

All code compiles normally without errors.

Where did I go wrong?

thnx, Jurgen

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
Yes it is :

394 | Active      |  80 | 2.1.0.v201304241213    | Java Persistence API 2.1

karaf@root>bundle:info 394

Java Persistence API 2.1 (394)
------------------------------

karaf@root>bundle:diag 394
karaf@root>


Manuel



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040449.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Can you check that persistence-api bundle (provided by hibernate 
feature) is fully installed ?

Regards
JB

On 05/18/2015 05:35 PM, manueld wrote:
> JB :
> Same problem, it doesn't change anything.
> hibernate-osgi is still in "Starting" state and the persistences bundles are
> still missing "javax.persistence.EntityManagerFactory".
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040446.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
JB :
Same problem, it doesn't change anything.
hibernate-osgi is still in "Starting" state and the persistences bundles are
still missing "javax.persistence.EntityManagerFactory". 



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040446.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Manuel,

can you try hibernate before the jpa feature:

  <feature name="usersDAO"  version="${project.version}" 
description="usersDAOfeature">
  <feature>transaction</feature>
  <feature>jndi</feature>
  <feature>pax-jdbc-h2</feature>
  <feature>pax-jdbc-config</feature>
  <feature>pax-jdbc-pool-dbcp2</feature>
  <feature version="4.3.6.Final">hibernate</feature>
  <feature version="2.1.0">jpa</feature>
  <bundle>mvn:com.test.bundle.dao/users/1.1.2</bundle>
  </feature>

?

Regards
JB

On 05/18/2015 05:19 PM, manueld wrote:
> JB :
>
> Maybe i'm missing something but I think it's what I've done.
>
> Here's my feature :
> <feature name="usersDAO"  version="${project.version}" description="usersDAO
> feature">
> <feature>transaction</feature>
> <feature>jndi</feature>
> <feature>pax-jdbc-h2</feature>
> <feature>pax-jdbc-config</feature>
> <feature>pax-jdbc-pool-dbcp2</feature>
> <feature version="2.1.0">jpa</feature>
> <feature version="4.3.6.Final">hibernate</feature>
> <bundle>mvn:com.test.bundle.dao/users/1.1.2</bundle>
> </feature>
>
> Do you think that include this feature in featuresBoot could fix the problem
> ?
>
> Tcharl:
> What are you referring with "aries-jpa" ? The persistence bundle ? Or an
> other feature ?
>
> Manuel
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040444.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
JB :

Maybe i'm missing something but I think it's what I've done.

Here's my feature :
<feature name="usersDAO"  version="${project.version}" description="usersDAO
feature">
<feature>transaction</feature>
<feature>jndi</feature>
<feature>pax-jdbc-h2</feature>
<feature>pax-jdbc-config</feature>
<feature>pax-jdbc-pool-dbcp2</feature>
<feature version="2.1.0">jpa</feature>
<feature version="4.3.6.Final">hibernate</feature>
<bundle>mvn:com.test.bundle.dao/users/1.1.2</bundle>
</feature>

Do you think that include this feature in featuresBoot could fix the problem
?

Tcharl:
What are you referring with "aries-jpa" ? The persistence bundle ? Or an
other feature ?

Manuel



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040444.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

you should first install your JPA engine (hibernate, openjpa), so the 
hibernate feature first, and after aries jpa.

So you should have your feature describing:

<feature name="my" version="xx">
   <feature>jpa</feature>
   <feature>hibernate</feature>
   <bundle>path to my punit bundle</bundle>
</feature>

It could be part of the featuresBoot (in etc/org.apache.karaf.features.cfg).

No need to use a start-level.

Take a look there:
https://github.com/jbonofre/acna15/blob/master/features/src/main/resources/features.xml

you will have an example.

Regards
JB

On 05/18/2015 05:04 PM, manueld wrote:
> Thank you for your answer.
>
> What bundle order do you recommand ?
>
> In the hibernate 4.3.X feature, the default start-level for hibernate-osgi
> is 100, so superior to the default start-level (80). Is that normal ?
> "hibernate-osgi" shouldn't be started before all the persistence bundles ?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040441.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
Thank you for your answer.

What bundle order do you recommand ?

In the hibernate 4.3.X feature, the default start-level for hibernate-osgi
is 100, so superior to the default start-level (80). Is that normal ?
"hibernate-osgi" shouldn't be started before all the persistence bundles ?



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040441.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Charlie Mordant <cm...@gmail.com>.
EMF won't be created by Aries as long as your 'hibernate-osgi' bundle will
not be in 'started'/'active' state, and will fail after its service waiting
timeout (grace period).
You can try to tweak the start-levels of your bundles/feature to make them
start in the same order in each environments.

2015-05-18 15:42 GMT+02:00 manueld <ma...@gmail.com>:

> I didn't know the command "bundle:diag". I just executed it on a
> persistence
> bundle, here's the result :
>
> XXXX applications :: dao :: users (211)
> ----------------------------------------------
> Status: Failure
> Blueprint
> 18/05/15 15:36
> Exception:
> null
> java.util.concurrent.TimeoutException
>         at
>
> org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)
>         at
>
> org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
>         at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
>         at
>
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
>         at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>         at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>         at java.lang.Thread.run(Thread.java:745)
>
> Missing dependencies:
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
> (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
> =usersXA))(objectClass=javax.persistence.EntityManagerFactory))
>
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040433.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
I didn't know the command "bundle:diag". I just executed it on a persistence
bundle, here's the result :

XXXX applications :: dao :: users (211)
----------------------------------------------
Status: Failure
Blueprint
18/05/15 15:36
Exception: 
null
java.util.concurrent.TimeoutException
	at
org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)
	at
org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Missing dependencies: 
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory))
(&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=usersXA))(objectClass=javax.persistence.EntityManagerFactory)) 




--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040433.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by manueld <ma...@gmail.com>.
info :
karaf@root>bundle:info 207

hibernate-osgi (207)
--------------------


diag shows nothing:
karaf@root>bundle:diag 207
karaf@root>



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421p4040431.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 3.0.3 + Hibernate + JPA = JPA bundles stay in GracePeriod state

Posted by Charlie Mordant <cm...@gmail.com>.
Hi,

What does 'diag' and 'info' gives on the hibernate-osgi bundle?

regards,

2015-05-18 15:08 GMT+02:00 manueld <ma...@gmail.com>:

> Hi,
>
> We recently migrated our platform from Karaf 2.3.2 to Karaf 3.0.3.
>
> Everything runs fine excepted JPA and Hibernate.
> When we start our custom distribution in some environments, persistence
> bundles stay in GracePeriod and are never initialized, as if the
> persistence
> context was never read. They end in the state "Failure".
> It's a strange comportment because it's not happen on the same rate,
> depending on the environment where the distribution is launched. On my
> development machine, the distribution runs almost always fine. On one of
> our
> staging environments, almost never ...
>
> I noticed some suspect logs :
> 2015-05-18 14:42:47,653 | WARN  | Event Dispatcher | aries
> | 192 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | Managed persistence
> context support is no longer available for use with the Aries Blueprint
> container.
>
> 2015-05-18 14:42:48,037 | WARN  | Event Dispatcher | container
> | 193 - org.apache.aries.jpa.container - 1.0.2 | There are no providers
> available.
>
> 2015-05-18 14:43:12,443 | ERROR | Event Dispatcher | aries
> | 192 - org.apache.aries.jpa.blueprint.aries - 1.0.4 | No
> org.apache.aries.jpa.container.sync.Synchronization service registered.
>
> But these logs appear also when distribution run fine, so maybe it's not
> related to the problem.
>
> I also noticed that in case of "GracePeriod then Failure" state, the bundle
> "hibernate-osgi" stays indefinitely in the state "Starting".
> And the bundle "Apache Aries Blueprint Core Compatiblity Fragment Bundle,
> Hosts: 15" stays in the state Resolved. I don't know what is its purpose
> and
> if it could be linked to our problem.
>
> Here an example of one our persistence features :
>
> <feature name="usersDAO"  version="${project.version}"
> description="usersDAO
> feature">
> <feature>transaction</feature>
> <feature>jndi</feature>
> <feature>pax-jdbc-h2</feature>
> <feature>pax-jdbc-config</feature>
> <feature>pax-jdbc-pool-dbcp2</feature>
> <feature version="2.1.0">jpa</feature>
> <feature version="4.3.6.Final">hibernate</feature>
> <bundle>mvn:com.test.bundle.dao/users/1.1.2</bundle>
> </feature>
>
> As you can see it's very close to this example :
> https://github.com/cschneider/Karaf-Tutorial/tree/master/db/examplejpa
>
> So, do you have an idea ?
> I suspect the bundle order, or the start-level of some bundles. Maybe the
> distribution runs too fast, or too slow, on some environments, and so
> initialize some importants bundles too fast, or too slowly ?
>
> Thank you for your help.
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-3-0-3-Hibernate-JPA-JPA-bundles-stay-in-GracePeriod-state-tp4040421.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Charlie Mordant

Full OSGI/EE stack made with Karaf:
https://github.com/OsgiliathEnterprise/net.osgiliath.parent