Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gemini » How can I outsource persistence.xml plugin in a fragment?
How can I outsource persistence.xml plugin in a fragment? [message #1184235] Wed, 13 November 2013 05:09 Go to next message
Ronald Joseph is currently offline Ronald Joseph
Messages: 10
Registered: December 2012
Junior Member
Hello,

I have the following problem:

In my project I want to create a plug-in fragment, in which I store the persistence.xml for different database configurations. So a fragment of Derby and a second fragment for PostgreSQL.

Which fragment is used, I want to define the product configuration.

The goal is to create a product configuration for local testing (eg Derby) and one for the later production use (eg with PostgreSQL). For export of the whole application I then use just the right product configuration.

So I have the persistence.xml moved from the current persistence plugin in a fragment plugin.

When I start the application (with the fragment-plugin) I get the following console log:

----schnipp----
  :::
  com.hds.service.bundle_1.5.0.qualifier [101]
  com.hds.persistence.derby_1.5.0.qualifier [107]
  com.hds.persistence.bundle_1.5.0.qualifier [108]
WARNING: Extender - Refreshing disabled - entities in bundle com.hds.persistence.derby may not be woven
Extender.tryAssigningPersistenceUnitsInBundle:  bundle=com.hds.persistence.derby id=107 state=RESOLVED
Looking for persistence descriptors in bundle com.hds.persistence.derby
Found persistence descriptors: [Descriptor: META-INF/persistence.xml]
Parsing persistence descriptor META-INF/persistence.xml
PersistenceDescriptorInfo.getDescriptorStream - url=bundleentry://107.fwk1143052075/META-INF/persistence.xml descPath=META-INF/persistence.xml jarPath=null
Finished parsing persistence descriptor bundleentry://107.fwk1143052075/META-INF/persistence.xml
Found 1 persistence units
Parsed persistence descriptors: [
PUnit: hdsPersistence
  --- XML Data ---
  provider: org.eclipse.persistence.jpa.PersistenceProvider
  classes: [....]
  driverClassName: org.apache.derby.jdbc.ClientDriver
  driverUrl: jdbc:derby://localhost:1527/hdsDB2;create=true
  --- Runtime Data ---
  descriptorInfo: Descriptor: META-INF/persistence.xml]
Assigning punit hdsPersistence to this provider
Manager.preResolve, bundle: com.hds.persistence.derby
Gemini JPA started
Extender - bundle event: STARTED  bundle=org.eclipse.gemini.jpa

   :::

Extender - bundle event: STARTED  bundle=org.eclipse.core.runtime
Extender - bundle event: STARTING  bundle=com.hds.service.bundle
Extender - bundle event: STARTED  bundle=com.hds.service.bundle
Extender - bundle event: STARTING  bundle=com.hds.data.bundle
Extender - bundle event: STARTED  bundle=com.hds.data.bundle
Extender - bundle event: STARTING  bundle=com.hds.persistence.bundle
Extender - bundle event: STARTED  bundle=com.hds.persistence.bundle
Extender - bundle event: STARTED  bundle=org.eclipse.osgi
   :::
----schnapp----


The bundle [107] is the fragment to [108] and obviously the PU is found by Gemini.

However, no EntityManagerFactory is generated.

I start the application without the fragment (with correct values ​​in the MANIFEST.MF), I get the following console log:

----schnipp----
  com.hds.service.bundle_1.5.0.qualifier [101]
  com.hds.persistence.bundle_1.5.0.qualifier [109]
WARNING: Extender - Refreshing disabled - entities in bundle com.hds.persistence.bundle may not be woven
Extender.tryAssigningPersistenceUnitsInBundle:  bundle=com.hds.persistence.bundle id=109 state=RESOLVED
Looking for persistence descriptors in bundle com.hds.persistence.bundle
Found persistence descriptors: [Descriptor: META-INF/persistence.xml]
Parsing persistence descriptor META-INF/persistence.xml
PersistenceDescriptorInfo.getDescriptorStream - url=bundleentry://109.fwk1455900648/META-INF/persistence.xml descPath=META-INF/persistence.xml jarPath=null
Finished parsing persistence descriptor bundleentry://109.fwk1455900648/META-INF/persistence.xml
Found 1 persistence units
Parsed persistence descriptors: [
PUnit: hdsPersistence
  --- XML Data ---
  provider: org.eclipse.persistence.jpa.PersistenceProvider
  classes: [com.hds.persistence.data.host.HostDObj, com.hds.persistence.data.log.ConsoleLogMessageDObj, com.hds.persistence.data.device.DeviceDObj, com.hds.persistence.data.log.AbstractLogMessageDObj, com.hds.persistence.data.job.GenericJobDObj, com.hds.persistence.data.log.LogDObj, com.hds.persistence.data.service.ServiceDObj, com.hds.persistence.data.mountpoint.MountPointDObj, com.hds.persistence.data.log.ModuleLogMessageDObj, com.hds.persistence.data.host.DatabaseDObj, com.hds.persistence.data.application.ShadowImageApplicationDObj, com.hds.persistence.data.log.GenericLogMessageDObj]
  driverClassName: org.apache.derby.jdbc.ClientDriver
  driverUrl: jdbc:derby://localhost:1527/hdsDB2;create=true
  --- Runtime Data ---
  descriptorInfo: Descriptor: META-INF/persistence.xml]
Assigning punit hdsPersistence to this provider
Manager.preResolve, bundle: com.hds.persistence.bundle
RegisterTransformer found unitInfo in punits for hdsPersistence
RegisterTransformer - no weaving service exists yet for hdsPersistence
ServicesUtil successfully registered weaving hook for hdsPersistence
Gemini JPA started
Extender - bundle event: STARTED  bundle=org.eclipse.gemini.jpa

   :::

Extender - bundle event: STARTED  bundle=org.eclipse.core.runtime
Extender - bundle event: STARTING  bundle=com.hds.service.bundle
Extender - bundle event: STARTING  bundle=com.hds.data.bundle
Extender - bundle event: STARTED  bundle=com.hds.data.bundle
Extender - bundle event: STARTED  bundle=com.hds.service.bundle
Extender - bundle event: STARTING  bundle=com.hds.persistence.bundle
Extender.registerPersistenceUnitsInBundle:  bundle=com.hds.persistence.bundle id=109 state=STARTING
Extender - checking bundle compatibility of:  bundle=com.hds.persistence.bundle id=109 state=STARTING
Extender provider compatible with bundle:  bundle=com.hds.persistence.bundle id=109 state=STARTING
Manager.registerPersistenceUnits: [
PUnit: hdsPersistence
  --- XML Data ---
  provider: org.eclipse.persistence.jpa.PersistenceProvider
  classes: [.....]
  driverClassName: org.apache.derby.jdbc.ClientDriver
  driverUrl: jdbc:derby://localhost:1527/hdsDB2;create=true
  --- Runtime Data ---
  bundle: com.hds.persistence.bundle
  assignedProvider: org.eclipse.gemini.jpa.ProviderWrapper@7c6b3d66
  descriptorInfo: Descriptor: META-INF/persistence.xml]
ServicesUtil.registerEMFServices for hdsPersistence
ServicesUtil.buildServiceProps: 
  key: osgi.managed.bundles value: com.hds.persistence.bundle_1.5.0.qualifier
  key: osgi.unit.version value: 1.5.0.qualifier
  key: osgi.unit.name value: hdsPersistence
  key: osgi.unit.provider value: org.eclipse.persistence.jpa.PersistenceProvider
ServicesUtil.tryToRegisterEMF service for hdsPersistence
Loading class javax.persistence.EntityManagerFactory from bundle org.eclipse.gemini.jpa_1.2.0.qualifier [70]
ServicesUtil EMF proxy class array: 
  interface javax.persistence.EntityManagerFactory
ServicesUtil created EMF proxy 
ServicesUtil trackDataSourceFactory for p-unit hdsPersistence
ServicesUtil starting tracker on existing DSF for hdsPersistence
DSF service props: {osgi.jdbc.driver.version=3.0, osgi.jdbc.driver.name=Derby, service.id=35, osgi.jdbc.driver.class=org.apache.derby.jdbc.ClientDriver, objectClass=[Ljava.lang.String;@b7425e0}
OfflineTracker.addingService - not concerned with added service {org.osgi.service.jdbc.DataSourceFactory}={osgi.jdbc.driver.class=org.apache.derby.jdbc.ClientDriver, osgi.jdbc.driver.version=3.0, osgi.jdbc.driver.name=Derby, service.id=35}
Nov 13, 2013 10:39:07 AM com.hds.service.internal.HDSServiceBundleActivator addingService
INFO: addingService ({javax.persistence.EntityManagerFactory}={osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier, osgi.unit.version=1.5.0.qualifier, osgi.unit.name=hdsPersistence, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=80}) ...
Nov 13, 2013 10:39:07 AM com.hds.service.internal.HDSServiceBundleActivator addingService
INFO: unitName:=hdsPersistence
EMFProxy invocation on method toString
EMFProxy invocation on method createEntityManager
EMFProxy - getEMF for punit hdsPersistence emf=null
EMFProxy creating new EMF for hdsPersistence
ProviderWrapper createEMF invoked for p-unit: hdsPersistence props: {}
DataSourceUtil.acquireDataSource - for punit hdsPersistence
DataSourceUtil.checkForNonJtaDataSource - no data source
DataSourceUtil - Using existing DSF service ref from punit hdsPersistence
DataSourceUtil.getJDBCProperties
  fromMap: {}
  fromDescriptor: 
PUnit: hdsPersistence
  --- XML Data ---
  provider: org.eclipse.persistence.jpa.PersistenceProvider
  classes: [....]
  driverClassName: org.apache.derby.jdbc.ClientDriver
  driverUrl: jdbc:derby://localhost:1527/hdsDB2;create=true
  --- Runtime Data ---
  bundle: com.hds.persistence.bundle
  assignedProvider: org.eclipse.gemini.jpa.ProviderWrapper@7c6b3d66
  descriptorInfo: Descriptor: META-INF/persistence.xml
  DSF tracker: org.osgi.util.tracker.ServiceTracker@f1397b9
DataSourceUtil.getJDBCProperties - returning: 
  key: url value: jdbc:derby://localhost:1527/hdsDB2;create=true
RegisterTransformer looked in manager to find unitInfo for hdsPersistence
RegisterTransformer - weaving service already existed for hdsPersistence
EMFProxy invocation on method toString
EMFProxy invocation on method toString
[GEMINI_EXT][TRACE][GeminiEMFSupplier] bindEntityManagerFactory() with {osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, osgi.unit.name=hdsPersistence, osgi.unit.version=1.5.0.qualifier, service.id=80, objectClass=[Ljava.lang.String;@70aaacc0, osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier} toString: org.eclipse.gemini.jpa.proxy.EMFServiceProxyHandler@7463db7e
EMFProxy invocation on method toString
[GEMINI_EXT][TRACE][GeminiEMSupplier] bindEntityManagerFactory() with {osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, osgi.unit.name=hdsPersistence, osgi.unit.version=1.5.0.qualifier, service.id=80, objectClass=[Ljava.lang.String;@5533ab09, osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier} toString: org.eclipse.gemini.jpa.proxy.EMFServiceProxyHandler@7463db7e
ServicesUtil EMF service: {javax.persistence.EntityManagerFactory}={osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier, osgi.unit.version=1.5.0.qualifier, osgi.unit.name=hdsPersistence, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=80}
ServicesUtil.registerEMFBuilder service for hdsPersistence
Loading class org.osgi.service.jpa.EntityManagerFactoryBuilder from bundle org.eclipse.gemini.jpa_1.2.0.qualifier [70]
ServicesUtil EMFBuilder proxied classes: [interface org.osgi.service.jpa.EntityManagerFactoryBuilder]
ServicesUtil created EMFBuilder proxy 
[GEMINI_EXT][TRACE][GeminiEMFSupplier] bindEntityManagerFactoryBuilder() with {osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, osgi.unit.name=hdsPersistence, osgi.unit.version=1.5.0.qualifier, service.id=84, objectClass=[Ljava.lang.String;@39f5e6b9, osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier}
[GEMINI_EXT][TRACE][GeminiEMSupplier] bindEntityManagerFactoryBuilder() with {osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, osgi.unit.name=hdsPersistence, osgi.unit.version=1.5.0.qualifier, service.id=84, objectClass=[Ljava.lang.String;@3efe9969, osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier}
ServicesUtil EMFBuilder service: {org.osgi.service.jpa.EntityManagerFactoryBuilder}={osgi.managed.bundles=com.hds.persistence.bundle_1.5.0.qualifier, osgi.unit.version=1.5.0.qualifier, osgi.unit.name=hdsPersistence, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=84}
Extender - bundle event: STARTED  bundle=com.hds.persistence.bundle
  :::
----schnapp----


The bundle [109] contains everything what is important.

The class BundleActivator looks like this:
/**
 * 
 */
package com.hds.service.internal;

import [.... many ....]

/**
 * @author rjh
 * @version $Id$
 * @since 30.11.2012 12:42:43
 */
public class HDSServiceBundleActivator implements BundleActivator, ServiceTrackerCustomizer {

  private Log log = LogFactory.getLog (HDSServiceBundleActivator.class);
  
  protected ServiceTracker emfTracker;
  protected ServiceTracker dsfTracker;
  protected BundleContext ctx;
  protected ServiceRegistration emfServiceReg;
  protected ServiceTracker <?, ?> embfTracker;
  
  /**
   * 
   */
  public HDSServiceBundleActivator () {
    super ();
  }

  @Override
  public void start (BundleContext context) throws Exception {

    log.info ("HDS Service DBAccess starting");
    ctx = context;

    emfTracker = new ServiceTracker (
      ctx, 
      EntityManagerFactory.class.getName (),
      this);
    emfTracker.open ();
 
    dsfTracker = new ServiceTracker (
      ctx, 
      DataSourceFactory.class.getName(), 
      this);
    dsfTracker.open();
    
  }

  @Override
  public void stop (BundleContext context) throws Exception {
    emfTracker.close();    
    
    dsfTracker.close();        
  }
  
  @Override
  public Object addingService (ServiceReference reference) {
    Object service = null;
    Bundle b = null;
    String unitName = null;
    
    log.info ("addingService (" + reference + ") ...");
    
    b = reference.getBundle ();
    service = b.getBundleContext().getService(reference);
    unitName = (String) reference.getProperty(EntityManagerFactoryBuilder.JPA_UNIT_NAME);

    if (unitName != null && unitName.equals("hdsPersistence")) {
       // new LibraryClient().run((EntityManagerFactory)service);
      log.info ("unitName:=" + unitName);

      GenericDataServiceImpl gdsi = new GenericDataServiceImpl ();
      gdsi.setEMF ((EntityManagerFactory)service);
    }
    
    return service;
  }

  @Override
  public void modifiedService (ServiceReference reference, Object service) {

    log.info ("modifiedService (" + reference + ", " + service + ')');
    
  }

  @Override
  public void removedService (ServiceReference reference, Object service) {

    log.info ("removedService (" + reference + ", " + service + ')');
    
  }

  protected void showProperties (ServiceReference <?> ref) {
    String keys [] = null;
    StringBuffer sb = null;
    
    log.info ("showProperties (" + ref + ")...");
    keys = ref.getPropertyKeys ();
    for (int i = 0; i < keys.length; i++) {
      sb = new StringBuffer (128);
      sb.append ("  ");
      sb.append (keys [i]);
      sb.append (":=");
      sb.append (ref.getProperty (keys [i]));
      log.info (sb.toString ());
    }
  }
  
}



Does anyone have an idea what I need to do to reach the goal described above?

Thank you.
Greeting Ronald

[Updated on: Wed, 13 November 2013 07:55]

Report message to a moderator

Re: How can I outsource persistence.xml plugin in a fragment? [message #1184551 is a reply to message #1184235] Wed, 13 November 2013 09:33 Go to previous messageGo to next message
Mike Keith is currently offline Mike Keith
Messages: 211
Registered: July 2009
Senior Member
Hi Ronald,

Fragments are not supported in OSGi JPA, but the configuration admin service is and there is a good chance it will support what you are hoping to achieve. You can define the database properties in different configs and apply the relevant config for a given environment. See the doc on config admin for more info:

http://wiki.eclipse.org/Gemini/JPA/Documentation/OtherTopics#Configuration_Admin

Hope this helps.

-Mike
Re: How can I outsource persistence.xml plugin in a fragment? [message #1185918 is a reply to message #1184551] Thu, 14 November 2013 05:55 Go to previous messageGo to next message
Ronald Joseph is currently offline Ronald Joseph
Messages: 10
Registered: December 2012
Junior Member
Hello Mike,

that sounds good.

I have looked at the example from git://git.eclipse.org/gitroot/gemini.jpa/org.eclipse.gemini.jpa.git.

Something I do not understand it. Probably a tiny little thing.

I have created a Run Configuration for an OSGi framework.
Default start level is 7, default startup is false.

The following bundles which include:
(bundle, start level, autostart)
org.apache.derby, 3, true
org.eclipse.gemini.dbaccess.derby, 4, true
org.eclipse.gemini.dbaccess.util, def, def
org.eclipse.gemini.jpa, 5, true
org.eclipse.gemini.jpa.sample.configadmin, 7, true
org.eclipse.gemini.jpa.sample.configadmin.gen, def, true
org.eclipse.gemini.jpa.sample.configadmin.pu, 6, true
javax.persistence, 1,true
javax.servlet, def, def
javax.xml, def, def
org.eclispe.osgi, -1, true
org.eclispe.osgi.services, def, def
org.eclispe.osgi.util, def, def
org.eclispe.persistence.antlr, def, def
org.eclispe.persistence.asm, def, def
org.eclispe.persistence.core, def, def
org.eclispe.persistence.jpa, def, def
org.eclispe.persistence.jpa.jpql, def, def


I use as a parameter -DGEMINI_DEBUG=true.

Here's the log:
Gemini DBAccess - Derby JDBC starting
org.eclipse.gemini.dbaccess.derby.Activator.start(org.eclipse.osgi.framework.internal.core.BundleContextImpl@6a33f2cf)...
org.eclipse.gemini.dbaccess.derby.Activator.start(...)::embeddedService:={org.osgi.service.jdbc.DataSourceFactory}={osgi.jdbc.driver.class=org.apache.derby.jdbc.EmbeddedDriver, osgi.jdbc.driver.version=3.0, osgi.jdbc.driver.name=Derby, service.id=27}
org.eclipse.gemini.dbaccess.derby.Activator.start(...)::clientService:={org.osgi.service.jdbc.DataSourceFactory}={osgi.jdbc.driver.class=org.apache.derby.jdbc.ClientDriver, osgi.jdbc.driver.version=3.0, osgi.jdbc.driver.name=Derby, service.id=28}
org.eclipse.gemini.dbaccess.derby.Activator.start(...)::embeddedService4:={org.osgi.service.jdbc.DataSourceFactory}={osgi.jdbc.driver.class=org.apache.derby.jdbc.EmbeddedDriver, osgi.jdbc.driver.version=4.0, osgi.jdbc.driver.name=Derby, service.id=29}
org.eclipse.gemini.dbaccess.derby.Activator.start(...)::clientService4:={org.osgi.service.jdbc.DataSourceFactory}={osgi.jdbc.driver.class=org.apache.derby.jdbc.ClientDriver, osgi.jdbc.driver.version=4.0, osgi.jdbc.driver.name=Derby, service.id=30}
org.eclipse.gemini.dbaccess.derby.Activator.start(org.eclipse.osgi.framework.internal.core.BundleContextImpl@6a33f2cf) FINISHED
Gemini JPA starting...
ServicesUtil.RegisterProviderService for org.eclipse.persistence.jpa.PersistenceProvider
ServicesUtil successfully registered provider service for org.eclipse.persistence.jpa.PersistenceProvider
ConfigAdminListener registering
ConfigAdminListener registered
Extender.startListening
Extender.lookForExistingBundles: 
  org.eclipse.osgi_3.9.1.v20130814-1242 [0]
  org.eclipse.persistence.core_2.5.1.v20130824-981335c [1]
  javax.servlet_3.0.0.v201112011016 [2]
  org.apache.derby_10.8.2.2 [3]
  org.eclipse.osgi.util_3.2.300.v20130513-1956 [4]
  org.eclipse.gemini.jpa_1.2.0.qualifier [5]
  org.eclipse.persistence.asm_3.3.1.v201302191223 [6]
  org.eclipse.gemini.dbaccess.util_1.1.0.qualifier [7]
  javax.xml_1.3.4.v201005080400 [8]
  org.eclipse.gemini.jpa.sample.configadmin.gen_1.2.0.qualifier [9]
  javax.persistence_2.1.0.v201304241213 [10]
  org.eclipse.gemini.dbaccess.derby_1.1.0.qualifier [11]
  osgi.enterprise_4.2.0.201003190513 [12]
  org.eclipse.persistence.antlr_3.2.0.v201302191141 [13]
  org.eclipse.persistence.jpa.jpql_2.5.1.v20130824-981335c [14]
  org.eclipse.persistence.jpa_2.5.1.v20130824-981335c [15]
  org.eclipse.gemini.jpa.sample.configadmin.pu_1.2.0.qualifier [16]
  org.eclipse.osgi.services_3.3.100.v20130513-1956 [17]
  org.eclipse.gemini.jpa.sample.configadmin_1.2.0.qualifier [18]
Gemini JPA started
Extender - bundle event: STARTED  bundle=org.eclipse.gemini.jpa
Extender - bundle event: STARTING  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
Extender - bundle event: STARTED  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
Extender.refreshBundle:  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu id=16 state=ACTIVE
Extender - bundle event: STARTED  bundle=org.eclipse.osgi
!SESSION 2013-11-14 11:30:37.064 --------------Extender - bundle event: STOPPING  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
---------------------------------
Extender - bundle event: STOPPED  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
eclipse.buildId=unknown
Extender - bundle event: UNRESOLVED  bundle=org.eclipse.gemini.jpa.sample.configadmin
java.version=1.7.0_25
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Command-line arguments:  -dev file:C:/Users/rjh/ws-indigo/hds-eclipse_v1.5/.metadata/.plugins/org.eclipse.pde.core/OSGi Framework/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console

!ENTRY org.eclipse.osgi 4 0 2013-11-14 11:30:37.864
!MESSAGE Could not find bundle: org.eclipse.equinox.console
Extender - bundle event: UNRESOLVED  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
Extender.tryAssigningPersistenceUnitsInBundle:  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu id=16 state=INSTALLED
Looking for persistence descriptors in bundle org.eclipse.gemini.jpa.sample.configadmin.pu
!STACK 0
org.osgi.framework.BundleException: Could not find bundle: org.eclipse.equinox.console
	at org.eclipse.osgi.framework.internal.core.ConsoleManager.checkForConsoleBundle(ConsoleManager.java:211)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.startup(EclipseStarter.java:298)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Found persistence descriptors: [Descriptor: META-INF/persistence.xml]
Parsing persistence descriptor META-INF/persistence.xml
PersistenceDescriptorInfo.getDescriptorStream - url=bundleentry://16.fwk722833184/META-INF/persistence.xml descPath=META-INF/persistence.xml jarPath=null

!ENTRY org.eclipse.osgi 2 0 2013-11-14 11:30:37.894
!MESSAGE The following is a complete list of bundles which are not resolved, see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-11-14 11:30:37.894
!MESSAGE Bundle org.eclipse.gemini.jpa.sample.configadmin.pu_1.2.0.qualifier [16] was not resolved.
!SUBENTRY 1 org.eclipse.osgi 2 0 2013-11-14 11:30:37.894
!MESSAGE Bundle org.eclipse.gemini.jpa.sample.configadmin_1.2.0.qualifier [18] was not resolved.
Finished parsing persistence descriptor bundleentry://16.fwk722833184/META-INF/persistence.xml
Found 1 persistence units
Parsed persistence descriptors: [
PUnit: Library
  --- XML Data ---
  provider: org.eclipse.persistence.jpa.PersistenceProvider
  classes: [model.configadmin.Library, model.configadmin.Book]
  --- Runtime Data ---
  descriptorInfo: Descriptor: META-INF/persistence.xml]
Assigning punit Library to this provider
Manager.preResolve, bundle: org.eclipse.gemini.jpa.sample.configadmin.pu
RegisterTransformer found unitInfo in punits for Library
RegisterTransformer - no weaving service exists yet for Library
ServicesUtil successfully registered weaving hook for Library
Extender - bundle event: RESOLVED  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
Extender - bundle event: RESOLVED  bundle=org.eclipse.gemini.jpa.sample.configadmin
Extender - bundle event: STARTING  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu
Extender.registerPersistenceUnitsInBundle:  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu id=16 state=STARTING
Extender - checking bundle compatibility of:  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu id=16 state=STARTING
Extender provider compatible with bundle:  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu id=16 state=STARTING
Manager.registerPersistenceUnits: [
PUnit: Library
  --- XML Data ---
  provider: org.eclipse.persistence.jpa.PersistenceProvider
  classes: [model.configadmin.Library, model.configadmin.Book]
  --- Runtime Data ---
  bundle: org.eclipse.gemini.jpa.sample.configadmin.pu
  assignedProvider: org.eclipse.gemini.jpa.ProviderWrapper@5ff924e1
  descriptorInfo: Descriptor: META-INF/persistence.xml]
ServicesUtil.registerEMFServices for Library
ServicesUtil.buildServiceProps: 
  key: osgi.managed.bundles value: org.eclipse.gemini.jpa.sample.configadmin.pu_1.2.0.qualifier
  key: osgi.unit.version value: 1.2.0.qualifier
  key: osgi.unit.name value: Library
  key: osgi.unit.provider value: org.eclipse.persistence.jpa.PersistenceProvider
ServicesUtil.tryToRegisterEMF service for Library
Loading class javax.persistence.EntityManagerFactory from bundle org.eclipse.gemini.jpa_1.2.0.qualifier [5]
ServicesUtil EMF proxy class array: 
  interface javax.persistence.EntityManagerFactory
ServicesUtil created EMF proxy 
ServicesUtil - No driver class or data source specified so no EMF service created
ServicesUtil.registerEMFBuilder service for Library
Loading class org.osgi.service.jpa.EntityManagerFactoryBuilder from bundle org.eclipse.gemini.jpa_1.2.0.qualifier [5]
ServicesUtil EMFBuilder proxied classes: [interface org.osgi.service.jpa.EntityManagerFactoryBuilder]
ServicesUtil created EMFBuilder proxy 
ServicesUtil EMFBuilder service: {org.osgi.service.jpa.EntityManagerFactoryBuilder}={osgi.managed.bundles=org.eclipse.gemini.jpa.sample.configadmin.pu_1.2.0.qualifier, osgi.unit.version=1.2.0.qualifier, osgi.unit.name=Library, osgi.unit.provider=org.eclipse.persistence.jpa.PersistenceProvider, service.id=34}
Extender - bundle event: STARTED  bundle=org.eclipse.gemini.jpa.sample.configadmin.pu


It looks to me like that the configuration worked. But I do miss the start of the sample.configadmin bundles.

I have set two breakpoints in the client.Activator-class. But the debugger does not stop.

Where is my mistake?

Would it be possible in the documentation (your link) to describe one has to do to bring the example to work?

Thank you.
Greeting Ronald
[SOLVED] Re: How can I outsource persistence.xml plugin in a fragment? [message #1190656 is a reply to message #1185918] Sat, 16 November 2013 13:26 Go to previous messageGo to next message
Ronald Joseph is currently offline Ronald Joseph
Messages: 10
Registered: December 2012
Junior Member
Hello Mike,

I get it.

The bundle "org.eclispe.equinox.cm" was missing. After installing "Equinox Target Components" and change the starting level, the example works as expected.

Maybe you could write a corresponding note in the documentation.

Thank you.
Greeting Ronald
Re: [SOLVED] Re: How can I outsource persistence.xml plugin in a fragment? [message #1219622 is a reply to message #1190656] Wed, 04 December 2013 19:45 Go to previous message
Mike Keith is currently offline Mike Keith
Messages: 211
Registered: July 2009
Senior Member
Hi Ronald,

Glad you noticed that you need to add the platform config admin bundle before the config admin sample works. The GettingStarted.txt file in the root of the zipfile does explain this fact (see the last line in the file), but if you downloaded the bundles from P2 then you may not have seen the file at all. Sorry. Anyway, you seem to be up and running now, so that's good.

-Mike
Previous Topic:Spring-DM problem can be solved maybe here?
Next Topic:Gemini JPA runtime problem
Goto Forum:
  


Current Time: Tue Sep 02 10:10:34 EDT 2014

Powered by FUDForum. Page generated in 0.01834 seconds