Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Teneo: .ejdo usage in generated editor
Teneo: .ejdo usage in generated editor [message #67303] Mon, 08 January 2007 15:59 Go to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

This question might stem from either my stupidity
or a lack of documentation in teneo.

I have a working, JPOX-enabled editor-plugin,
with host/db/user/passwd properties
in a jpox.properties file.

I'd like to use the ResourceUtility
http://www.elver.org/jpox/resource_utility.html,

but fail to see how to adapt the initialisation described in
http://www.elver.org/jpox/tutorial2/tutorial2_1.html

I also could not find a snippet using the .ejdo in the examples.

If I use my existing MzdataEditorPlugin.start(BundleContext context)
ths will obviously fail in another setting, so the connection
properties have to be removed.

But then I get "org.eclipse.emf.teneo.jpox.JpoxStoreException: Specific
properties have not been set" et al.

Any hints, or did I miss the obvious somewhere ?

Yours,
Steffen




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFompdir2msrPI0lQRAiP0AJ9Y+3WW4koGWblKo4StTWg2a7fEVQCf SE4t
H+Rn/5rnnjfXnE/M75Nh/VY=
=OqtQ
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #67458 is a reply to message #67303] Mon, 08 January 2007 21:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Or it maybe my documentation writing skills....

What happens if you use the library.ejdo example which available in the
http://www.elver.org/jpox/resource_utility.html (see the hyperlink in the ejdo file section) page
and then change the properties to fit your connection properties and package etc.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> This question might stem from either my stupidity
> or a lack of documentation in teneo.
>
> I have a working, JPOX-enabled editor-plugin,
> with host/db/user/passwd properties
> in a jpox.properties file.
>
> I'd like to use the ResourceUtility
> http://www.elver.org/jpox/resource_utility.html,
>
> but fail to see how to adapt the initialisation described in
> http://www.elver.org/jpox/tutorial2/tutorial2_1.html
>
> I also could not find a snippet using the .ejdo in the examples.
>
> If I use my existing MzdataEditorPlugin.start(BundleContext context)
> ths will obviously fail in another setting, so the connection
> properties have to be removed.
>
> But then I get "org.eclipse.emf.teneo.jpox.JpoxStoreException: Specific
> properties have not been set" et al.
>
> Any hints, or did I miss the obvious somewhere ?
>
> Yours,
> Steffen
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFompdir2msrPI0lQRAiP0AJ9Y+3WW4koGWblKo4StTWg2a7fEVQCf SE4t
> H+Rn/5rnnjfXnE/M75Nh/VY=
> =OqtQ
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #67499 is a reply to message #67458] Tue, 09 January 2007 08:46 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> Hi Steffen,
> Or it maybe my documentation writing skills....
>
> What happens if you use the library.ejdo example which available in the
> http://www.elver.org/jpox/resource_utility.html (see the hyperlink in
> the ejdo file section) page and then change the properties to fit your
> connection properties and package etc.
Yup, that's what I did. My current Editor has a working MzdataEditorPlugin.start(),
including setting up the JpoxDataStore:

public void start(BundleContext context) throws Exception
{
Properties properties = new Properties();
properties.load(MzdataEditor.class.getResourceAsStream("/jpox.properties "));
String pmfName = "mzdata"; // the name of the JpoxDataStore
JpoxDataStore jpoxDataStore = JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
jpoxDataStore.setProperties(properties);
jpoxDataStore.setEPackages(new EPackage[]{MzdataPackage.eINSTANCE});
jpoxDataStore.initialize();

// this is required to force the editor to retrieve the correct resource
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "mzdata", new JPOXResourceFactory());

super.start(context);
}

If I now open the mzData.ejdo, and edit some *.mzdata file,
the editor shows the database content. Fine. (BTW: shouldn't
"Teneo->Open Resource open an Editor ?)

If I change the mzdata.ejdo to point to a different database,
it still shows the database set in the jpox.properties

If I comment out the complete start(), I get an ClassNotFoundException,
if I remove only the JpoDataStore code I get an

org.eclipse.emf.teneo.StoreException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,

even though both mzdata.jdo

name=mzdata
nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd

and MzdataPackage.java have the nsuri in it:

String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";

I think I have set the ResourceFactory settings in
Mzdata.model/plugin.xml correctly as well:

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="mzdata"
class="org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory " />
</extension>

So the real question is what to put into MzdataEditorPlugin.start()
to register the Mzdata EPackage with JPOX ?!

Yours,
Steffen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFo1Zuir2msrPI0lQRAhN2AJ4nppPHMUY14Tqov5NvpjvzHy41lwCg gHRT
vj5h3ot06ikLfqQP3AYT4pM=
=cXF4
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #67541 is a reply to message #67499] Tue, 09 January 2007 09:33 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Can you post the content of the ejdo file?

Yes it should open an editor but this depends if the editor can be found (see the editorextension
description in the sample ejdo file).

That it shows the 'previous' database is maybe because you use the same jpoxdatastore name which you
already set in the start method.

The epackage is registered in a global registry. The resource utility registers the epackage with
jpox but it can't find the epackage using the nsuri. The nsuri registration of an epackage takes
place epackage impl (of mzdatapackageimpl) in the init method or otherwise in a static initializer.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Or it maybe my documentation writing skills....
>>
>> What happens if you use the library.ejdo example which available in the
>> http://www.elver.org/jpox/resource_utility.html (see the hyperlink in
>> the ejdo file section) page and then change the properties to fit your
>> connection properties and package etc.
> Yup, that's what I did. My current Editor has a working MzdataEditorPlugin.start(),
> including setting up the JpoxDataStore:
>
> public void start(BundleContext context) throws Exception
> {
> Properties properties = new Properties();
> properties.load(MzdataEditor.class.getResourceAsStream("/jpox.properties "));
> String pmfName = "mzdata"; // the name of the JpoxDataStore
> JpoxDataStore jpoxDataStore = JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
> jpoxDataStore.setProperties(properties);
> jpoxDataStore.setEPackages(new EPackage[]{MzdataPackage.eINSTANCE});
> jpoxDataStore.initialize();
>
> // this is required to force the editor to retrieve the correct resource
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "mzdata", new JPOXResourceFactory());
>
> super.start(context);
> }
>
> If I now open the mzData.ejdo, and edit some *.mzdata file,
> the editor shows the database content. Fine. (BTW: shouldn't
> "Teneo->Open Resource open an Editor ?)
>
> If I change the mzdata.ejdo to point to a different database,
> it still shows the database set in the jpox.properties
>
> If I comment out the complete start(), I get an ClassNotFoundException,
> if I remove only the JpoDataStore code I get an
>
> org.eclipse.emf.teneo.StoreException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
>
> even though both mzdata.jdo
>
> name=mzdata
> nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
>
> and MzdataPackage.java have the nsuri in it:
>
> String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";
>
> I think I have set the ResourceFactory settings in
> Mzdata.model/plugin.xml correctly as well:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <parser
> type="mzdata"
> class="org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory " />
> </extension>
>
> So the real question is what to put into MzdataEditorPlugin.start()
> to register the Mzdata EPackage with JPOX ?!
>
> Yours,
> Steffen
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFo1Zuir2msrPI0lQRAhN2AJ4nppPHMUY14Tqov5NvpjvzHy41lwCg gHRT
> vj5h3ot06ikLfqQP3AYT4pM=
> =cXF4
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #67563 is a reply to message #67541] Tue, 09 January 2007 10:29 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> Hi Steffen,
> Can you post the content of the ejdo file?
name=mzdata
nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
editorextension=mzdata
dbname=mzdata
dburl=jdbc:postgresql://kons/mzdata
dbuser=sneumann
dbpassword=
dbdriver=org.postgresql.Driver

> Yes it should open an editor but this depends if the editor can be found
> (see the editorextension description in the sample ejdo file).
> That it shows the 'previous' database is maybe because you use the same
> jpoxdatastore name which you already set in the start method.
I habe changed both the pmfName and the ExtensionToFactoryMap
to mzdata2 the start Method, and get the Exception:

- ->started update@plugins/org.eclipse.emf.teneo.jpox.eclipse_0.7.5.v200701051518.jar [442]
org.jpox.exceptions.ClassNotResolvedException: Class de.ipb.msbi.Mzdata.PrecursorListType,org.eclipse.emf.ecore.E Object,org.eclipse.emf.common.notify.Notifier was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:213)
at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:372)
at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:418)
at org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:735)
at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:268)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:73)
at org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:73)
at org.jpox.AbstractPersistenceManager.getStoreManager(Abstract PersistenceManager.java:292)
at org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:214)
at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:42)
at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:178)
at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:153)
at org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:464)
at org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:195)
at org.eclipse.emf.teneo.jpox.JpoxUtil.getCreateDataStore(JpoxU til.java:87)
at org.eclipse.emf.teneo.jpox.eclipse.OpenResource.openDataStor e(OpenResource.java:33)
at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:80)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

> The epackage is registered in a global registry. The resource utility
> registers the epackage with jpox but it can't find the epackage using
> the nsuri. The nsuri registration of an epackage takes place epackage
> impl (of mzdatapackageimpl) in the init method or otherwise in a static
> initializer.

I think the (generated) code has that:

../MzdataPackage.java:
public interface MzdataPackage extends EPackage {
String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";
}

private MzdataPackageImpl() {
public static MzdataPackage init() {
X super(eNS_URI, MzdataFactory.eINSTANCE);
}
}

and setting a breakpoint (at the X position) shows
that MzdataPackage.init() is called.

Steffen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFo256ir2msrPI0lQRAhfYAJsFS+6HCR6o30Vg4sJB/HpNbT0WBwCg kv14
hs6pOsMrMR2QI6yxVtvJH0s=
=RFLa
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #67629 is a reply to message #67563] Tue, 09 January 2007 16:27 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
So you don't get this error anymore?
org.eclipse.emf.teneo.StoreException: EPackage with nsuri:
http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,


I am not sure why it can't find the de.ipb.msbi.Mzdata.PrecursorListType class.
Is this class in a different model package?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Can you post the content of the ejdo file?
> name=mzdata
> nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
> editorextension=mzdata
> dbname=mzdata
> dburl=jdbc:postgresql://kons/mzdata
> dbuser=sneumann
> dbpassword=
> dbdriver=org.postgresql.Driver
>
>> Yes it should open an editor but this depends if the editor can be found
>> (see the editorextension description in the sample ejdo file).
>> That it shows the 'previous' database is maybe because you use the same
>> jpoxdatastore name which you already set in the start method.
> I habe changed both the pmfName and the ExtensionToFactoryMap
> to mzdata2 the start Method, and get the Exception:
>
> - ->started update@plugins/org.eclipse.emf.teneo.jpox.eclipse_0.7.5.v200701051518.jar [442]
> org.jpox.exceptions.ClassNotResolvedException: Class de.ipb.msbi.Mzdata.PrecursorListType,org.eclipse.emf.ecore.E Object,org.eclipse.emf.common.notify.Notifier was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
> at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:213)
> at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:372)
> at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:418)
> at org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:735)
> at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:268)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
> at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:73)
> at org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:73)
> at org.jpox.AbstractPersistenceManager.getStoreManager(Abstract PersistenceManager.java:292)
> at org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:214)
> at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:42)
> at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:178)
> at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:153)
> at org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:464)
> at org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:195)
> at org.eclipse.emf.teneo.jpox.JpoxUtil.getCreateDataStore(JpoxU til.java:87)
> at org.eclipse.emf.teneo.jpox.eclipse.OpenResource.openDataStor e(OpenResource.java:33)
> at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:80)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
> at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
> at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
>
>> The epackage is registered in a global registry. The resource utility
>> registers the epackage with jpox but it can't find the epackage using
>> the nsuri. The nsuri registration of an epackage takes place epackage
>> impl (of mzdatapackageimpl) in the init method or otherwise in a static
>> initializer.
>
> I think the (generated) code has that:
>
> ../MzdataPackage.java:
> public interface MzdataPackage extends EPackage {
> String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";
> }
>
> private MzdataPackageImpl() {
> public static MzdataPackage init() {
> X super(eNS_URI, MzdataFactory.eINSTANCE);
> }
> }
>
> and setting a breakpoint (at the X position) shows
> that MzdataPackage.init() is called.
>
> Steffen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFo256ir2msrPI0lQRAhfYAJsFS+6HCR6o30Vg4sJB/HpNbT0WBwCg kv14
> hs6pOsMrMR2QI6yxVtvJH0s=
> =RFLa
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #67664 is a reply to message #67629] Wed, 10 January 2007 09:53 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> So you don't get this error anymore?
> org.eclipse.emf.teneo.StoreException: EPackage with nsuri:
> http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
No, I have placed a dummy call which registers
the package upon first instanciation of a class
public MzdataEditorPlugin.Implementation() {
super();
MzdataPackage m1 = MzdataPackage.eINSTANCE;
plugin = this;
}

> I am not sure why it can't find the de.ipb.msbi.Mzdata.PrecursorListType
That was because I connected to a different database
that had old package names. Once I realised that is was a sign
that indeed the .ejdo worked ;-)

>>>> Yes it should open an editor but this depends if the editor can be found
>>>> (see the editorextension description in the sample ejdo file).
It still doesn't launch the editor. I have to Teneo->Open Ressource
and then open a dummy *.mzdata file to show the database.

So as posted before I have
mzdata.ejdo:
name=mzdata
editorextension=mzdata
and mzdata.editor/plugin.xml has extensions = "mzdata"

<extension point = "org.eclipse.ui.editors">
<editor
id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
name = "%_UI_MzdataEditor_label"
icon = "icons/full/obj16/MzdataModelFile.gif"
extensions = "mzdata"
class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
contributorClass=" de.ipbhalle.msbi.Mzdata.presentation.MzdataActionBarContribu tor " >
</editor>
</extension>

I am unsure about "IMPORTANT: this should be the same name as used in the calls to JPOXHelper",
because I have nowhere a call to JPOXHelper. (BTW inconcistency: its now JpoxHelper).

Adding JpoxHelper.INSTANCE.createRegisterDataStore("mzdata"); to EditorPlugin.start()
seems not to be enough, but I cant call jpoxDataStore.initialize(); because
I don't know the jdbc properties.

Any hints how the start() should look like to start the Editor
with jdbc properties from the .ejdo ?

Yours,
Steffen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpLeGir2msrPI0lQRAsslAJ9Q70M5eG90mL+f6VZM6BF+2X437QCf flEz
/s89r57MQJF+z4hQWOeX7cM=
=SKRL
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #67726 is a reply to message #67664] Wed, 10 January 2007 15:23 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Eclipse has a default editor definition by extension. Can you check what it says for mzdata?

Have you tried the editorid (instead of editorextension)?

The open resource action should open a JpoxResource. This resource checks if the file for which it
was opened has the ejdo extension, if so it reads the properties and creates/registers a datastore
using those properties. The registration of the ejdo extension is done in the static initializer of
the JpoxHelper. So if the JpoxResource is not started then you probably also need to touch the
JpoxHelper also.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> So you don't get this error anymore?
>> org.eclipse.emf.teneo.StoreException: EPackage with nsuri:
>> http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
> No, I have placed a dummy call which registers
> the package upon first instanciation of a class
> public MzdataEditorPlugin.Implementation() {
> super();
> MzdataPackage m1 = MzdataPackage.eINSTANCE;
> plugin = this;
> }
>
>> I am not sure why it can't find the de.ipb.msbi.Mzdata.PrecursorListType
> That was because I connected to a different database
> that had old package names. Once I realised that is was a sign
> that indeed the .ejdo worked ;-)
>
>>>>> Yes it should open an editor but this depends if the editor can be found
>>>>> (see the editorextension description in the sample ejdo file).
> It still doesn't launch the editor. I have to Teneo->Open Ressource
> and then open a dummy *.mzdata file to show the database.
>
> So as posted before I have
> mzdata.ejdo:
> name=mzdata
> editorextension=mzdata
> and mzdata.editor/plugin.xml has extensions = "mzdata"
>
> <extension point = "org.eclipse.ui.editors">
> <editor
> id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
> name = "%_UI_MzdataEditor_label"
> icon = "icons/full/obj16/MzdataModelFile.gif"
> extensions = "mzdata"
> class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
> contributorClass=" de.ipbhalle.msbi.Mzdata.presentation.MzdataActionBarContribu tor " >
> </editor>
> </extension>
>
> I am unsure about "IMPORTANT: this should be the same name as used in the calls to JPOXHelper",
> because I have nowhere a call to JPOXHelper. (BTW inconcistency: its now JpoxHelper).
>
> Adding JpoxHelper.INSTANCE.createRegisterDataStore("mzdata"); to EditorPlugin.start()
> seems not to be enough, but I cant call jpoxDataStore.initialize(); because
> I don't know the jdbc properties.
>
> Any hints how the start() should look like to start the Editor
> with jdbc properties from the .ejdo ?
>
> Yours,
> Steffen
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFpLeGir2msrPI0lQRAsslAJ9Q70M5eG90mL+f6VZM6BF+2X437QCf flEz
> /s89r57MQJF+z4hQWOeX7cM=
> =SKRL
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor (Solved) [message #67746 is a reply to message #67726] Wed, 10 January 2007 17:06 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Summary (the solution turned up during writing the message,
the rest is only for the records...)

1) Don't open the .ejdo in a text editor and try to teneo->open resource
2) the start() as mentioned in the tutorial can be removed
and _must not_ contain an JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);

I'd suggest modifying the library editor tutorial accordingly,
since even the simple ResourceUtility is better than
hardCoded jdbc porps.

Would you like me to create patches for the tutorial,
or would that be more hassle than dpoing it yourself
for the next release ?

Yours,
Steffen

Martin Taal schrieb:
> Hi Steffen,
> Eclipse has a default editor definition by extension. Can you check what
> it says for mzdata?
In the runtime I have correctly *.mzdata -> Mzdata Model Editor

> Have you tried the editorid (instead of editorextension)?
editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID

doesn't help either. With a completely garbled EditorIDmbmnbmnb
I get the "Unable to open Editor" message box as expected.

> The open resource action should open a JpoxResource. This resource
> checks if the file for which it was opened has the ejdo extension, if so
> it reads the properties and creates/registers a datastore using those
> properties. The registration of the ejdo extension is done in the static
> initializer of the JpoxHelper. So if the JpoxResource is not started
> then you probably also need to touch the JpoxHelper also.

Ah: There is different behaviour if I try to Teneo->open resource,
depending whether the mzdata.ejdo is opened in a (text-) editor in the runtime workbench,
again irrespective whether

a) .ejdo opened: Things are fine
b) .ejdo closed: An (editor) tab named mzdata.ejdo opens with
Unable to create this part due to an internal error. Reason for the failure: An unexpected exception was thrown.
java.lang.NullPointerException
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:935)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:920)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:969)
....
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:91)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
(full trace at the end)

where
public void MzdataEditor.createPages() {
// Creates the model from the editor input
//
969: createModel();
}

and

public void MzdataEditor.createModel() {
// Assumes that the input is a file object.
//
IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPat h().toString());;
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}

920: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);

public Diagnostic MzdataEditor.analyzeResourceProblems(Resource resource, Exception exception) {
935: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =



public void StoreOpenResource.run(IAction action)
{
final File propFile = (File)selection.getFirstElement();
try
{
final Properties props = StoreEclipseUtil.readPropFile(selection);
openDataStore(props);

// now use the editor props to find the correct editor
final String editorextension = doTrim(props.getProperty(Constants.PROP_EDITOR_EXTENSTION));
final String editorid = doTrim(props.getProperty(Constants.PROP_EDITOR_ID));

final String foundEditorID = getEditorID(editorid, editorextension);

// and open it
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
final IWorkbenchPage page = workbenchWindow.getActivePage();
91: page.openEditor(new FileEditorInput(propFile), foundEditorID);


More ideas ?

Yours,
Steffen




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpR0Sir2msrPI0lQRAkHxAJsHcd1NRco9g3MgDNb+2yLMHQ53EACf dxf2
AKA6jhnkZ08dIlV4y81UGlM=
=pWgl
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor (Solved) [message #67873 is a reply to message #67746] Thu, 11 January 2007 12:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Thanks, good that it works.
I will adapt the tutorial. I am not sure if I will completely replace the hard coded jdbc properties
with an ejdo file. I'll probably add a section about using ejdo instead of hard-coded props.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Summary (the solution turned up during writing the message,
> the rest is only for the records...)
>
> 1) Don't open the .ejdo in a text editor and try to teneo->open resource
> 2) the start() as mentioned in the tutorial can be removed
> and _must not_ contain an JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
>
> I'd suggest modifying the library editor tutorial accordingly,
> since even the simple ResourceUtility is better than
> hardCoded jdbc porps.
>
> Would you like me to create patches for the tutorial,
> or would that be more hassle than dpoing it yourself
> for the next release ?
>
> Yours,
> Steffen
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Eclipse has a default editor definition by extension. Can you check what
>> it says for mzdata?
> In the runtime I have correctly *.mzdata -> Mzdata Model Editor
>
>> Have you tried the editorid (instead of editorextension)?
> editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
>
> doesn't help either. With a completely garbled EditorIDmbmnbmnb
> I get the "Unable to open Editor" message box as expected.
>
>> The open resource action should open a JpoxResource. This resource
>> checks if the file for which it was opened has the ejdo extension, if so
>> it reads the properties and creates/registers a datastore using those
>> properties. The registration of the ejdo extension is done in the static
>> initializer of the JpoxHelper. So if the JpoxResource is not started
>> then you probably also need to touch the JpoxHelper also.
>
> Ah: There is different behaviour if I try to Teneo->open resource,
> depending whether the mzdata.ejdo is opened in a (text-) editor in the runtime workbench,
> again irrespective whether
>
> a) .ejdo opened: Things are fine
> b) .ejdo closed: An (editor) tab named mzdata.ejdo opens with
> Unable to create this part due to an internal error. Reason for the failure: An unexpected exception was thrown.
> java.lang.NullPointerException
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:935)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:920)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:969)
> ....
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
> at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:91)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
> (full trace at the end)
>
> where
> public void MzdataEditor.createPages() {
> // Creates the model from the editor input
> //
> 969: createModel();
> }
>
> and
>
> public void MzdataEditor.createModel() {
> // Assumes that the input is a file object.
> //
> IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
> URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPat h().toString());;
> Exception exception = null;
> Resource resource = null;
> try {
> // Load the resource through the editing domain.
> //
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
> }
> catch (Exception e) {
> exception = e;
> resource = editingDomain.getResourceSet().getResource(resourceURI, false);
> }
>
> 920: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
>
> public Diagnostic MzdataEditor.analyzeResourceProblems(Resource resource, Exception exception) {
> 935: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
> BasicDiagnostic basicDiagnostic =
>
>
>
> public void StoreOpenResource.run(IAction action)
> {
> final File propFile = (File)selection.getFirstElement();
> try
> {
> final Properties props = StoreEclipseUtil.readPropFile(selection);
> openDataStore(props);
>
> // now use the editor props to find the correct editor
> final String editorextension = doTrim(props.getProperty(Constants.PROP_EDITOR_EXTENSTION));
> final String editorid = doTrim(props.getProperty(Constants.PROP_EDITOR_ID));
>
> final String foundEditorID = getEditorID(editorid, editorextension);
>
> // and open it
> final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> final IWorkbenchPage page = workbenchWindow.getActivePage();
> 91: page.openEditor(new FileEditorInput(propFile), foundEditorID);
>
>
> More ideas ?
>
> Yours,
> Steffen
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFpR0Sir2msrPI0lQRAkHxAJsHcd1NRco9g3MgDNb+2yLMHQ53EACf dxf2
> AKA6jhnkZ08dIlV4y81UGlM=
> =pWgl
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor (Solved) [message #67935 is a reply to message #67746] Thu, 11 January 2007 12:58 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Thanks, good that it works.
I will adapt the tutorial. I am not sure if I will completely replace the hard coded jdbc properties
with an ejdo file. I'll probably add a section about using ejdo instead of hard-coded props.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Summary (the solution turned up during writing the message,
> the rest is only for the records...)
>
> 1) Don't open the .ejdo in a text editor and try to teneo->open resource
> 2) the start() as mentioned in the tutorial can be removed
> and _must not_ contain an JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
>
> I'd suggest modifying the library editor tutorial accordingly,
> since even the simple ResourceUtility is better than
> hardCoded jdbc porps.
>
> Would you like me to create patches for the tutorial,
> or would that be more hassle than dpoing it yourself
> for the next release ?
>
> Yours,
> Steffen
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Eclipse has a default editor definition by extension. Can you check what
>> it says for mzdata?
> In the runtime I have correctly *.mzdata -> Mzdata Model Editor
>
>> Have you tried the editorid (instead of editorextension)?
> editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
>
> doesn't help either. With a completely garbled EditorIDmbmnbmnb
> I get the "Unable to open Editor" message box as expected.
>
>> The open resource action should open a JpoxResource. This resource
>> checks if the file for which it was opened has the ejdo extension, if so
>> it reads the properties and creates/registers a datastore using those
>> properties. The registration of the ejdo extension is done in the static
>> initializer of the JpoxHelper. So if the JpoxResource is not started
>> then you probably also need to touch the JpoxHelper also.
>
> Ah: There is different behaviour if I try to Teneo->open resource,
> depending whether the mzdata.ejdo is opened in a (text-) editor in the runtime workbench,
> again irrespective whether
>
> a) .ejdo opened: Things are fine
> b) .ejdo closed: An (editor) tab named mzdata.ejdo opens with
> Unable to create this part due to an internal error. Reason for the failure: An unexpected exception was thrown.
> java.lang.NullPointerException
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:935)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:920)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:969)
> ....
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
> at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:91)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
> (full trace at the end)
>
> where
> public void MzdataEditor.createPages() {
> // Creates the model from the editor input
> //
> 969: createModel();
> }
>
> and
>
> public void MzdataEditor.createModel() {
> // Assumes that the input is a file object.
> //
> IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
> URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPat h().toString());;
> Exception exception = null;
> Resource resource = null;
> try {
> // Load the resource through the editing domain.
> //
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
> }
> catch (Exception e) {
> exception = e;
> resource = editingDomain.getResourceSet().getResource(resourceURI, false);
> }
>
> 920: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
>
> public Diagnostic MzdataEditor.analyzeResourceProblems(Resource resource, Exception exception) {
> 935: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
> BasicDiagnostic basicDiagnostic =
>
>
>
> public void StoreOpenResource.run(IAction action)
> {
> final File propFile = (File)selection.getFirstElement();
> try
> {
> final Properties props = StoreEclipseUtil.readPropFile(selection);
> openDataStore(props);
>
> // now use the editor props to find the correct editor
> final String editorextension = doTrim(props.getProperty(Constants.PROP_EDITOR_EXTENSTION));
> final String editorid = doTrim(props.getProperty(Constants.PROP_EDITOR_ID));
>
> final String foundEditorID = getEditorID(editorid, editorextension);
>
> // and open it
> final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> final IWorkbenchPage page = workbenchWindow.getActivePage();
> 91: page.openEditor(new FileEditorInput(propFile), foundEditorID);
>
>
> More ideas ?
>
> Yours,
> Steffen
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFpR0Sir2msrPI0lQRAkHxAJsHcd1NRco9g3MgDNb+2yLMHQ53EACf dxf2
> AKA6jhnkZ08dIlV4y81UGlM=
> =pWgl
> -----END PGP SIGNATURE-----


--

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
Teneo: [Regression].ejdo usage in generated editor [message #103671 is a reply to message #67303] Mon, 26 November 2007 10:23 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I think I found a regression between earlier versions
of EMFT and now. I have a working editor which connects to a Postgres using an .ejdo.
This includes Eclipse 3.2, EMF 2.2 and Teneo 0.7.5

If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
I get the dreaded "EPackage with nsuri: http://psidev.so...ta/mzdata.xsd can not be found"
I also rebuilt the whole project using the current EMF, to no avail.

I also included my hack to Register the Package by creating a dummy Instance.
public static class Implementation extends EclipseUIPlugin { public Implementation() {
super();
// Dummy call to register Package for EMF Teneo's ejdo
MzdataPackage m1 = MzdataPackage.eINSTANCE;

// Remember the static instance.
//
plugin = this;
}
}

Has anything changed which is not reflected in the library tutorial on the elver.org site ?

Yours
Steffen

[INFO] JpoxHelper - Registering a jpox resource factory for all uri's with jpox as the protocol/extension
[INFO] JpoxHelper - Registering a jpox resource factory for all uri's with ejdo as the protocol/extension
[INFO] JpoxHelper - Registering a jpox resource dao factory for all uri's with jpoxdao as the protocol/extension
[ERROR] TeneoException - EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found, <org.eclipse.emf.teneo.TeneoException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,>org.eclipse.emf.teneo.TeneoException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
at org.eclipse.emf.teneo.util.StoreUtil.getEPackages(StoreUtil. java:494)
at org.eclipse.emf.teneo.jpox.JpoxUtil.getCreateDataStore(JpoxU til.java:81)
at org.eclipse.emf.teneo.jpox.eclipse.OpenResource.openDataStor e(OpenResource.java:33)
at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:68)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:256)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

- ------------------------------------------------------------ -------------------------

Can't read normal XML Files anymore:

If I change the mzdata model parser to JPOXResourceFactory
as described in the tutorial, I can't read normal XML files anymore,
giving me an NPE (stack below):

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser type="mzdata"
class="de.ipbhalle.msbi.Mzdata.util.MzdataResourceFactoryImpl " />
<!-- parser type="mzdata"
class="org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory " -->
</extension>

If I check the resourceURI, it has "platform:/resource/IPB%20MSBI%20Data/example_kai.mzdata"
but the getResource() fails.

java.lang.NullPointerException
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:970)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:955)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:1005)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:283)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:263)
at org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1405)
at org.eclipse.ui.internal.EditorManager$5.runWithException(Edi torManager.java:939)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3296)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2974)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:801)
at org.eclipse.ui.internal.Workbench$25.runWithException(Workbe nch.java:1342)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3296)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2974)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2309)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

- ------------------------------------------------------------ -------------------------

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSp6Gir2msrPI0lQRAuqcAJ9EDR5zLS+jB8pWnjAFoxhg/9i4SACe NEUy
P6sg7kw/2H9v9ASONnuzHEE=
=Tu7a
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103688 is a reply to message #103671] Mon, 26 November 2007 10:29 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sneumann schrieb:
> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
That should read 0.8.0.v200709051239

Yours,
Steffe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSp/5ir2msrPI0lQRAvNvAJ9o0BacH7Z7GvNNPeDIG8T52v+yXQCb B05Z
TN+wv2h4tcFMP7+Kmw+eKHM=
=+BAM
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103701 is a reply to message #103688] Mon, 26 November 2007 10:39 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
The 'open resource' option uses the global registry to find the EPackage
(EPackage.Registry.INSTANCE.getEPackage(...)). So one way or another your epackage is not present
there. I am not sure if this is caused by Teneo or by EMF/Eclipse registering the epackages in a
different way (compared to the previous version).

Is the line:
MzdataPackage m1 = MzdataPackage.eINSTANCE;
executed before you open the ejdo file?
Maybe you should look at the way emf initializes the plugins (just guessing here).

Regarding the npe, it is difficult for me to comment on that as I do not know what is present on
line 970 in the MzdataEditor.java. Can you post part of the code and let me know what is null?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sneumann schrieb:
>> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
> That should read 0.8.0.v200709051239
>
> Yours,
> Steffe
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHSp/5ir2msrPI0lQRAvNvAJ9o0BacH7Z7GvNNPeDIG8T52v+yXQCb B05Z
> TN+wv2h4tcFMP7+Kmw+eKHM=
> =+BAM
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #103729 is a reply to message #103701] Mon, 26 November 2007 12:37 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
....
> Is the line:
> MzdataPackage m1 = MzdataPackage.eINSTANCE;
> executed before you open the ejdo file?
> Maybe you should look at the way emf initializes the plugins (just
> guessing here).

But a good guess ;-) If right after the start I open an ejdo,
the breakpoint inside MzdataEditorPlugin.implementation() is not hit,
actually not even the constructor MzdataEditorPlugin().

<extension point = "org.eclipse.ui.editors">
<editor
id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
extensions = "mzdata"
class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
</editor>
</extension>

name=mzdata
nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
dbname=mzData
dburl=jdbc:postgresql://kons/mzData

In the old eclipse-3.2 The breakpoint in Implementation() is being hit
upon opening the ejdo.

> Regarding the npe, it is difficult for me to comment on that as I do not
> know what is present on line 970 in the MzdataEditor.java. Can you post
> part of the code and let me know what is null?
Sorry, I am catching a Cold which makes me think a bit slow today.
There seems to be a problem because resource==NULL without an exception thrown.

java.lang.NullPointerException
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:970)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:955)

public void createModel() {
URI resourceURI = EditUIUtil.getURI(getEditorInput());
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}

955: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);

public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
970: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
(Diagnostic.ERROR,
"mzData.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
new Object [] { exception == null ? (Object)resource : exception });
basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
return basicDiagnostic;
}

>
> gr. Martin
>
> sneumann wrote:
> sneumann schrieb:
>>>> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
> That should read 0.8.0.v200709051239
>
> Yours,
> Steffe
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSr31ir2msrPI0lQRAnjOAKCCuN/nHXHtZ1/J04F9XctlWkWhGQCg hPFa
upBqlKn+yKqYXazIqZAIpVc=
=FmHu
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103741 is a reply to message #103729] Mon, 26 November 2007 13:45 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Teneo will try to find the epackage before the editor is opened so the initialization code should
probably be located somewhere else (in a location called when eclipse starts). I am not sure but I
can think that you can specify in the plugin that it should be initialized at startup.

Regarding the npe, I don't know why it won't find the resource, can you try to debug into the code
(editingDomain.getResourceSet().getResource(...)) and see what happens?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
> ....
>> Is the line:
>> MzdataPackage m1 = MzdataPackage.eINSTANCE;
>> executed before you open the ejdo file?
>> Maybe you should look at the way emf initializes the plugins (just
>> guessing here).
>
> But a good guess ;-) If right after the start I open an ejdo,
> the breakpoint inside MzdataEditorPlugin.implementation() is not hit,
> actually not even the constructor MzdataEditorPlugin().
>
> <extension point = "org.eclipse.ui.editors">
> <editor
> id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
> extensions = "mzdata"
> class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
> </editor>
> </extension>
>
> name=mzdata
> nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
> editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
> dbname=mzData
> dburl=jdbc:postgresql://kons/mzData
>
> In the old eclipse-3.2 The breakpoint in Implementation() is being hit
> upon opening the ejdo.
>
>> Regarding the npe, it is difficult for me to comment on that as I do not
>> know what is present on line 970 in the MzdataEditor.java. Can you post
>> part of the code and let me know what is null?
> Sorry, I am catching a Cold which makes me think a bit slow today.
> There seems to be a problem because resource==NULL without an exception thrown.
>
> java.lang.NullPointerException
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:970)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:955)
>
> public void createModel() {
> URI resourceURI = EditUIUtil.getURI(getEditorInput());
> Exception exception = null;
> Resource resource = null;
> try {
> // Load the resource through the editing domain.
> //
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
> }
> catch (Exception e) {
> exception = e;
> resource = editingDomain.getResourceSet().getResource(resourceURI, false);
> }
>
> 955: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
>
> public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
> 970: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
> BasicDiagnostic basicDiagnostic =
> new BasicDiagnostic
> (Diagnostic.ERROR,
> "mzData.editor",
> 0,
> getString("_UI_CreateModelError_message", resource.getURI()),
> new Object [] { exception == null ? (Object)resource : exception });
> basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
> return basicDiagnostic;
> }
>
>> gr. Martin
>>
>> sneumann wrote:
>> sneumann schrieb:
>>>>> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
>> That should read 0.8.0.v200709051239
>>
>> Yours,
>> Steffe
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHSr31ir2msrPI0lQRAnjOAKCCuN/nHXHtZ1/J04F9XctlWkWhGQCg hPFa
> upBqlKn+yKqYXazIqZAIpVc=
> =FmHu
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #103770 is a reply to message #103741] Mon, 26 November 2007 16:39 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> Regarding the npe, I don't know why it won't find the resource, can you
> try to debug into the code
> (editingDomain.getResourceSet().getResource(...)) and see what happens?

Things go wrong in the EesourceSetImpl.getResource()
inside the JPOXResourceFactory. I don't have the sources Installed for that.
This continues even when I went back to JPOX 1.1.8.

Although, 1.1.8 helped with the .ejdo Issue. I got an Postgres error,
because handling of dbpassword= has changed, but at least I know it tried
to connect to the RDBMS. And when I leave that out,
I have the same NPE in the editor as with the *.mzdata file.

Ideas ?

Yours,
Steffen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSva9ir2msrPI0lQRAnXHAJ9IvqQ5lnMVYzZHWTFHgMX6SdvNLQCg ikrp
TVxm95WkZUU1pWw7w3l0K8E=
=xanp
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103796 is a reply to message #103770] Mon, 26 November 2007 17:09 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sneumann schrieb:
> to connect to the RDBMS. And when I leave that out,
> I have the same NPE in the editor as with the *.mzdata file.

In ResourceSetImpl:

Resource result = resourceFactory.createResource(uri);
with resourceFactory = org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@f64084

Is where the exception occurs. I tried to attach the source to the jpox.jar,
but during debugging that failed.

Steffen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSv2wir2msrPI0lQRAib0AJ9/UW3yGKcYatn1bB0C0HV+G+AwlgCf Unuh
sjt4LBnQMHj/ETVF7SxCN1I=
=B3jz
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103808 is a reply to message #103796] Mon, 26 November 2007 19:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
What is the stacktrace of this NPE (which line does it occur)?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sneumann schrieb:
>> to connect to the RDBMS. And when I leave that out,
>> I have the same NPE in the editor as with the *.mzdata file.
>
> In ResourceSetImpl:
>
> Resource result = resourceFactory.createResource(uri);
> with resourceFactory = org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@f64084
>
> Is where the exception occurs. I tried to attach the source to the jpox.jar,
> but during debugging that failed.
>
> Steffen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHSv2wir2msrPI0lQRAib0AJ9/UW3yGKcYatn1bB0C0HV+G+AwlgCf Unuh
> sjt4LBnQMHj/ETVF7SxCN1I=
> =B3jz
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #103868 is a reply to message #103770] Tue, 27 November 2007 08:59 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sneumann schrieb:
> Martin Taal schrieb:
>>> Regarding the npe, I don't know why it won't find the resource, can you
>>> try to debug into the code
>>> (editingDomain.getResourceSet().getResource(...)) and see what happens?

I learned a bit more about which sources I need. Problem occurs in
JPOXResource line 148 in super.init() because JpoxHelper.INSTANCE.getDataStore("mzdata")
returns null.

Does that help ? What else is needed ?

Yours,
Steffen

ResourceFactoryRegistryImpl:
75: resourceFactory = delegatedGetFactory(uri);
cachedToString "platform:/resource/IPB%20MSBI%20Data/example_kai.mzdata"
resourceFactory JPOXResourceFactory (id=718)
org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@18961f2

80: return (Resource.Factory)resourceFactory;

ResourceSetImpl:
418: Resource result = resourceFactory.createResource(uri);
}

JPOXResource:
if (uri.query() == null && uri.fileExtension() != null) // this is probably a platform uri!
query null

143: log.debug("Trying fileextension: " + uri.fileExtension());

BANG!
148: super.init(emfDataStore.getTopClasses());
where emfDataStore null
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHS9yDir2msrPI0lQRApg5AKCMgUfXikTmCV0Rh9hzedqe+f3AZACe KpoQ
ZYjrfLdZb1ICrNOT+zuZyMg=
=xuus
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103882 is a reply to message #103868] Tue, 27 November 2007 09:32 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
In the class StoreOpenResource in the run method a call is done to openDataStore. Can you set a
breakpoint there and debug into openDataStore -> JpoxUtil.getCreateDataStore? The system should
create a datastore under the name set in the ejdo file (name = mzdata).

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sneumann schrieb:
>> Martin Taal schrieb:
>>>> Regarding the npe, I don't know why it won't find the resource, can you
>>>> try to debug into the code
>>>> (editingDomain.getResourceSet().getResource(...)) and see what happens?
>
> I learned a bit more about which sources I need. Problem occurs in
> JPOXResource line 148 in super.init() because JpoxHelper.INSTANCE.getDataStore("mzdata")
> returns null.
>
> Does that help ? What else is needed ?
>
> Yours,
> Steffen
>
> ResourceFactoryRegistryImpl:
> 75: resourceFactory = delegatedGetFactory(uri);
> cachedToString "platform:/resource/IPB%20MSBI%20Data/example_kai.mzdata"
> resourceFactory JPOXResourceFactory (id=718)
> org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@18961f2
>
> 80: return (Resource.Factory)resourceFactory;
>
> ResourceSetImpl:
> 418: Resource result = resourceFactory.createResource(uri);
> }
>
> JPOXResource:
> if (uri.query() == null && uri.fileExtension() != null) // this is probably a platform uri!
> query null
>
> 143: log.debug("Trying fileextension: " + uri.fileExtension());
>
> BANG!
> 148: super.init(emfDataStore.getTopClasses());
> where emfDataStore null
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHS9yDir2msrPI0lQRApg5AKCMgUfXikTmCV0Rh9hzedqe+f3AZACe KpoQ
> ZYjrfLdZb1ICrNOT+zuZyMg=
> =xuus
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #103896 is a reply to message #103882] Tue, 27 November 2007 11:13 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> In the class StoreOpenResource in the run method a call is done to
> openDataStore. Can you set a breakpoint there and debug into
> openDataStore -> JpoxUtil.getCreateDataStore? The system should create a
> datastore under the name set in the ejdo file (name = mzdata).

Comment first: the same NPE occurs if I open
a file resource *.mzdata as well. In that case
no ejdo was opened but the initialisation
of the editor has to take place anyway.

So I am getting closeer: One thing I didn't notice before debugging,
there was an exception:

javax.jdo.JDODataStoreException: Error adding class de.ipbhalle.msbi.Mzdata.impl.SupDataTypeImpl.boolean_
to list of persistence-managed classes : ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"

which was not visible before the debugging. I removed the DB, did a fresh import for the first object
using pm.makePersistent(mymzdata); and then I can open the .ejdo and subsequently the *.mzdata files.

Still, In a fresh eclipse-Application instance I can't open an *.mzdata before anything else bevause of the NPE.
And JpoxUtil.getCreateDataStore() is never called.

Or do I have some misconception on my side ?

Yours,
Steffen








-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHS/v1ir2msrPI0lQRAl8XAJ4kgwx0sILkFlxqbJRLqc5hzFug8gCf URUw
MXmyybUscXMtwOWnD7GHTPc=
=l4m2
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103908 is a reply to message #103896] Tue, 27 November 2007 11:33 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Afaics what goes wrong is that no datastore is initialized/created (with the name mzdata) before you
open the mzdata file.

So to solve this you have to initialize the datastore when you start your app. In the tutorial on
the elver.org website (http://www.elver.org/jpox/tutorial2/tutorial2_1.html) I set it in the
editorplugin. Maybe in your case there is a better plugin/location to do that. Do you have a plugin
which starts when your app starts?

As some extra info:
Note that when an mzdata file is opened Teneo uses a 'little' trick to find the datastore. It works
as follows:
- You right click on a mzdata file and select open with default editor
- The editor plugin is started and initializes the datastore (using the tutorial code as described
above).
- The editor plugin opens the resource by passing the uri (ending on mzdata) to the resource set.
- The resourcefactory for uri's ending on mzdata is the jpox resource factory (is set in the
extension of the model plugin project)
- The JPOX resource is created using the uri, the jpox resource uses the extension of the uri
(mzdata) to search for a datastore.

When an ejdo file is opened it works as follows:
- You right click on a ejdo file and in the teneo submenu select open resource
- The open resource plugin will read the ejdo file and initialize a datastore using the name in the
ejdo file.
- Then it will find an editor using the information in the ejdo file. The editor will be started
with the ejdo file as the file to open.
- The jpox resource factory is registered for the ejdo extension. So this resource factory will
create a jpox resource.
- The jpox resource detects that the uri ends on ejdo and looks at the contents of the file. It uses
the name property in the file to find the datastore.

Hope this helps to clarify how it works.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> In the class StoreOpenResource in the run method a call is done to
>> openDataStore. Can you set a breakpoint there and debug into
>> openDataStore -> JpoxUtil.getCreateDataStore? The system should create a
>> datastore under the name set in the ejdo file (name = mzdata).
>
> Comment first: the same NPE occurs if I open
> a file resource *.mzdata as well. In that case
> no ejdo was opened but the initialisation
> of the editor has to take place anyway.
>
> So I am getting closeer: One thing I didn't notice before debugging,
> there was an exception:
>
> javax.jdo.JDODataStoreException: Error adding class de.ipbhalle.msbi.Mzdata.impl.SupDataTypeImpl.boolean_
> to list of persistence-managed classes : ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"
> org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"
>
> which was not visible before the debugging. I removed the DB, did a fresh import for the first object
> using pm.makePersistent(mymzdata); and then I can open the .ejdo and subsequently the *.mzdata files.
>
> Still, In a fresh eclipse-Application instance I can't open an *.mzdata before anything else bevause of the NPE.
> And JpoxUtil.getCreateDataStore() is never called.
>
> Or do I have some misconception on my side ?
>
> Yours,
> Steffen
>
>
>
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHS/v1ir2msrPI0lQRAl8XAJ4kgwx0sILkFlxqbJRLqc5hzFug8gCf URUw
> MXmyybUscXMtwOWnD7GHTPc=
> =l4m2
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #103922 is a reply to message #103908] Tue, 27 November 2007 12:26 Go to previous messageGo to next message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> So to solve this you have to initialize the datastore when you start
> your app. In the tutorial on the elver.org website
> (http://www.elver.org/jpox/tutorial2/tutorial2_1.html) I set it in the
> editorplugin.

Ah, so the comment there "Note this code should not be added if you want to start the editor using the Resource Utility"
is a bit misleading: "... using _only_ the Resource Utility and no other (e.g. file-based) methods."

Since I can't initialize the jpoxDataStore in the Plugin.start()
if I don't know the JDBC URL (which is to be found in the .ejdo later)
I am looking for stripped-down version of JpoxDataStore.initialize()
that registers only the "'little' trick to find the datastore".

Is there a convenient way to initialize a non-JDBC PMF ?

Yours,
Steffen

P.S.: In The JpoxDataStore I found that !updateSchema is ignored, is that intentionally ?
if (!updateSchema) {
log.debug("Update of the database schema has been disabled returning");
}
log.debug("Updating database schema");
....



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTAzeir2msrPI0lQRAgQWAJ0Re34kAo1DwdrW8jUIeGtohtQQbACf feVM
bye2eLWtB8Vdvt4gbvdI0r8=
=qgb1
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #103946 is a reply to message #103922] Tue, 27 November 2007 15:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes, the text is not valid anymore. I will change that.

I am not sure what you mean with stripped down version of jpoxdatastore.initialize(). You can call
this method: JpoxHelper.createRegisterDataStore("mzdata") to create a datastore and register it
under the mzdata name. It won't be initialized at that point in time. This can be done later.

However, I am not sure if this is were your problem is. Also the plugin which handles the ejdo file
creates and registers a datastore. You can try this out by setting a breakpoint in
org.eclipse.emf.teneo.jpox.eclipse.OpenResource in the method openDataStore. But I don't know why
this register step does not seem to happen....

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> So to solve this you have to initialize the datastore when you start
>> your app. In the tutorial on the elver.org website
>> (http://www.elver.org/jpox/tutorial2/tutorial2_1.html) I set it in the
>> editorplugin.
>
> Ah, so the comment there "Note this code should not be added if you want to start the editor using the Resource Utility"
> is a bit misleading: "... using _only_ the Resource Utility and no other (e.g. file-based) methods."
>
> Since I can't initialize the jpoxDataStore in the Plugin.start()
> if I don't know the JDBC URL (which is to be found in the .ejdo later)
> I am looking for stripped-down version of JpoxDataStore.initialize()
> that registers only the "'little' trick to find the datastore".
>
> Is there a convenient way to initialize a non-JDBC PMF ?
>
> Yours,
> Steffen
>
> P.S.: In The JpoxDataStore I found that !updateSchema is ignored, is that intentionally ?
> if (!updateSchema) {
> log.debug("Update of the database schema has been disabled returning");
> }
> log.debug("Updating database schema");
> ....
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHTAzeir2msrPI0lQRAgQWAJ0Re34kAo1DwdrW8jUIeGtohtQQbACf feVM
> bye2eLWtB8Vdvt4gbvdI0r8=
> =qgb1
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #600981 is a reply to message #67303] Mon, 08 January 2007 21:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Or it maybe my documentation writing skills....

What happens if you use the library.ejdo example which available in the
http://www.elver.org/jpox/resource_utility.html (see the hyperlink in the ejdo file section) page
and then change the properties to fit your connection properties and package etc.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> This question might stem from either my stupidity
> or a lack of documentation in teneo.
>
> I have a working, JPOX-enabled editor-plugin,
> with host/db/user/passwd properties
> in a jpox.properties file.
>
> I'd like to use the ResourceUtility
> http://www.elver.org/jpox/resource_utility.html,
>
> but fail to see how to adapt the initialisation described in
> http://www.elver.org/jpox/tutorial2/tutorial2_1.html
>
> I also could not find a snippet using the .ejdo in the examples.
>
> If I use my existing MzdataEditorPlugin.start(BundleContext context)
> ths will obviously fail in another setting, so the connection
> properties have to be removed.
>
> But then I get "org.eclipse.emf.teneo.jpox.JpoxStoreException: Specific
> properties have not been set" et al.
>
> Any hints, or did I miss the obvious somewhere ?
>
> Yours,
> Steffen
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFompdir2msrPI0lQRAiP0AJ9Y+3WW4koGWblKo4StTWg2a7fEVQCf SE4t
> H+Rn/5rnnjfXnE/M75Nh/VY=
> =OqtQ
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #600995 is a reply to message #67458] Tue, 09 January 2007 08:46 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> Hi Steffen,
> Or it maybe my documentation writing skills....
>
> What happens if you use the library.ejdo example which available in the
> http://www.elver.org/jpox/resource_utility.html (see the hyperlink in
> the ejdo file section) page and then change the properties to fit your
> connection properties and package etc.
Yup, that's what I did. My current Editor has a working MzdataEditorPlugin.start(),
including setting up the JpoxDataStore:

public void start(BundleContext context) throws Exception
{
Properties properties = new Properties();
properties.load(MzdataEditor.class.getResourceAsStream("/jpox.properties "));
String pmfName = "mzdata"; // the name of the JpoxDataStore
JpoxDataStore jpoxDataStore = JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
jpoxDataStore.setProperties(properties);
jpoxDataStore.setEPackages(new EPackage[]{MzdataPackage.eINSTANCE});
jpoxDataStore.initialize();

// this is required to force the editor to retrieve the correct resource
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "mzdata", new JPOXResourceFactory());

super.start(context);
}

If I now open the mzData.ejdo, and edit some *.mzdata file,
the editor shows the database content. Fine. (BTW: shouldn't
"Teneo->Open Resource open an Editor ?)

If I change the mzdata.ejdo to point to a different database,
it still shows the database set in the jpox.properties

If I comment out the complete start(), I get an ClassNotFoundException,
if I remove only the JpoDataStore code I get an

org.eclipse.emf.teneo.StoreException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,

even though both mzdata.jdo

name=mzdata
nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd

and MzdataPackage.java have the nsuri in it:

String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";

I think I have set the ResourceFactory settings in
Mzdata.model/plugin.xml correctly as well:

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="mzdata"
class="org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory " />
</extension>

So the real question is what to put into MzdataEditorPlugin.start()
to register the Mzdata EPackage with JPOX ?!

Yours,
Steffen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFo1Zuir2msrPI0lQRAhN2AJ4nppPHMUY14Tqov5NvpjvzHy41lwCg gHRT
vj5h3ot06ikLfqQP3AYT4pM=
=cXF4
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #601005 is a reply to message #67499] Tue, 09 January 2007 09:33 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Can you post the content of the ejdo file?

Yes it should open an editor but this depends if the editor can be found (see the editorextension
description in the sample ejdo file).

That it shows the 'previous' database is maybe because you use the same jpoxdatastore name which you
already set in the start method.

The epackage is registered in a global registry. The resource utility registers the epackage with
jpox but it can't find the epackage using the nsuri. The nsuri registration of an epackage takes
place epackage impl (of mzdatapackageimpl) in the init method or otherwise in a static initializer.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Or it maybe my documentation writing skills....
>>
>> What happens if you use the library.ejdo example which available in the
>> http://www.elver.org/jpox/resource_utility.html (see the hyperlink in
>> the ejdo file section) page and then change the properties to fit your
>> connection properties and package etc.
> Yup, that's what I did. My current Editor has a working MzdataEditorPlugin.start(),
> including setting up the JpoxDataStore:
>
> public void start(BundleContext context) throws Exception
> {
> Properties properties = new Properties();
> properties.load(MzdataEditor.class.getResourceAsStream("/jpox.properties "));
> String pmfName = "mzdata"; // the name of the JpoxDataStore
> JpoxDataStore jpoxDataStore = JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
> jpoxDataStore.setProperties(properties);
> jpoxDataStore.setEPackages(new EPackage[]{MzdataPackage.eINSTANCE});
> jpoxDataStore.initialize();
>
> // this is required to force the editor to retrieve the correct resource
> Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "mzdata", new JPOXResourceFactory());
>
> super.start(context);
> }
>
> If I now open the mzData.ejdo, and edit some *.mzdata file,
> the editor shows the database content. Fine. (BTW: shouldn't
> "Teneo->Open Resource open an Editor ?)
>
> If I change the mzdata.ejdo to point to a different database,
> it still shows the database set in the jpox.properties
>
> If I comment out the complete start(), I get an ClassNotFoundException,
> if I remove only the JpoDataStore code I get an
>
> org.eclipse.emf.teneo.StoreException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
>
> even though both mzdata.jdo
>
> name=mzdata
> nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
>
> and MzdataPackage.java have the nsuri in it:
>
> String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";
>
> I think I have set the ResourceFactory settings in
> Mzdata.model/plugin.xml correctly as well:
>
> <extension point="org.eclipse.emf.ecore.extension_parser">
> <parser
> type="mzdata"
> class="org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory " />
> </extension>
>
> So the real question is what to put into MzdataEditorPlugin.start()
> to register the Mzdata EPackage with JPOX ?!
>
> Yours,
> Steffen
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFo1Zuir2msrPI0lQRAhN2AJ4nppPHMUY14Tqov5NvpjvzHy41lwCg gHRT
> vj5h3ot06ikLfqQP3AYT4pM=
> =cXF4
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #601011 is a reply to message #67541] Tue, 09 January 2007 10:29 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> Hi Steffen,
> Can you post the content of the ejdo file?
name=mzdata
nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
editorextension=mzdata
dbname=mzdata
dburl=jdbc:postgresql://kons/mzdata
dbuser=sneumann
dbpassword=
dbdriver=org.postgresql.Driver

> Yes it should open an editor but this depends if the editor can be found
> (see the editorextension description in the sample ejdo file).
> That it shows the 'previous' database is maybe because you use the same
> jpoxdatastore name which you already set in the start method.
I habe changed both the pmfName and the ExtensionToFactoryMap
to mzdata2 the start Method, and get the Exception:

- ->started update@plugins/org.eclipse.emf.teneo.jpox.eclipse_0.7.5.v200701051518.jar [442]
org.jpox.exceptions.ClassNotResolvedException: Class de.ipb.msbi.Mzdata.PrecursorListType,org.eclipse.emf.ecore.E Object,org.eclipse.emf.common.notify.Notifier was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:213)
at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:372)
at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:418)
at org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:735)
at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:268)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:73)
at org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:73)
at org.jpox.AbstractPersistenceManager.getStoreManager(Abstract PersistenceManager.java:292)
at org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:214)
at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:42)
at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:178)
at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:153)
at org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:464)
at org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:195)
at org.eclipse.emf.teneo.jpox.JpoxUtil.getCreateDataStore(JpoxU til.java:87)
at org.eclipse.emf.teneo.jpox.eclipse.OpenResource.openDataStor e(OpenResource.java:33)
at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:80)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)

> The epackage is registered in a global registry. The resource utility
> registers the epackage with jpox but it can't find the epackage using
> the nsuri. The nsuri registration of an epackage takes place epackage
> impl (of mzdatapackageimpl) in the init method or otherwise in a static
> initializer.

I think the (generated) code has that:

../MzdataPackage.java:
public interface MzdataPackage extends EPackage {
String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";
}

private MzdataPackageImpl() {
public static MzdataPackage init() {
X super(eNS_URI, MzdataFactory.eINSTANCE);
}
}

and setting a breakpoint (at the X position) shows
that MzdataPackage.init() is called.

Steffen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFo256ir2msrPI0lQRAhfYAJsFS+6HCR6o30Vg4sJB/HpNbT0WBwCg kv14
hs6pOsMrMR2QI6yxVtvJH0s=
=RFLa
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #601032 is a reply to message #67563] Tue, 09 January 2007 16:27 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
So you don't get this error anymore?
org.eclipse.emf.teneo.StoreException: EPackage with nsuri:
http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,


I am not sure why it can't find the de.ipb.msbi.Mzdata.PrecursorListType class.
Is this class in a different model package?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Can you post the content of the ejdo file?
> name=mzdata
> nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
> editorextension=mzdata
> dbname=mzdata
> dburl=jdbc:postgresql://kons/mzdata
> dbuser=sneumann
> dbpassword=
> dbdriver=org.postgresql.Driver
>
>> Yes it should open an editor but this depends if the editor can be found
>> (see the editorextension description in the sample ejdo file).
>> That it shows the 'previous' database is maybe because you use the same
>> jpoxdatastore name which you already set in the start method.
> I habe changed both the pmfName and the ExtensionToFactoryMap
> to mzdata2 the start Method, and get the Exception:
>
> - ->started update@plugins/org.eclipse.emf.teneo.jpox.eclipse_0.7.5.v200701051518.jar [442]
> org.jpox.exceptions.ClassNotResolvedException: Class de.ipb.msbi.Mzdata.PrecursorListType,org.eclipse.emf.ecore.E Object,org.eclipse.emf.common.notify.Notifier was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
> at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:213)
> at org.jpox.JDOClassLoaderResolver.classForName(JDOClassLoaderR esolver.java:372)
> at org.jpox.store.StoreManager.initialiseAutoStart(StoreManager .java:418)
> at org.jpox.store.rdbms.RDBMSManager.initialiseSchema(RDBMSMana ger.java:735)
> at org.jpox.store.rdbms.RDBMSManager.<init>(RDBMSManager.java:268)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:39)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:4 94)
> at org.jpox.util.ClassUtils.newInstance(ClassUtils.java:73)
> at org.jpox.store.StoreManagerFactory.getStoreManager(StoreMana gerFactory.java:73)
> at org.jpox.AbstractPersistenceManager.getStoreManager(Abstract PersistenceManager.java:292)
> at org.jpox.AbstractPersistenceManager.<init>(AbstractPersistenceManager.java:214)
> at org.jpox.PersistenceManagerImpl.<init>(PersistenceManagerImpl.java:42)
> at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:178)
> at org.jpox.PersistenceManagerFactoryImpl.getPersistenceManager (PersistenceManagerFactoryImpl.java:153)
> at org.eclipse.emf.teneo.jpox.JpoxDataStore.createSchema(JpoxDa taStore.java:464)
> at org.eclipse.emf.teneo.jpox.JpoxDataStore.initialize(JpoxData Store.java:195)
> at org.eclipse.emf.teneo.jpox.JpoxUtil.getCreateDataStore(JpoxU til.java:87)
> at org.eclipse.emf.teneo.jpox.eclipse.OpenResource.openDataStor e(OpenResource.java:33)
> at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:80)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
> at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:539)
> at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:400)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3164)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2840)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1914)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:419)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplicatio n.java:95)
> at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:78)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:92)
> at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:68)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:400)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:177)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336 )
> at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
> at org.eclipse.core.launcher.Main.run(Main.java:977)
> at org.eclipse.core.launcher.Main.main(Main.java:952)
>
>> The epackage is registered in a global registry. The resource utility
>> registers the epackage with jpox but it can't find the epackage using
>> the nsuri. The nsuri registration of an epackage takes place epackage
>> impl (of mzdatapackageimpl) in the init method or otherwise in a static
>> initializer.
>
> I think the (generated) code has that:
>
> ../MzdataPackage.java:
> public interface MzdataPackage extends EPackage {
> String eNS_URI = "http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd";
> }
>
> private MzdataPackageImpl() {
> public static MzdataPackage init() {
> X super(eNS_URI, MzdataFactory.eINSTANCE);
> }
> }
>
> and setting a breakpoint (at the X position) shows
> that MzdataPackage.init() is called.
>
> Steffen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFo256ir2msrPI0lQRAhfYAJsFS+6HCR6o30Vg4sJB/HpNbT0WBwCg kv14
> hs6pOsMrMR2QI6yxVtvJH0s=
> =RFLa
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor [message #601042 is a reply to message #67629] Wed, 10 January 2007 09:53 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> So you don't get this error anymore?
> org.eclipse.emf.teneo.StoreException: EPackage with nsuri:
> http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
No, I have placed a dummy call which registers
the package upon first instanciation of a class
public MzdataEditorPlugin.Implementation() {
super();
MzdataPackage m1 = MzdataPackage.eINSTANCE;
plugin = this;
}

> I am not sure why it can't find the de.ipb.msbi.Mzdata.PrecursorListType
That was because I connected to a different database
that had old package names. Once I realised that is was a sign
that indeed the .ejdo worked ;-)

>>>> Yes it should open an editor but this depends if the editor can be found
>>>> (see the editorextension description in the sample ejdo file).
It still doesn't launch the editor. I have to Teneo->Open Ressource
and then open a dummy *.mzdata file to show the database.

So as posted before I have
mzdata.ejdo:
name=mzdata
editorextension=mzdata
and mzdata.editor/plugin.xml has extensions = "mzdata"

<extension point = "org.eclipse.ui.editors">
<editor
id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
name = "%_UI_MzdataEditor_label"
icon = "icons/full/obj16/MzdataModelFile.gif"
extensions = "mzdata"
class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
contributorClass=" de.ipbhalle.msbi.Mzdata.presentation.MzdataActionBarContribu tor " >
</editor>
</extension>

I am unsure about "IMPORTANT: this should be the same name as used in the calls to JPOXHelper",
because I have nowhere a call to JPOXHelper. (BTW inconcistency: its now JpoxHelper).

Adding JpoxHelper.INSTANCE.createRegisterDataStore("mzdata"); to EditorPlugin.start()
seems not to be enough, but I cant call jpoxDataStore.initialize(); because
I don't know the jdbc properties.

Any hints how the start() should look like to start the Editor
with jdbc properties from the .ejdo ?

Yours,
Steffen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpLeGir2msrPI0lQRAsslAJ9Q70M5eG90mL+f6VZM6BF+2X437QCf flEz
/s89r57MQJF+z4hQWOeX7cM=
=SKRL
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor [message #601062 is a reply to message #67664] Wed, 10 January 2007 15:23 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Eclipse has a default editor definition by extension. Can you check what it says for mzdata?

Have you tried the editorid (instead of editorextension)?

The open resource action should open a JpoxResource. This resource checks if the file for which it
was opened has the ejdo extension, if so it reads the properties and creates/registers a datastore
using those properties. The registration of the ejdo extension is done in the static initializer of
the JpoxHelper. So if the JpoxResource is not started then you probably also need to touch the
JpoxHelper also.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> So you don't get this error anymore?
>> org.eclipse.emf.teneo.StoreException: EPackage with nsuri:
>> http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
> No, I have placed a dummy call which registers
> the package upon first instanciation of a class
> public MzdataEditorPlugin.Implementation() {
> super();
> MzdataPackage m1 = MzdataPackage.eINSTANCE;
> plugin = this;
> }
>
>> I am not sure why it can't find the de.ipb.msbi.Mzdata.PrecursorListType
> That was because I connected to a different database
> that had old package names. Once I realised that is was a sign
> that indeed the .ejdo worked ;-)
>
>>>>> Yes it should open an editor but this depends if the editor can be found
>>>>> (see the editorextension description in the sample ejdo file).
> It still doesn't launch the editor. I have to Teneo->Open Ressource
> and then open a dummy *.mzdata file to show the database.
>
> So as posted before I have
> mzdata.ejdo:
> name=mzdata
> editorextension=mzdata
> and mzdata.editor/plugin.xml has extensions = "mzdata"
>
> <extension point = "org.eclipse.ui.editors">
> <editor
> id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
> name = "%_UI_MzdataEditor_label"
> icon = "icons/full/obj16/MzdataModelFile.gif"
> extensions = "mzdata"
> class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
> contributorClass=" de.ipbhalle.msbi.Mzdata.presentation.MzdataActionBarContribu tor " >
> </editor>
> </extension>
>
> I am unsure about "IMPORTANT: this should be the same name as used in the calls to JPOXHelper",
> because I have nowhere a call to JPOXHelper. (BTW inconcistency: its now JpoxHelper).
>
> Adding JpoxHelper.INSTANCE.createRegisterDataStore("mzdata"); to EditorPlugin.start()
> seems not to be enough, but I cant call jpoxDataStore.initialize(); because
> I don't know the jdbc properties.
>
> Any hints how the start() should look like to start the Editor
> with jdbc properties from the .ejdo ?
>
> Yours,
> Steffen
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFpLeGir2msrPI0lQRAsslAJ9Q70M5eG90mL+f6VZM6BF+2X437QCf flEz
> /s89r57MQJF+z4hQWOeX7cM=
> =SKRL
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor (Solved) [message #601068 is a reply to message #67726] Wed, 10 January 2007 17:06 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Summary (the solution turned up during writing the message,
the rest is only for the records...)

1) Don't open the .ejdo in a text editor and try to teneo->open resource
2) the start() as mentioned in the tutorial can be removed
and _must not_ contain an JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);

I'd suggest modifying the library editor tutorial accordingly,
since even the simple ResourceUtility is better than
hardCoded jdbc porps.

Would you like me to create patches for the tutorial,
or would that be more hassle than dpoing it yourself
for the next release ?

Yours,
Steffen

Martin Taal schrieb:
> Hi Steffen,
> Eclipse has a default editor definition by extension. Can you check what
> it says for mzdata?
In the runtime I have correctly *.mzdata -> Mzdata Model Editor

> Have you tried the editorid (instead of editorextension)?
editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID

doesn't help either. With a completely garbled EditorIDmbmnbmnb
I get the "Unable to open Editor" message box as expected.

> The open resource action should open a JpoxResource. This resource
> checks if the file for which it was opened has the ejdo extension, if so
> it reads the properties and creates/registers a datastore using those
> properties. The registration of the ejdo extension is done in the static
> initializer of the JpoxHelper. So if the JpoxResource is not started
> then you probably also need to touch the JpoxHelper also.

Ah: There is different behaviour if I try to Teneo->open resource,
depending whether the mzdata.ejdo is opened in a (text-) editor in the runtime workbench,
again irrespective whether

a) .ejdo opened: Things are fine
b) .ejdo closed: An (editor) tab named mzdata.ejdo opens with
Unable to create this part due to an internal error. Reason for the failure: An unexpected exception was thrown.
java.lang.NullPointerException
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:935)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:920)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:969)
....
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:91)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
(full trace at the end)

where
public void MzdataEditor.createPages() {
// Creates the model from the editor input
//
969: createModel();
}

and

public void MzdataEditor.createModel() {
// Assumes that the input is a file object.
//
IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPat h().toString());;
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}

920: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);

public Diagnostic MzdataEditor.analyzeResourceProblems(Resource resource, Exception exception) {
935: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =



public void StoreOpenResource.run(IAction action)
{
final File propFile = (File)selection.getFirstElement();
try
{
final Properties props = StoreEclipseUtil.readPropFile(selection);
openDataStore(props);

// now use the editor props to find the correct editor
final String editorextension = doTrim(props.getProperty(Constants.PROP_EDITOR_EXTENSTION));
final String editorid = doTrim(props.getProperty(Constants.PROP_EDITOR_ID));

final String foundEditorID = getEditorID(editorid, editorextension);

// and open it
final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
final IWorkbenchPage page = workbenchWindow.getActivePage();
91: page.openEditor(new FileEditorInput(propFile), foundEditorID);


More ideas ?

Yours,
Steffen




-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFpR0Sir2msrPI0lQRAkHxAJsHcd1NRco9g3MgDNb+2yLMHQ53EACf dxf2
AKA6jhnkZ08dIlV4y81UGlM=
=pWgl
-----END PGP SIGNATURE-----
Re: Teneo: .ejdo usage in generated editor (Solved) [message #601121 is a reply to message #67746] Thu, 11 January 2007 12:56 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Thanks, good that it works.
I will adapt the tutorial. I am not sure if I will completely replace the hard coded jdbc properties
with an ejdo file. I'll probably add a section about using ejdo instead of hard-coded props.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Summary (the solution turned up during writing the message,
> the rest is only for the records...)
>
> 1) Don't open the .ejdo in a text editor and try to teneo->open resource
> 2) the start() as mentioned in the tutorial can be removed
> and _must not_ contain an JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
>
> I'd suggest modifying the library editor tutorial accordingly,
> since even the simple ResourceUtility is better than
> hardCoded jdbc porps.
>
> Would you like me to create patches for the tutorial,
> or would that be more hassle than dpoing it yourself
> for the next release ?
>
> Yours,
> Steffen
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Eclipse has a default editor definition by extension. Can you check what
>> it says for mzdata?
> In the runtime I have correctly *.mzdata -> Mzdata Model Editor
>
>> Have you tried the editorid (instead of editorextension)?
> editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
>
> doesn't help either. With a completely garbled EditorIDmbmnbmnb
> I get the "Unable to open Editor" message box as expected.
>
>> The open resource action should open a JpoxResource. This resource
>> checks if the file for which it was opened has the ejdo extension, if so
>> it reads the properties and creates/registers a datastore using those
>> properties. The registration of the ejdo extension is done in the static
>> initializer of the JpoxHelper. So if the JpoxResource is not started
>> then you probably also need to touch the JpoxHelper also.
>
> Ah: There is different behaviour if I try to Teneo->open resource,
> depending whether the mzdata.ejdo is opened in a (text-) editor in the runtime workbench,
> again irrespective whether
>
> a) .ejdo opened: Things are fine
> b) .ejdo closed: An (editor) tab named mzdata.ejdo opens with
> Unable to create this part due to an internal error. Reason for the failure: An unexpected exception was thrown.
> java.lang.NullPointerException
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:935)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:920)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:969)
> ....
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
> at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:91)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
> (full trace at the end)
>
> where
> public void MzdataEditor.createPages() {
> // Creates the model from the editor input
> //
> 969: createModel();
> }
>
> and
>
> public void MzdataEditor.createModel() {
> // Assumes that the input is a file object.
> //
> IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
> URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPat h().toString());;
> Exception exception = null;
> Resource resource = null;
> try {
> // Load the resource through the editing domain.
> //
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
> }
> catch (Exception e) {
> exception = e;
> resource = editingDomain.getResourceSet().getResource(resourceURI, false);
> }
>
> 920: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
>
> public Diagnostic MzdataEditor.analyzeResourceProblems(Resource resource, Exception exception) {
> 935: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
> BasicDiagnostic basicDiagnostic =
>
>
>
> public void StoreOpenResource.run(IAction action)
> {
> final File propFile = (File)selection.getFirstElement();
> try
> {
> final Properties props = StoreEclipseUtil.readPropFile(selection);
> openDataStore(props);
>
> // now use the editor props to find the correct editor
> final String editorextension = doTrim(props.getProperty(Constants.PROP_EDITOR_EXTENSTION));
> final String editorid = doTrim(props.getProperty(Constants.PROP_EDITOR_ID));
>
> final String foundEditorID = getEditorID(editorid, editorextension);
>
> // and open it
> final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> final IWorkbenchPage page = workbenchWindow.getActivePage();
> 91: page.openEditor(new FileEditorInput(propFile), foundEditorID);
>
>
> More ideas ?
>
> Yours,
> Steffen
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFpR0Sir2msrPI0lQRAkHxAJsHcd1NRco9g3MgDNb+2yLMHQ53EACf dxf2
> AKA6jhnkZ08dIlV4y81UGlM=
> =pWgl
> -----END PGP SIGNATURE-----


--

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: Teneo: .ejdo usage in generated editor (Solved) [message #601150 is a reply to message #67746] Thu, 11 January 2007 12:58 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
Thanks, good that it works.
I will adapt the tutorial. I am not sure if I will completely replace the hard coded jdbc properties
with an ejdo file. I'll probably add a section about using ejdo instead of hard-coded props.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Summary (the solution turned up during writing the message,
> the rest is only for the records...)
>
> 1) Don't open the .ejdo in a text editor and try to teneo->open resource
> 2) the start() as mentioned in the tutorial can be removed
> and _must not_ contain an JpoxHelper.INSTANCE.createRegisterDataStore(pmfName);
>
> I'd suggest modifying the library editor tutorial accordingly,
> since even the simple ResourceUtility is better than
> hardCoded jdbc porps.
>
> Would you like me to create patches for the tutorial,
> or would that be more hassle than dpoing it yourself
> for the next release ?
>
> Yours,
> Steffen
>
> Martin Taal schrieb:
>> Hi Steffen,
>> Eclipse has a default editor definition by extension. Can you check what
>> it says for mzdata?
> In the runtime I have correctly *.mzdata -> Mzdata Model Editor
>
>> Have you tried the editorid (instead of editorextension)?
> editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
>
> doesn't help either. With a completely garbled EditorIDmbmnbmnb
> I get the "Unable to open Editor" message box as expected.
>
>> The open resource action should open a JpoxResource. This resource
>> checks if the file for which it was opened has the ejdo extension, if so
>> it reads the properties and creates/registers a datastore using those
>> properties. The registration of the ejdo extension is done in the static
>> initializer of the JpoxHelper. So if the JpoxResource is not started
>> then you probably also need to touch the JpoxHelper also.
>
> Ah: There is different behaviour if I try to Teneo->open resource,
> depending whether the mzdata.ejdo is opened in a (text-) editor in the runtime workbench,
> again irrespective whether
>
> a) .ejdo opened: Things are fine
> b) .ejdo closed: An (editor) tab named mzdata.ejdo opens with
> Unable to create this part due to an internal error. Reason for the failure: An unexpected exception was thrown.
> java.lang.NullPointerException
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:935)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:920)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:969)
> ....
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2470)
> at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:91)
> at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:254)
> (full trace at the end)
>
> where
> public void MzdataEditor.createPages() {
> // Creates the model from the editor input
> //
> 969: createModel();
> }
>
> and
>
> public void MzdataEditor.createModel() {
> // Assumes that the input is a file object.
> //
> IFileEditorInput modelFile = (IFileEditorInput)getEditorInput();
> URI resourceURI = URI.createPlatformResourceURI(modelFile.getFile().getFullPat h().toString());;
> Exception exception = null;
> Resource resource = null;
> try {
> // Load the resource through the editing domain.
> //
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
> }
> catch (Exception e) {
> exception = e;
> resource = editingDomain.getResourceSet().getResource(resourceURI, false);
> }
>
> 920: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
>
> public Diagnostic MzdataEditor.analyzeResourceProblems(Resource resource, Exception exception) {
> 935: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
> BasicDiagnostic basicDiagnostic =
>
>
>
> public void StoreOpenResource.run(IAction action)
> {
> final File propFile = (File)selection.getFirstElement();
> try
> {
> final Properties props = StoreEclipseUtil.readPropFile(selection);
> openDataStore(props);
>
> // now use the editor props to find the correct editor
> final String editorextension = doTrim(props.getProperty(Constants.PROP_EDITOR_EXTENSTION));
> final String editorid = doTrim(props.getProperty(Constants.PROP_EDITOR_ID));
>
> final String foundEditorID = getEditorID(editorid, editorextension);
>
> // and open it
> final IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
> final IWorkbenchPage page = workbenchWindow.getActivePage();
> 91: page.openEditor(new FileEditorInput(propFile), foundEditorID);
>
>
> More ideas ?
>
> Yours,
> Steffen
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFFpR0Sir2msrPI0lQRAkHxAJsHcd1NRco9g3MgDNb+2yLMHQ53EACf dxf2
> AKA6jhnkZ08dIlV4y81UGlM=
> =pWgl
> -----END PGP SIGNATURE-----


--

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
Teneo: [Regression].ejdo usage in generated editor [message #612661 is a reply to message #67303] Mon, 26 November 2007 10:23 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I think I found a regression between earlier versions
of EMFT and now. I have a working editor which connects to a Postgres using an .ejdo.
This includes Eclipse 3.2, EMF 2.2 and Teneo 0.7.5

If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
I get the dreaded "EPackage with nsuri: http://psidev.so...ta/mzdata.xsd can not be found"
I also rebuilt the whole project using the current EMF, to no avail.

I also included my hack to Register the Package by creating a dummy Instance.
public static class Implementation extends EclipseUIPlugin { public Implementation() {
super();
// Dummy call to register Package for EMF Teneo's ejdo
MzdataPackage m1 = MzdataPackage.eINSTANCE;

// Remember the static instance.
//
plugin = this;
}
}

Has anything changed which is not reflected in the library tutorial on the elver.org site ?

Yours
Steffen

[INFO] JpoxHelper - Registering a jpox resource factory for all uri's with jpox as the protocol/extension
[INFO] JpoxHelper - Registering a jpox resource factory for all uri's with ejdo as the protocol/extension
[INFO] JpoxHelper - Registering a jpox resource dao factory for all uri's with jpoxdao as the protocol/extension
[ERROR] TeneoException - EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found, <org.eclipse.emf.teneo.TeneoException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,>org.eclipse.emf.teneo.TeneoException: EPackage with nsuri: http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd can not be found,
at org.eclipse.emf.teneo.util.StoreUtil.getEPackages(StoreUtil. java:494)
at org.eclipse.emf.teneo.jpox.JpoxUtil.getCreateDataStore(JpoxU til.java:81)
at org.eclipse.emf.teneo.jpox.eclipse.OpenResource.openDataStor e(OpenResource.java:33)
at org.eclipse.emf.teneo.eclipse.resourcehandler.StoreOpenResou rce.run(StoreOpenResource.java:68)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:256)
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:546)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

- ------------------------------------------------------------ -------------------------

Can't read normal XML Files anymore:

If I change the mzdata model parser to JPOXResourceFactory
as described in the tutorial, I can't read normal XML files anymore,
giving me an NPE (stack below):

<extension point="org.eclipse.emf.ecore.extension_parser">
<parser type="mzdata"
class="de.ipbhalle.msbi.Mzdata.util.MzdataResourceFactoryImpl " />
<!-- parser type="mzdata"
class="org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory " -->
</extension>

If I check the resourceURI, it has "platform:/resource/IPB%20MSBI%20Data/example_kai.mzdata"
but the getResource() fails.

java.lang.NullPointerException
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:970)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:955)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createPage s(MzdataEditor.java:1005)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:283)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
at org.eclipse.ui.internal.EditorAreaHelper.setVisibleEditor(Ed itorAreaHelper.java:263)
at org.eclipse.ui.internal.EditorManager.setVisibleEditor(Edito rManager.java:1405)
at org.eclipse.ui.internal.EditorManager$5.runWithException(Edi torManager.java:939)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3296)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2974)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(Work benchAdvisor.java:801)
at org.eclipse.ui.internal.Workbench$25.runWithException(Workbe nch.java:1342)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run (StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:3 5)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchr onizer.java:123)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.jav a:3296)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2974)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2309)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

- ------------------------------------------------------------ -------------------------

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSp6Gir2msrPI0lQRAuqcAJ9EDR5zLS+jB8pWnjAFoxhg/9i4SACe NEUy
P6sg7kw/2H9v9ASONnuzHEE=
=Tu7a
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612662 is a reply to message #103671] Mon, 26 November 2007 10:29 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sneumann schrieb:
> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
That should read 0.8.0.v200709051239

Yours,
Steffe

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSp/5ir2msrPI0lQRAvNvAJ9o0BacH7Z7GvNNPeDIG8T52v+yXQCb B05Z
TN+wv2h4tcFMP7+Kmw+eKHM=
=+BAM
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612665 is a reply to message #103688] Mon, 26 November 2007 10:39 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Steffen,
The 'open resource' option uses the global registry to find the EPackage
(EPackage.Registry.INSTANCE.getEPackage(...)). So one way or another your epackage is not present
there. I am not sure if this is caused by Teneo or by EMF/Eclipse registering the epackages in a
different way (compared to the previous version).

Is the line:
MzdataPackage m1 = MzdataPackage.eINSTANCE;
executed before you open the ejdo file?
Maybe you should look at the way emf initializes the plugins (just guessing here).

Regarding the npe, it is difficult for me to comment on that as I do not know what is present on
line 970 in the MzdataEditor.java. Can you post part of the code and let me know what is null?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sneumann schrieb:
>> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
> That should read 0.8.0.v200709051239
>
> Yours,
> Steffe
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHSp/5ir2msrPI0lQRAvNvAJ9o0BacH7Z7GvNNPeDIG8T52v+yXQCb B05Z
> TN+wv2h4tcFMP7+Kmw+eKHM=
> =+BAM
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #612668 is a reply to message #103701] Mon, 26 November 2007 12:37 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
....
> Is the line:
> MzdataPackage m1 = MzdataPackage.eINSTANCE;
> executed before you open the ejdo file?
> Maybe you should look at the way emf initializes the plugins (just
> guessing here).

But a good guess ;-) If right after the start I open an ejdo,
the breakpoint inside MzdataEditorPlugin.implementation() is not hit,
actually not even the constructor MzdataEditorPlugin().

<extension point = "org.eclipse.ui.editors">
<editor
id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
extensions = "mzdata"
class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
</editor>
</extension>

name=mzdata
nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
dbname=mzData
dburl=jdbc:postgresql://kons/mzData

In the old eclipse-3.2 The breakpoint in Implementation() is being hit
upon opening the ejdo.

> Regarding the npe, it is difficult for me to comment on that as I do not
> know what is present on line 970 in the MzdataEditor.java. Can you post
> part of the code and let me know what is null?
Sorry, I am catching a Cold which makes me think a bit slow today.
There seems to be a problem because resource==NULL without an exception thrown.

java.lang.NullPointerException
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:970)
at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:955)

public void createModel() {
URI resourceURI = EditUIUtil.getURI(getEditorInput());
Exception exception = null;
Resource resource = null;
try {
// Load the resource through the editing domain.
//
resource = editingDomain.getResourceSet().getResource(resourceURI, true);
}
catch (Exception e) {
exception = e;
resource = editingDomain.getResourceSet().getResource(resourceURI, false);
}

955: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);

public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
970: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
BasicDiagnostic basicDiagnostic =
new BasicDiagnostic
(Diagnostic.ERROR,
"mzData.editor",
0,
getString("_UI_CreateModelError_message", resource.getURI()),
new Object [] { exception == null ? (Object)resource : exception });
basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
return basicDiagnostic;
}

>
> gr. Martin
>
> sneumann wrote:
> sneumann schrieb:
>>>> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
> That should read 0.8.0.v200709051239
>
> Yours,
> Steffe
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSr31ir2msrPI0lQRAnjOAKCCuN/nHXHtZ1/J04F9XctlWkWhGQCg hPFa
upBqlKn+yKqYXazIqZAIpVc=
=FmHu
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612670 is a reply to message #103729] Mon, 26 November 2007 13:45 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Teneo will try to find the epackage before the editor is opened so the initialization code should
probably be located somewhere else (in a location called when eclipse starts). I am not sure but I
can think that you can specify in the plugin that it should be initialized at startup.

Regarding the npe, I don't know why it won't find the resource, can you try to debug into the code
(editingDomain.getResourceSet().getResource(...)) and see what happens?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
> ....
>> Is the line:
>> MzdataPackage m1 = MzdataPackage.eINSTANCE;
>> executed before you open the ejdo file?
>> Maybe you should look at the way emf initializes the plugins (just
>> guessing here).
>
> But a good guess ;-) If right after the start I open an ejdo,
> the breakpoint inside MzdataEditorPlugin.implementation() is not hit,
> actually not even the constructor MzdataEditorPlugin().
>
> <extension point = "org.eclipse.ui.editors">
> <editor
> id = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID"
> extensions = "mzdata"
> class = "de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor"
> </editor>
> </extension>
>
> name=mzdata
> nsuri=http://psidev.sourceforge.net/ms/xml/mzdata/mzdata.xsd
> editorid=de.ipbhalle.msbi.Mzdata.presentation.MzdataEditorID
> dbname=mzData
> dburl=jdbc:postgresql://kons/mzData
>
> In the old eclipse-3.2 The breakpoint in Implementation() is being hit
> upon opening the ejdo.
>
>> Regarding the npe, it is difficult for me to comment on that as I do not
>> know what is present on line 970 in the MzdataEditor.java. Can you post
>> part of the code and let me know what is null?
> Sorry, I am catching a Cold which makes me think a bit slow today.
> There seems to be a problem because resource==NULL without an exception thrown.
>
> java.lang.NullPointerException
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.analyzeRes ourceProblems(MzdataEditor.java:970)
> at de.ipbhalle.msbi.Mzdata.presentation.MzdataEditor.createMode l(MzdataEditor.java:955)
>
> public void createModel() {
> URI resourceURI = EditUIUtil.getURI(getEditorInput());
> Exception exception = null;
> Resource resource = null;
> try {
> // Load the resource through the editing domain.
> //
> resource = editingDomain.getResourceSet().getResource(resourceURI, true);
> }
> catch (Exception e) {
> exception = e;
> resource = editingDomain.getResourceSet().getResource(resourceURI, false);
> }
>
> 955: Diagnostic diagnostic = analyzeResourceProblems(resource, exception);
>
> public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
> 970: if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
> BasicDiagnostic basicDiagnostic =
> new BasicDiagnostic
> (Diagnostic.ERROR,
> "mzData.editor",
> 0,
> getString("_UI_CreateModelError_message", resource.getURI()),
> new Object [] { exception == null ? (Object)resource : exception });
> basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
> return basicDiagnostic;
> }
>
>> gr. Martin
>>
>> sneumann wrote:
>> sneumann schrieb:
>>>>> If I open the same project in Eclipse 3.3, EMF 2.3 and Teneo 200709,
>> That should read 0.8.0.v200709051239
>>
>> Yours,
>> Steffe
>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHSr31ir2msrPI0lQRAnjOAKCCuN/nHXHtZ1/J04F9XctlWkWhGQCg hPFa
> upBqlKn+yKqYXazIqZAIpVc=
> =FmHu
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #612674 is a reply to message #103741] Mon, 26 November 2007 16:39 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> Regarding the npe, I don't know why it won't find the resource, can you
> try to debug into the code
> (editingDomain.getResourceSet().getResource(...)) and see what happens?

Things go wrong in the EesourceSetImpl.getResource()
inside the JPOXResourceFactory. I don't have the sources Installed for that.
This continues even when I went back to JPOX 1.1.8.

Although, 1.1.8 helped with the .ejdo Issue. I got an Postgres error,
because handling of dbpassword= has changed, but at least I know it tried
to connect to the RDBMS. And when I leave that out,
I have the same NPE in the editor as with the *.mzdata file.

Ideas ?

Yours,
Steffen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSva9ir2msrPI0lQRAnXHAJ9IvqQ5lnMVYzZHWTFHgMX6SdvNLQCg ikrp
TVxm95WkZUU1pWw7w3l0K8E=
=xanp
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612677 is a reply to message #103770] Mon, 26 November 2007 17:09 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sneumann schrieb:
> to connect to the RDBMS. And when I leave that out,
> I have the same NPE in the editor as with the *.mzdata file.

In ResourceSetImpl:

Resource result = resourceFactory.createResource(uri);
with resourceFactory = org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@f64084

Is where the exception occurs. I tried to attach the source to the jpox.jar,
but during debugging that failed.

Steffen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHSv2wir2msrPI0lQRAib0AJ9/UW3yGKcYatn1bB0C0HV+G+AwlgCf Unuh
sjt4LBnQMHj/ETVF7SxCN1I=
=B3jz
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612679 is a reply to message #103796] Mon, 26 November 2007 19:30 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
What is the stacktrace of this NPE (which line does it occur)?

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sneumann schrieb:
>> to connect to the RDBMS. And when I leave that out,
>> I have the same NPE in the editor as with the *.mzdata file.
>
> In ResourceSetImpl:
>
> Resource result = resourceFactory.createResource(uri);
> with resourceFactory = org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@f64084
>
> Is where the exception occurs. I tried to attach the source to the jpox.jar,
> but during debugging that failed.
>
> Steffen
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHSv2wir2msrPI0lQRAib0AJ9/UW3yGKcYatn1bB0C0HV+G+AwlgCf Unuh
> sjt4LBnQMHj/ETVF7SxCN1I=
> =B3jz
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #612688 is a reply to message #103770] Tue, 27 November 2007 08:59 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

sneumann schrieb:
> Martin Taal schrieb:
>>> Regarding the npe, I don't know why it won't find the resource, can you
>>> try to debug into the code
>>> (editingDomain.getResourceSet().getResource(...)) and see what happens?

I learned a bit more about which sources I need. Problem occurs in
JPOXResource line 148 in super.init() because JpoxHelper.INSTANCE.getDataStore("mzdata")
returns null.

Does that help ? What else is needed ?

Yours,
Steffen

ResourceFactoryRegistryImpl:
75: resourceFactory = delegatedGetFactory(uri);
cachedToString "platform:/resource/IPB%20MSBI%20Data/example_kai.mzdata"
resourceFactory JPOXResourceFactory (id=718)
org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@18961f2

80: return (Resource.Factory)resourceFactory;

ResourceSetImpl:
418: Resource result = resourceFactory.createResource(uri);
}

JPOXResource:
if (uri.query() == null && uri.fileExtension() != null) // this is probably a platform uri!
query null

143: log.debug("Trying fileextension: " + uri.fileExtension());

BANG!
148: super.init(emfDataStore.getTopClasses());
where emfDataStore null
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHS9yDir2msrPI0lQRApg5AKCMgUfXikTmCV0Rh9hzedqe+f3AZACe KpoQ
ZYjrfLdZb1ICrNOT+zuZyMg=
=xuus
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612689 is a reply to message #103868] Tue, 27 November 2007 09:32 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
In the class StoreOpenResource in the run method a call is done to openDataStore. Can you set a
breakpoint there and debug into openDataStore -> JpoxUtil.getCreateDataStore? The system should
create a datastore under the name set in the ejdo file (name = mzdata).

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> sneumann schrieb:
>> Martin Taal schrieb:
>>>> Regarding the npe, I don't know why it won't find the resource, can you
>>>> try to debug into the code
>>>> (editingDomain.getResourceSet().getResource(...)) and see what happens?
>
> I learned a bit more about which sources I need. Problem occurs in
> JPOXResource line 148 in super.init() because JpoxHelper.INSTANCE.getDataStore("mzdata")
> returns null.
>
> Does that help ? What else is needed ?
>
> Yours,
> Steffen
>
> ResourceFactoryRegistryImpl:
> 75: resourceFactory = delegatedGetFactory(uri);
> cachedToString "platform:/resource/IPB%20MSBI%20Data/example_kai.mzdata"
> resourceFactory JPOXResourceFactory (id=718)
> org.eclipse.emf.teneo.jpox.resource.JPOXResourceFactory@18961f2
>
> 80: return (Resource.Factory)resourceFactory;
>
> ResourceSetImpl:
> 418: Resource result = resourceFactory.createResource(uri);
> }
>
> JPOXResource:
> if (uri.query() == null && uri.fileExtension() != null) // this is probably a platform uri!
> query null
>
> 143: log.debug("Trying fileextension: " + uri.fileExtension());
>
> BANG!
> 148: super.init(emfDataStore.getTopClasses());
> where emfDataStore null
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHS9yDir2msrPI0lQRApg5AKCMgUfXikTmCV0Rh9hzedqe+f3AZACe KpoQ
> ZYjrfLdZb1ICrNOT+zuZyMg=
> =xuus
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #612690 is a reply to message #103882] Tue, 27 November 2007 11:13 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> In the class StoreOpenResource in the run method a call is done to
> openDataStore. Can you set a breakpoint there and debug into
> openDataStore -> JpoxUtil.getCreateDataStore? The system should create a
> datastore under the name set in the ejdo file (name = mzdata).

Comment first: the same NPE occurs if I open
a file resource *.mzdata as well. In that case
no ejdo was opened but the initialisation
of the editor has to take place anyway.

So I am getting closeer: One thing I didn't notice before debugging,
there was an exception:

javax.jdo.JDODataStoreException: Error adding class de.ipbhalle.msbi.Mzdata.impl.SupDataTypeImpl.boolean_
to list of persistence-managed classes : ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"

which was not visible before the debugging. I removed the DB, did a fresh import for the first object
using pm.makePersistent(mymzdata); and then I can open the .ejdo and subsequently the *.mzdata files.

Still, In a fresh eclipse-Application instance I can't open an *.mzdata before anything else bevause of the NPE.
And JpoxUtil.getCreateDataStore() is never called.

Or do I have some misconception on my side ?

Yours,
Steffen








-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHS/v1ir2msrPI0lQRAl8XAJ4kgwx0sILkFlxqbJRLqc5hzFug8gCf URUw
MXmyybUscXMtwOWnD7GHTPc=
=l4m2
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612692 is a reply to message #103896] Tue, 27 November 2007 11:33 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Afaics what goes wrong is that no datastore is initialized/created (with the name mzdata) before you
open the mzdata file.

So to solve this you have to initialize the datastore when you start your app. In the tutorial on
the elver.org website (http://www.elver.org/jpox/tutorial2/tutorial2_1.html) I set it in the
editorplugin. Maybe in your case there is a better plugin/location to do that. Do you have a plugin
which starts when your app starts?

As some extra info:
Note that when an mzdata file is opened Teneo uses a 'little' trick to find the datastore. It works
as follows:
- You right click on a mzdata file and select open with default editor
- The editor plugin is started and initializes the datastore (using the tutorial code as described
above).
- The editor plugin opens the resource by passing the uri (ending on mzdata) to the resource set.
- The resourcefactory for uri's ending on mzdata is the jpox resource factory (is set in the
extension of the model plugin project)
- The JPOX resource is created using the uri, the jpox resource uses the extension of the uri
(mzdata) to search for a datastore.

When an ejdo file is opened it works as follows:
- You right click on a ejdo file and in the teneo submenu select open resource
- The open resource plugin will read the ejdo file and initialize a datastore using the name in the
ejdo file.
- Then it will find an editor using the information in the ejdo file. The editor will be started
with the ejdo file as the file to open.
- The jpox resource factory is registered for the ejdo extension. So this resource factory will
create a jpox resource.
- The jpox resource detects that the uri ends on ejdo and looks at the contents of the file. It uses
the name property in the file to find the datastore.

Hope this helps to clarify how it works.

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> In the class StoreOpenResource in the run method a call is done to
>> openDataStore. Can you set a breakpoint there and debug into
>> openDataStore -> JpoxUtil.getCreateDataStore? The system should create a
>> datastore under the name set in the ejdo file (name = mzdata).
>
> Comment first: the same NPE occurs if I open
> a file resource *.mzdata as well. In that case
> no ejdo was opened but the initialisation
> of the editor has to take place anyway.
>
> So I am getting closeer: One thing I didn't notice before debugging,
> there was an exception:
>
> javax.jdo.JDODataStoreException: Error adding class de.ipbhalle.msbi.Mzdata.impl.SupDataTypeImpl.boolean_
> to list of persistence-managed classes : ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"
> org.postgresql.util.PSQLException: ERROR: duplicate key violates unique constraint "JPOX_TABLES_CLASS_NAME_key"
>
> which was not visible before the debugging. I removed the DB, did a fresh import for the first object
> using pm.makePersistent(mymzdata); and then I can open the .ejdo and subsequently the *.mzdata files.
>
> Still, In a fresh eclipse-Application instance I can't open an *.mzdata before anything else bevause of the NPE.
> And JpoxUtil.getCreateDataStore() is never called.
>
> Or do I have some misconception on my side ?
>
> Yours,
> Steffen
>
>
>
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHS/v1ir2msrPI0lQRAl8XAJ4kgwx0sILkFlxqbJRLqc5hzFug8gCf URUw
> MXmyybUscXMtwOWnD7GHTPc=
> =l4m2
> -----END PGP SIGNATURE-----


--

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: Teneo: [Regression].ejdo usage in generated editor [message #612694 is a reply to message #103908] Tue, 27 November 2007 12:26 Go to previous message
Steffen Neumann is currently offline Steffen NeumannFriend
Messages: 41
Registered: July 2009
Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Taal schrieb:
> So to solve this you have to initialize the datastore when you start
> your app. In the tutorial on the elver.org website
> (http://www.elver.org/jpox/tutorial2/tutorial2_1.html) I set it in the
> editorplugin.

Ah, so the comment there "Note this code should not be added if you want to start the editor using the Resource Utility"
is a bit misleading: "... using _only_ the Resource Utility and no other (e.g. file-based) methods."

Since I can't initialize the jpoxDataStore in the Plugin.start()
if I don't know the JDBC URL (which is to be found in the .ejdo later)
I am looking for stripped-down version of JpoxDataStore.initialize()
that registers only the "'little' trick to find the datastore".

Is there a convenient way to initialize a non-JDBC PMF ?

Yours,
Steffen

P.S.: In The JpoxDataStore I found that !updateSchema is ignored, is that intentionally ?
if (!updateSchema) {
log.debug("Update of the database schema has been disabled returning");
}
log.debug("Updating database schema");
....



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHTAzeir2msrPI0lQRAgQWAJ0Re34kAo1DwdrW8jUIeGtohtQQbACf feVM
bye2eLWtB8Vdvt4gbvdI0r8=
=qgb1
-----END PGP SIGNATURE-----
Re: Teneo: [Regression].ejdo usage in generated editor [message #612696 is a reply to message #103922] Tue, 27 November 2007 15:02 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Yes, the text is not valid anymore. I will change that.

I am not sure what you mean with stripped down version of jpoxdatastore.initialize(). You can call
this method: JpoxHelper.createRegisterDataStore("mzdata") to create a datastore and register it
under the mzdata name. It won't be initialized at that point in time. This can be done later.

However, I am not sure if this is were your problem is. Also the plugin which handles the ejdo file
creates and registers a datastore. You can try this out by setting a breakpoint in
org.eclipse.emf.teneo.jpox.eclipse.OpenResource in the method openDataStore. But I don't know why
this register step does not seem to happen....

gr. Martin

sneumann wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Martin Taal schrieb:
>> So to solve this you have to initialize the datastore when you start
>> your app. In the tutorial on the elver.org website
>> (http://www.elver.org/jpox/tutorial2/tutorial2_1.html) I set it in the
>> editorplugin.
>
> Ah, so the comment there "Note this code should not be added if you want to start the editor using the Resource Utility"
> is a bit misleading: "... using _only_ the Resource Utility and no other (e.g. file-based) methods."
>
> Since I can't initialize the jpoxDataStore in the Plugin.start()
> if I don't know the JDBC URL (which is to be found in the .ejdo later)
> I am looking for stripped-down version of JpoxDataStore.initialize()
> that registers only the "'little' trick to find the datastore".
>
> Is there a convenient way to initialize a non-JDBC PMF ?
>
> Yours,
> Steffen
>
> P.S.: In The JpoxDataStore I found that !updateSchema is ignored, is that intentionally ?
> if (!updateSchema) {
> log.debug("Update of the database schema has been disabled returning");
> }
> log.debug("Updating database schema");
> ....
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHTAzeir2msrPI0lQRAgQWAJ0Re34kAo1DwdrW8jUIeGtohtQQbACf feVM
> bye2eLWtB8Vdvt4gbvdI0r8=
> =qgb1
> -----END PGP SIGNATURE-----


--

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:[CDO] Performance problem
Next Topic:Adapting Ecore Editor to Teneo_Hibernate Editor
Goto Forum:
  


Current Time: Sat Sep 19 16:00:15 GMT 2020

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

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

Back to the top