Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Possible JpoxHelper bug; Custom PMFCreator not honoured
Possible JpoxHelper bug; Custom PMFCreator not honoured [message #112615] Tue, 19 February 2008 09:52 Go to next message
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Hi!

I'm trying to use Teneo with the standard JPOX plugin (copied to
eclipse/plugins) within an RCP application. According to [1] I need to
create the PersistenceManagerFactory like this:

//set classloader for driver (using classloader from the "rcp.jars" bundle)
ClassLoader clrDriver =
Platform.getBundle("rcp.jars").loadClass("org.h2.Driver").getClassLoader();
map.put("org.jpox.primaryClassLoader", clrDriver);

//set classloader for JPOX (using classloader from the "org.jpox" bundle)
ClassLoader clrJPOX =
Platform.getBundle("org.jpox").loadClass("org.jpox.PersistenceManagerFactoryImpl ").getClassLoader()

PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(map,
clrJPOX);

Otherwise, the database driver cannot be loaded. With Teneo this procedure
should involve creating a custom PMFCreator and setting it via:
JpoxHelper.INSTANCE.setPMFCreator(pmfCreator);
This pmfCreator would then create the persistence manager factory in it's
method
getPersistenceManagerFactory()
like the code above. There is one problem however. JpoxDataStore on line 526
in createSchema(), doesn't use JpoxHelper to get a persistence manager
factory, but instead uses JDOHelper. Is that a bug? I'd say yes, because it
uses JpoxHelper in it's initialize() method. Is there a workaround
available? Placing the jpox plugin jar file within another plugin doesn't
work in my case, because I need the extension points which are registered
by the jpox plugin.

Cheers,
Florian

[1] http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageI d=1179712
--
Florian Hackenberger
Re: Possible JpoxHelper bug; Custom PMFCreator not honoured [message #112693 is a reply to message #112615] Wed, 20 February 2008 15:44 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Florian,
This indeed seems like a bug, can you enter a bugzilla for this?

For now you can extend the jpoxdatastore and override the createschema method.

gr. Martin

DI Florian Hackenberger wrote:
> Hi!
>
> I'm trying to use Teneo with the standard JPOX plugin (copied to
> eclipse/plugins) within an RCP application. According to [1] I need to
> create the PersistenceManagerFactory like this:
>
> //set classloader for driver (using classloader from the "rcp.jars" bundle)
> ClassLoader clrDriver =
> Platform.getBundle("rcp.jars").loadClass("org.h2.Driver").getClassLoader();
> map.put("org.jpox.primaryClassLoader", clrDriver);
>
> //set classloader for JPOX (using classloader from the "org.jpox" bundle)
> ClassLoader clrJPOX =
> Platform.getBundle("org.jpox").loadClass("org.jpox.PersistenceManagerFactoryImpl ").getClassLoader()
>
> PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(map,
> clrJPOX);
>
> Otherwise, the database driver cannot be loaded. With Teneo this procedure
> should involve creating a custom PMFCreator and setting it via:
> JpoxHelper.INSTANCE.setPMFCreator(pmfCreator);
> This pmfCreator would then create the persistence manager factory in it's
> method
> getPersistenceManagerFactory()
> like the code above. There is one problem however. JpoxDataStore on line 526
> in createSchema(), doesn't use JpoxHelper to get a persistence manager
> factory, but instead uses JDOHelper. Is that a bug? I'd say yes, because it
> uses JpoxHelper in it's initialize() method. Is there a workaround
> available? Placing the jpox plugin jar file within another plugin doesn't
> work in my case, because I need the extension points which are registered
> by the jpox plugin.
>
> Cheers,
> Florian
>
> [1] http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageI d=1179712


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Possible JpoxHelper bug; Custom PMFCreator not honoured [message #113152 is a reply to message #112693] Mon, 25 February 2008 08:20 Go to previous messageGo to next message
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Martin Taal wrote:

> Hi Florian,
> This indeed seems like a bug, can you enter a bugzilla for this?
>
> For now you can extend the jpoxdatastore and override the createschema
> method.
It's the following buzilla entry:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=220145

BTW: Another workaround is to install the JPOX plugin in eclipse (in order
to make eclipse find the extension points) and just use the standard
approach of putting all jars (jpox, jdo, jdbc driver) into one plugin on
which your teneo enabled project depends. It seems like the extension
points are actually enabled once the jar within the plugin is loaded, but
eclipse does not 'see' them during development.

Cheers,
Florian

--
Florian Hackenberger
Re: Possible JpoxHelper bug; Custom PMFCreator not honoured [message #113196 is a reply to message #113152] Mon, 25 February 2008 17:37 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Florian,
Thanks for reporting several things, I have seen your bugzillas. I will solve them in the next build
(few weeks, before eclipsecon).

gr. martin

DI Florian Hackenberger wrote:
> Martin Taal wrote:
>
>> Hi Florian,
>> This indeed seems like a bug, can you enter a bugzilla for this?
>>
>> For now you can extend the jpoxdatastore and override the createschema
>> method.
> It's the following buzilla entry:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=220145
>
> BTW: Another workaround is to install the JPOX plugin in eclipse (in order
> to make eclipse find the extension points) and just use the standard
> approach of putting all jars (jpox, jdo, jdbc driver) into one plugin on
> which your teneo enabled project depends. It seems like the extension
> points are actually enabled once the jar within the plugin is loaded, but
> eclipse does not 'see' them during development.
>
> Cheers,
> Florian
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Possible JpoxHelper bug; Custom PMFCreator not honoured [message #615519 is a reply to message #112615] Wed, 20 February 2008 15:44 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Florian,
This indeed seems like a bug, can you enter a bugzilla for this?

For now you can extend the jpoxdatastore and override the createschema method.

gr. Martin

DI Florian Hackenberger wrote:
> Hi!
>
> I'm trying to use Teneo with the standard JPOX plugin (copied to
> eclipse/plugins) within an RCP application. According to [1] I need to
> create the PersistenceManagerFactory like this:
>
> //set classloader for driver (using classloader from the "rcp.jars" bundle)
> ClassLoader clrDriver =
> Platform.getBundle("rcp.jars").loadClass("org.h2.Driver").getClassLoader();
> map.put("org.jpox.primaryClassLoader", clrDriver);
>
> //set classloader for JPOX (using classloader from the "org.jpox" bundle)
> ClassLoader clrJPOX =
> Platform.getBundle("org.jpox").loadClass("org.jpox.PersistenceManagerFactoryImpl ").getClassLoader()
>
> PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(map,
> clrJPOX);
>
> Otherwise, the database driver cannot be loaded. With Teneo this procedure
> should involve creating a custom PMFCreator and setting it via:
> JpoxHelper.INSTANCE.setPMFCreator(pmfCreator);
> This pmfCreator would then create the persistence manager factory in it's
> method
> getPersistenceManagerFactory()
> like the code above. There is one problem however. JpoxDataStore on line 526
> in createSchema(), doesn't use JpoxHelper to get a persistence manager
> factory, but instead uses JDOHelper. Is that a bug? I'd say yes, because it
> uses JpoxHelper in it's initialize() method. Is there a workaround
> available? Placing the jpox plugin jar file within another plugin doesn't
> work in my case, because I need the extension points which are registered
> by the jpox plugin.
>
> Cheers,
> Florian
>
> [1] http://www.jpox.org/servlet/wiki/pages/viewpage.action?pageI d=1179712


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: Possible JpoxHelper bug; Custom PMFCreator not honoured [message #615554 is a reply to message #112693] Mon, 25 February 2008 08:20 Go to previous message
Florian Hackenberger is currently offline Florian HackenbergerFriend
Messages: 123
Registered: July 2009
Senior Member
Martin Taal wrote:

> Hi Florian,
> This indeed seems like a bug, can you enter a bugzilla for this?
>
> For now you can extend the jpoxdatastore and override the createschema
> method.
It's the following buzilla entry:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=220145

BTW: Another workaround is to install the JPOX plugin in eclipse (in order
to make eclipse find the extension points) and just use the standard
approach of putting all jars (jpox, jdo, jdbc driver) into one plugin on
which your teneo enabled project depends. It seems like the extension
points are actually enabled once the jar within the plugin is loaded, but
eclipse does not 'see' them during development.

Cheers,
Florian

--
Florian Hackenberger
Re: Possible JpoxHelper bug; Custom PMFCreator not honoured [message #615557 is a reply to message #113152] Mon, 25 February 2008 17:37 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Florian,
Thanks for reporting several things, I have seen your bugzillas. I will solve them in the next build
(few weeks, before eclipsecon).

gr. martin

DI Florian Hackenberger wrote:
> Martin Taal wrote:
>
>> Hi Florian,
>> This indeed seems like a bug, can you enter a bugzilla for this?
>>
>> For now you can extend the jpoxdatastore and override the createschema
>> method.
> It's the following buzilla entry:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=220145
>
> BTW: Another workaround is to install the JPOX plugin in eclipse (in order
> to make eclipse find the extension points) and just use the standard
> approach of putting all jars (jpox, jdo, jdbc driver) into one plugin on
> which your teneo enabled project depends. It seems like the extension
> points are actually enabled once the jar within the plugin is loaded, but
> eclipse does not 'see' them during development.
>
> Cheers,
> Florian
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Previous Topic:Using Ecore instrospection vs Java introspection in Teneo
Next Topic:[Teneo] newbie question: Using Teneo with Existing Database
Goto Forum:
  


Current Time: Tue Aug 03 15:31:53 GMT 2021

Powered by FUDForum. Page generated in 0.03093 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top