Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1155102

Summary: Unable to build EntityManagerFactory on JBoss Fuse
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Martin Basovník <mbasovni>
Component: Camel, Examples, SwitchYardAssignee: tcunning
Status: CLOSED UPSTREAM QA Contact: Matej Melko <mmelko>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: aileenc, ganandan, kejohnso, soa-p-jira, tsykora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2025-02-10 03:43:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
switchyard-camel-jpa-binding error none

Description Martin Basovník 2014-10-21 11:27:43 UTC
=== Description of problem:
Switchyard quickstart "switchyard-quickstart-camel-jpa-binding" for JBoss Fuse throws sometimes (20%) following error:

javax.persistence.PersistenceException: [PersistenceUnit: JpaEvents] Unable to build EntityManagerFactory
...
Caused by: org.hibernate.service.jndi.JndiException: Error parsing JNDI name [osgi:service/jboss/datasources/ExampleDS]
...
Caused by: javax.naming.NoInitialContextException
...

=== Version-Release number of selected component (if applicable):
JBoss Fuse 6.1.0.redhat-379 + Switchyard 2.0.0.Alpha3 (community version)

=== How reproducible:
JBoss Fuse 6.1.0.redhat-379 + Switchyard 2.0.0.Alpha3 - sometimes (20%)
Karaf 2.3.8 + Switchyard 2.0.0.Alpha3 - OK

=== Steps to Reproduce (on JBoss Fuse)
1. rm -rf data instances
2. ./bin/fuse
3. features:addurl mvn:org.switchyard.karaf/switchyard/2.0.0.Alpha3/xml/core-features
4. features:install -v switchyard-quickstart-camel-jpa-binding
5. log:display

=== Actual results:
Full error log is enclosed.

=== Expected results:
2014-10-21 13:25:05,006 | INFO  | amel-2_Worker-10 | PeriodicServiceImpl              | ?                                   ? | 333 - org.switchyard.quickstarts.switchyard-camel-jpa-binding - 2.0.0.Alpha3 | Sending Greet [null, from Tom, to Lukasz, created on Tue Oct 21 13:25:05 CEST 2014] to JPA store
2014-10-21 13:25:05,405 | INFO  | ing.domain.Greet | GreetingServiceBean              | ?                                   ? | 333 - org.switchyard.quickstarts.switchyard-camel-jpa-binding - 2.0.0.Alpha3 | Hey Lukasz please receive greetings from Tom sent at 13:25:05:006

Comment 1 Martin Basovník 2014-10-21 11:29:45 UTC
Created attachment 948900 [details]
switchyard-camel-jpa-binding error

Comment 2 Martin Basovník 2014-10-22 10:19:02 UTC
Better reproducer:
1. features:install -v switchyard-quickstart-camel-jpa-binding
2. Check if it works (log:display), if so continue in step 3
3. osgi:refresh <ID-switchyard-camel-jpa-binding>
4. log:display -> you will get reported error

See: https://github.com/jboss-switchyard/release/blob/2.0.0.Alpha3/karaf/features/src/main/resources/features.xml#L470

If I have already installed bundle 'hibernate-osgi' and I try to install a switchyard application with JPA support, it fails. Then I have to refresh 'hibernate-osgi' bundle to register 'EntityManagerFactory' service.

Moreover, my bundle will not have registered service 'SwitchYardContainer'. So I have to stop my bundle and restart it. 'Switchyard-deploy' bundle will then register this service. 

I think that there can be also problem with ordering of registration of services 'EntityManagerFactory' and 'SwitchYardContainer'.

Comment 3 Gomathi Anandan 2014-10-24 18:44:05 UTC
Resetting the flags back to the state it was before Oct-24- 2PM. There was an incorrect bulk update that I'm trying to fix.

Comment 4 Rob Cernich 2014-10-30 19:08:58 UTC
(In reply to Martin Basovník from comment #2)
> Better reproducer:
> 1. features:install -v switchyard-quickstart-camel-jpa-binding
> 2. Check if it works (log:display), if so continue in step 3
> 3. osgi:refresh <ID-switchyard-camel-jpa-binding>
> 4. log:display -> you will get reported error
> 
> See:
> https://github.com/jboss-switchyard/release/blob/2.0.0.Alpha3/karaf/features/
> src/main/resources/features.xml#L470
> 
> If I have already installed bundle 'hibernate-osgi' and I try to install a
> switchyard application with JPA support, it fails. Then I have to refresh
> 'hibernate-osgi' bundle to register 'EntityManagerFactory' service.
> 
> Moreover, my bundle will not have registered service 'SwitchYardContainer'.
> So I have to stop my bundle and restart it. 'Switchyard-deploy' bundle will
> then register this service. 
> 
> I think that there can be also problem with ordering of registration of
> services 'EntityManagerFactory' and 'SwitchYardContainer'.

I don't know if this can be fixed as hibernate-osgi needs to be installed/activated after the bundle using jpa.  This issue may be corrected in the newer version of Karaf/Hibernate as Karaf 2.4 provides a hibernate jpa feature.

Comment 8 Red Hat Bugzilla 2025-02-10 03:43:22 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.