Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection
[Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116341] Mon, 31 March 2008 00:04 Go to next message
Eclipse UserFriend
Originally posted by: user.example.net

Hi,

I am trying to go through the library tutorial, but I keep getting the
following error. Any ideas?

Thank you,

Calin


SEVERE: illegal access to loading collection
org.hibernate.LazyInitializationException: illegal access to loading
collection
at
org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
at
org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
at
org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
at org.hibernate.collection.PersistentList.size(PersistentList. java:91)
at
org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
at
org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
at
org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
at
org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
at org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
at
org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
at
org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
at
org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
at
org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
at
org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
at
org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
at
org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
at
org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
at
org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
at
org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
at
org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
at
org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.runtime.Platform.run(Platform.java:857)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
at org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
at
org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
at
org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
at
org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
at
org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
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)
Re: [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116399 is a reply to message #116341] Mon, 31 March 2008 08:01 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Calin,
I have replayed the tutorial and I don't get this exception. Can you describe which steps you take
to open the editor and which editing actions you do? Then I can try to replicate your steps.

gr. Martin

Calin Medianu wrote:
> Hi,
>
> I am trying to go through the library tutorial, but I keep getting the
> following error. Any ideas?
>
> Thank you,
>
> Calin
>
>
> SEVERE: illegal access to loading collection
> org.hibernate.LazyInitializationException: illegal access to loading
> collection
> at
> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>
> at org.hibernate.collection.PersistentList.size(PersistentList. java:91)
> at
> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
> at
> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>
> at org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
> at
> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>
> at
> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>
> at
> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>
> at
> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>
> at
> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>
> at
> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>
> at
> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>
> at
> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>
> at
> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>
> at
> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>
> at
> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>
> at
> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>
> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
> at
> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
> at
> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>
> at
> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>
> at
> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>
> at
> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>
> at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
> at
> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
> 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)


--

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] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116445 is a reply to message #116399] Tue, 01 April 2008 05:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.example.net

Hi Martin,

Thank you for responding. I don't do anything special, I start a new
Eclipse Application from the Run menu, including the workspace plugins,
then in the new Eclipse I do File -> New -> Library Model. A new library
is created at this point. When I click on it, to add children, I get the
error. Is there a version of the finished tutorial available somewhere
so I can maybe compare mine with that one, see what's different?

Thank you,

Calin


> Hi Calin,
> I have replayed the tutorial and I don't get this exception. Can you
> describe which steps you take to open the editor and which editing
> actions you do? Then I can try to replicate your steps.
>
> gr. Martin
>
> Calin Medianu wrote:
>> Hi,
>>
>> I am trying to go through the library tutorial, but I keep getting the
>> following error. Any ideas?
>>
>> Thank you,
>>
>> Calin
>>
>>
>> SEVERE: illegal access to loading collection
>> org.hibernate.LazyInitializationException: illegal access to loading
>> collection
>> at
>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>
>> at
>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>
>> at
>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>
>> at
>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>> at
>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>
>> at
>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>
>> at
>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>
>> at
>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>
>> at
>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>> at
>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>
>> at
>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>
>> at
>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>
>> at
>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>
>> at
>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>
>> at
>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>
>> at
>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>
>> at
>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>
>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>> at
>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>
>> at
>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>
>> at
>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>> at
>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>> at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>> 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)
>
>
Re: [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116469 is a reply to message #116445] Tue, 01 April 2008 07:38 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Calin,
I have put the Library example (for emf 2.3) in the following cvs location:
host: dev.eclipse.org
cvs root: /cvsroot/modeling
module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)

You can find the source code changes if you look for the string teneo.start or teneo.end.
There are two additional changes:
- in the plugin.xml of the model project I have changed the extension point to use the
HibernateResourceFactory
- the manifest.mf of the model project has two extra dependencies: one for the hibernate.teneo
plugin and one for a plugin containing all hibernate.jar files. This last plugin is not in cvs
because of licensing reasons. Both dependencies have re-export on true.

Have you set the buddypolicy of the Hibernate plugin to dependent?

The above changes are described in the tutorial also (so afaics I did not do anything other then
what was described in the tutorial).

Let me know if you see any differences with your setup.

I will add the cvs link to the tutorial.

gr. Martin

Calin Medianu wrote:
> Hi Martin,
>
> Thank you for responding. I don't do anything special, I start a new
> Eclipse Application from the Run menu, including the workspace plugins,
> then in the new Eclipse I do File -> New -> Library Model. A new library
> is created at this point. When I click on it, to add children, I get the
> error. Is there a version of the finished tutorial available somewhere
> so I can maybe compare mine with that one, see what's different?
>
> Thank you,
>
> Calin
>
>
>> Hi Calin,
>> I have replayed the tutorial and I don't get this exception. Can you
>> describe which steps you take to open the editor and which editing
>> actions you do? Then I can try to replicate your steps.
>>
>> gr. Martin
>>
>> Calin Medianu wrote:
>>> Hi,
>>>
>>> I am trying to go through the library tutorial, but I keep getting
>>> the following error. Any ideas?
>>>
>>> Thank you,
>>>
>>> Calin
>>>
>>>
>>> SEVERE: illegal access to loading collection
>>> org.hibernate.LazyInitializationException: illegal access to loading
>>> collection
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>
>>> at
>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>> at
>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>
>>> at
>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>
>>> at
>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>
>>> at
>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>> at
>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>
>>> at
>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>
>>> at
>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>
>>> at
>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>
>>> at
>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>
>>> at
>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>
>>> at
>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>
>>> at
>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>
>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>> at
>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>
>>> at
>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>
>>> at
>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>> at
>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>> at
>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>> at
>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>> 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)
>>
>>


--

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] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116506 is a reply to message #116469] Tue, 01 April 2008 18:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: user.example.net

Hello Martin,

This works much better :) I'll go through the tutorial again to see
where mine was different.

Small problem though. If I create a new book and just accept the default
category (Mistery) and pages (0), the category and pages are not set on
the new object, the save fails and the editor crashes.

Is there a quick way to restart the editor without going through the
File -> New wizard, that creates a new library? The problem is that the
state of the editor is never saved on the disk, the way it was in the
..library file..

Thanks a lot!

Calin

Hibernate: update "library" set e_version=?, "name"=? where e_id=? and
e_version=?
Hibernate: select books0_."writer_e_id" as writer1_2_,
books0_."book_e_id" as book2_2_, books0_."writer_books_idx" as
writer3_2_, book1_.e_id as e1_0_0_, book1_.e_version as e3_0_0_,
book1_."title" as title4_0_0_, book1_."pages" as pages5_0_0_,
book1_."category" as category6_0_0_, book1_."book_author_e_id" as
book7_0_0_, book1_.econtainer_class as econtainer10_0_0_,
book1_.e_container as e11_0_0_, book1_.e_container_featureid as
e12_0_0_, writer2_.e_id as e1_2_1_, writer2_.e_version as e3_2_1_,
writer2_."name" as name4_2_1_, writer2_.econtainer_class as
econtainer7_2_1_, writer2_.e_container as e8_2_1_,
writer2_.e_container_featureid as e9_2_1_ from "writer_books" books0_
left outer join "book" book1_ on books0_."book_e_id"=book1_.e_id left
outer join "writer" writer2_ on book1_."book_author_e_id"=writer2_.e_id
where books0_."writer_e_id"=?
1-Apr-2008 11:22:15 AM org.eclipse.emf.teneo.TeneoException <init>
SEVERE: Diagnosis of
org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
The required feature 'pages' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
The required feature 'category' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
org.eclipse.emf.teneo.StoreValidationException: Diagnosis of
org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
The required feature 'pages' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
The required feature 'category' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
at
org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:409)
at
org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:347)
at
org.eclipse.example.library.presentation.LibraryEditor$18.ex ecute(LibraryEditor.java:1461)
at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
> Hi Calin,
> I have put the Library example (for emf 2.3) in the following cvs location:
> host: dev.eclipse.org
> cvs root: /cvsroot/modeling
> module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)
>
> You can find the source code changes if you look for the string
> teneo.start or teneo.end.
> There are two additional changes:
> - in the plugin.xml of the model project I have changed the extension
> point to use the HibernateResourceFactory
> - the manifest.mf of the model project has two extra dependencies: one
> for the hibernate.teneo plugin and one for a plugin containing all
> hibernate.jar files. This last plugin is not in cvs because of licensing
> reasons. Both dependencies have re-export on true.
>
> Have you set the buddypolicy of the Hibernate plugin to dependent?
>
> The above changes are described in the tutorial also (so afaics I did
> not do anything other then what was described in the tutorial).
>
> Let me know if you see any differences with your setup.
>
> I will add the cvs link to the tutorial.
>
> gr. Martin
>
> Calin Medianu wrote:
>> Hi Martin,
>>
>> Thank you for responding. I don't do anything special, I start a new
>> Eclipse Application from the Run menu, including the workspace
>> plugins, then in the new Eclipse I do File -> New -> Library Model. A
>> new library is created at this point. When I click on it, to add
>> children, I get the error. Is there a version of the finished tutorial
>> available somewhere so I can maybe compare mine with that one, see
>> what's different?
>>
>> Thank you,
>>
>> Calin
>>
>>
>>> Hi Calin,
>>> I have replayed the tutorial and I don't get this exception. Can you
>>> describe which steps you take to open the editor and which editing
>>> actions you do? Then I can try to replicate your steps.
>>>
>>> gr. Martin
>>>
>>> Calin Medianu wrote:
>>>> Hi,
>>>>
>>>> I am trying to go through the library tutorial, but I keep getting
>>>> the following error. Any ideas?
>>>>
>>>> Thank you,
>>>>
>>>> Calin
>>>>
>>>>
>>>> SEVERE: illegal access to loading collection
>>>> org.hibernate.LazyInitializationException: illegal access to loading
>>>> collection
>>>> at
>>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>>
>>>> at
>>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>>
>>>> at
>>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>>
>>>> at
>>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>>> at
>>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>>
>>>> at
>>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>>> at
>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>>
>>>> at
>>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>>
>>>> at
>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>>
>>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>>> at
>>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>>
>>>> at
>>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>>
>>>> at
>>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>>> at
>>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>>>
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>> at
>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>> at
>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>> 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)
>>>
>>>
>
>
Re: [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116514 is a reply to message #116506] Tue, 01 April 2008 19:07 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Calin,
This is actually more an issue with that EMF assumes these mandatory features to be unset because it
compares the value with the default value. See the italic text here:
http://www.elver.org/hibernate/tutorialtwo/tutorial2_2.html

I remember thet this topic was discussed earlier on the newsgroup.

For starting the editor directly without going through the wizard, see here:
http://www.elver.org/hibernate/resource_utility.html

When you use this utility, see also the remark in italic:
http://www.elver.org/hibernate/tutorialtwo/tutorial2_1.html

gr. Martin

Calin Medianu wrote:
> Hello Martin,
>
> This works much better :) I'll go through the tutorial again to see
> where mine was different.
>
> Small problem though. If I create a new book and just accept the default
> category (Mistery) and pages (0), the category and pages are not set on
> the new object, the save fails and the editor crashes.
>
> Is there a quick way to restart the editor without going through the
> File -> New wizard, that creates a new library? The problem is that the
> state of the editor is never saved on the disk, the way it was in the
> ..library file..
>
> Thanks a lot!
>
> Calin
>
> Hibernate: update "library" set e_version=?, "name"=? where e_id=? and
> e_version=?
> Hibernate: select books0_."writer_e_id" as writer1_2_,
> books0_."book_e_id" as book2_2_, books0_."writer_books_idx" as
> writer3_2_, book1_.e_id as e1_0_0_, book1_.e_version as e3_0_0_,
> book1_."title" as title4_0_0_, book1_."pages" as pages5_0_0_,
> book1_."category" as category6_0_0_, book1_."book_author_e_id" as
> book7_0_0_, book1_.econtainer_class as econtainer10_0_0_,
> book1_.e_container as e11_0_0_, book1_.e_container_featureid as
> e12_0_0_, writer2_.e_id as e1_2_1_, writer2_.e_version as e3_2_1_,
> writer2_."name" as name4_2_1_, writer2_.econtainer_class as
> econtainer7_2_1_, writer2_.e_container as e8_2_1_,
> writer2_.e_container_featureid as e9_2_1_ from "writer_books" books0_
> left outer join "book" book1_ on books0_."book_e_id"=book1_.e_id left
> outer join "writer" writer2_ on book1_."book_author_e_id"=writer2_.e_id
> where books0_."writer_e_id"=?
> 1-Apr-2008 11:22:15 AM org.eclipse.emf.teneo.TeneoException <init>
> SEVERE: Diagnosis of
> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>
> The required feature 'pages' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> The required feature 'category' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> org.eclipse.emf.teneo.StoreValidationException: Diagnosis of
> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>
> The required feature 'pages' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> The required feature 'category' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> at
> org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:409)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:347)
> at
> org.eclipse.example.library.presentation.LibraryEditor$18.ex ecute(LibraryEditor.java:1461)
>
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
>
> at
> org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
>
>> Hi Calin,
>> I have put the Library example (for emf 2.3) in the following cvs
>> location:
>> host: dev.eclipse.org
>> cvs root: /cvsroot/modeling
>> module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)
>>
>> You can find the source code changes if you look for the string
>> teneo.start or teneo.end.
>> There are two additional changes:
>> - in the plugin.xml of the model project I have changed the extension
>> point to use the HibernateResourceFactory
>> - the manifest.mf of the model project has two extra dependencies: one
>> for the hibernate.teneo plugin and one for a plugin containing all
>> hibernate.jar files. This last plugin is not in cvs because of
>> licensing reasons. Both dependencies have re-export on true.
>>
>> Have you set the buddypolicy of the Hibernate plugin to dependent?
>>
>> The above changes are described in the tutorial also (so afaics I did
>> not do anything other then what was described in the tutorial).
>>
>> Let me know if you see any differences with your setup.
>>
>> I will add the cvs link to the tutorial.
>>
>> gr. Martin
>>
>> Calin Medianu wrote:
>>> Hi Martin,
>>>
>>> Thank you for responding. I don't do anything special, I start a new
>>> Eclipse Application from the Run menu, including the workspace
>>> plugins, then in the new Eclipse I do File -> New -> Library Model. A
>>> new library is created at this point. When I click on it, to add
>>> children, I get the error. Is there a version of the finished
>>> tutorial available somewhere so I can maybe compare mine with that
>>> one, see what's different?
>>>
>>> Thank you,
>>>
>>> Calin
>>>
>>>
>>>> Hi Calin,
>>>> I have replayed the tutorial and I don't get this exception. Can you
>>>> describe which steps you take to open the editor and which editing
>>>> actions you do? Then I can try to replicate your steps.
>>>>
>>>> gr. Martin
>>>>
>>>> Calin Medianu wrote:
>>>>> Hi,
>>>>>
>>>>> I am trying to go through the library tutorial, but I keep getting
>>>>> the following error. Any ideas?
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Calin
>>>>>
>>>>>
>>>>> SEVERE: illegal access to loading collection
>>>>> org.hibernate.LazyInitializationException: illegal access to
>>>>> loading collection
>>>>> at
>>>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>>>
>>>>> at
>>>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>>>
>>>>> at
>>>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>>>
>>>>> at
>>>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>>>> at
>>>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>>>> at
>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>>>
>>>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>>>> at
>>>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>>>> at
>>>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>>>> at
>>>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>>>>
>>>>> at
>>>>> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>>> 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)
>>>>
>>>>
>>
>>


--

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] org.hibernate.LazyInitializationException: illegal access to loading collection [message #116523 is a reply to message #116514] Tue, 01 April 2008 19:44 Go to previous message
Eclipse UserFriend
Originally posted by: user.example.net

Thank you very much!

Calin


> Hi Calin,
> This is actually more an issue with that EMF assumes these mandatory
> features to be unset because it compares the value with the default
> value. See the italic text here:
> http://www.elver.org/hibernate/tutorialtwo/tutorial2_2.html

>
> I remember thet this topic was discussed earlier on the newsgroup.
>
> For starting the editor directly without going through the wizard, see
> here:
> http://www.elver.org/hibernate/resource_utility.html
>
> When you use this utility, see also the remark in italic:
> http://www.elver.org/hibernate/tutorialtwo/tutorial2_1.html
>
> gr. Martin
>
> Calin Medianu wrote:
>> Hello Martin,
>>
>> This works much better :) I'll go through the tutorial again to see
>> where mine was different.
>>
>> Small problem though. If I create a new book and just accept the
>> default category (Mistery) and pages (0), the category and pages are
>> not set on the new object, the save fails and the editor crashes.
>>
>> Is there a quick way to restart the editor without going through the
>> File -> New wizard, that creates a new library? The problem is that
>> the state of the editor is never saved on the disk, the way it was in
>> the ..library file..
>>
>> Thanks a lot!
>>
>> Calin
>>
>> Hibernate: update "library" set e_version=?, "name"=? where e_id=? and
>> e_version=?
>> Hibernate: select books0_."writer_e_id" as writer1_2_,
>> books0_."book_e_id" as book2_2_, books0_."writer_books_idx" as
>> writer3_2_, book1_.e_id as e1_0_0_, book1_.e_version as e3_0_0_,
>> book1_."title" as title4_0_0_, book1_."pages" as pages5_0_0_,
>> book1_."category" as category6_0_0_, book1_."book_author_e_id" as
>> book7_0_0_, book1_.econtainer_class as econtainer10_0_0_,
>> book1_.e_container as e11_0_0_, book1_.e_container_featureid as
>> e12_0_0_, writer2_.e_id as e1_2_1_, writer2_.e_version as e3_2_1_,
>> writer2_."name" as name4_2_1_, writer2_.econtainer_class as
>> econtainer7_2_1_, writer2_.e_container as e8_2_1_,
>> writer2_.e_container_featureid as e9_2_1_ from "writer_books" books0_
>> left outer join "book" book1_ on books0_."book_e_id"=book1_.e_id left
>> outer join "writer" writer2_ on
>> book1_."book_author_e_id"=writer2_.e_id where books0_."writer_e_id"=?
>> 1-Apr-2008 11:22:15 AM org.eclipse.emf.teneo.TeneoException <init>
>> SEVERE: Diagnosis of
>> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>>
>> The required feature 'pages' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
>> must be set
>> The required feature 'category' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
>> must be set
>> org.eclipse.emf.teneo.StoreValidationException: Diagnosis of
>> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>>
>> The required feature 'pages' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
>> must be set
>> The required feature 'category' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'

>> must be set
>> at
>> org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:409)
>>
>> at
>> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:347)
>> at
>> org.eclipse.example.library.presentation.LibraryEditor$18.ex ecute(LibraryEditor.java:1461)
>>
>> at
>> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
>>
>> at
>> org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
>> at
>> org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
>>
>> at
>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
>>
>>> Hi Calin,
>>> I have put the Library example (for emf 2.3) in the following cvs
>>> location:
>>> host: dev.eclipse.org
>>> cvs root: /cvsroot/modeling
>>> module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)
>>>
>>> You can find the source code changes if you look for the string
>>> teneo.start or teneo.end.
>>> There are two additional changes:
>>> - in the plugin.xml of the model project I have changed the extension
>>> point to use the HibernateResourceFactory
>>> - the manifest.mf of the model project has two extra dependencies:
>>> one for the hibernate.teneo plugin and one for a plugin containing
>>> all hibernate.jar files. This last plugin is not in cvs because of
>>> licensing reasons. Both dependencies have re-export on true.
>>>
>>> Have you set the buddypolicy of the Hibernate plugin to dependent?
>>>
>>> The above changes are described in the tutorial also (so afaics I did
>>> not do anything other then what was described in the tutorial).
>>>
>>> Let me know if you see any differences with your setup.
>>>
>>> I will add the cvs link to the tutorial.
>>>
>>> gr. Martin
>>>
>>> Calin Medianu wrote:
>>>> Hi Martin,
>>>>
>>>> Thank you for responding. I don't do anything special, I start a new
>>>> Eclipse Application from the Run menu, including the workspace
>>>> plugins, then in the new Eclipse I do File -> New -> Library Model.
>>>> A new library is created at this point. When I click on it, to add
>>>> children, I get the error. Is there a version of the finished
>>>> tutorial available somewhere so I can maybe compare mine with that
>>>> one, see what's different?
>>>>
>>>> Thank you,
>>>>
>>>> Calin
>>>>
>>>>
>>>>> Hi Calin,
>>>>> I have replayed the tutorial and I don't get this exception. Can
>>>>> you describe which steps you take to open the editor and which
>>>>> editing actions you do? Then I can try to replicate your steps.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Calin Medianu wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to go through the library tutorial, but I keep getting
>>>>>> the following error. Any ideas?
>>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> Calin
>>>>>>
>>>>>>
>>>>>> SEVERE: illegal access to loading collection
>>>>>> org.hibernate.LazyInitializationException: illegal access to
>>>>>> loading collection
>>>>>> at
>>>>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>>>>> at
>>>>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>>>>> at
>>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>>>>
>>>>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>>>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>>>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>>>>> at
>>>>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>>>>> at
>>>>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>>>> 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)
>>>>>
>>>>>
>>>
>>>
>
>
Re: [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #616034 is a reply to message #116341] Mon, 31 March 2008 08:01 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Calin,
I have replayed the tutorial and I don't get this exception. Can you describe which steps you take
to open the editor and which editing actions you do? Then I can try to replicate your steps.

gr. Martin

Calin Medianu wrote:
> Hi,
>
> I am trying to go through the library tutorial, but I keep getting the
> following error. Any ideas?
>
> Thank you,
>
> Calin
>
>
> SEVERE: illegal access to loading collection
> org.hibernate.LazyInitializationException: illegal access to loading
> collection
> at
> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>
> at
> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>
> at org.hibernate.collection.PersistentList.size(PersistentList. java:91)
> at
> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>
> at
> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>
> at
> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
> at
> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>
> at org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
> at
> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>
> at
> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>
> at
> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>
> at
> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>
> at
> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>
> at
> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>
> at
> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>
> at
> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>
> at
> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>
> at
> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>
> at
> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>
> at
> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>
> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
> at
> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
> at
> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>
> at
> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>
> at
> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>
> at
> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>
> at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
> at
> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
> 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)


--

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] org.hibernate.LazyInitializationException: illegal access to loading collection [message #616040 is a reply to message #116399] Tue, 01 April 2008 05:45 Go to previous message
Calin Medianu is currently offline Calin MedianuFriend
Messages: 12
Registered: July 2009
Junior Member
Hi Martin,

Thank you for responding. I don't do anything special, I start a new
Eclipse Application from the Run menu, including the workspace plugins,
then in the new Eclipse I do File -> New -> Library Model. A new library
is created at this point. When I click on it, to add children, I get the
error. Is there a version of the finished tutorial available somewhere
so I can maybe compare mine with that one, see what's different?

Thank you,

Calin


> Hi Calin,
> I have replayed the tutorial and I don't get this exception. Can you
> describe which steps you take to open the editor and which editing
> actions you do? Then I can try to replicate your steps.
>
> gr. Martin
>
> Calin Medianu wrote:
>> Hi,
>>
>> I am trying to go through the library tutorial, but I keep getting the
>> following error. Any ideas?
>>
>> Thank you,
>>
>> Calin
>>
>>
>> SEVERE: illegal access to loading collection
>> org.hibernate.LazyInitializationException: illegal access to loading
>> collection
>> at
>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>
>> at
>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>
>> at
>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>
>> at
>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>> at
>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>
>> at
>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>
>> at
>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>
>> at
>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>
>> at
>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>> at
>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>
>> at
>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>
>> at
>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>
>> at
>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>
>> at
>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>
>> at
>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>
>> at
>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>
>> at
>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>
>> at
>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>
>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>> at
>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>> at
>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>
>> at
>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>
>> at
>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>
>> at
>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>> at
>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>> at
>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>> 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)
>
>
Re: [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #616043 is a reply to message #116445] Tue, 01 April 2008 07:38 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Calin,
I have put the Library example (for emf 2.3) in the following cvs location:
host: dev.eclipse.org
cvs root: /cvsroot/modeling
module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)

You can find the source code changes if you look for the string teneo.start or teneo.end.
There are two additional changes:
- in the plugin.xml of the model project I have changed the extension point to use the
HibernateResourceFactory
- the manifest.mf of the model project has two extra dependencies: one for the hibernate.teneo
plugin and one for a plugin containing all hibernate.jar files. This last plugin is not in cvs
because of licensing reasons. Both dependencies have re-export on true.

Have you set the buddypolicy of the Hibernate plugin to dependent?

The above changes are described in the tutorial also (so afaics I did not do anything other then
what was described in the tutorial).

Let me know if you see any differences with your setup.

I will add the cvs link to the tutorial.

gr. Martin

Calin Medianu wrote:
> Hi Martin,
>
> Thank you for responding. I don't do anything special, I start a new
> Eclipse Application from the Run menu, including the workspace plugins,
> then in the new Eclipse I do File -> New -> Library Model. A new library
> is created at this point. When I click on it, to add children, I get the
> error. Is there a version of the finished tutorial available somewhere
> so I can maybe compare mine with that one, see what's different?
>
> Thank you,
>
> Calin
>
>
>> Hi Calin,
>> I have replayed the tutorial and I don't get this exception. Can you
>> describe which steps you take to open the editor and which editing
>> actions you do? Then I can try to replicate your steps.
>>
>> gr. Martin
>>
>> Calin Medianu wrote:
>>> Hi,
>>>
>>> I am trying to go through the library tutorial, but I keep getting
>>> the following error. Any ideas?
>>>
>>> Thank you,
>>>
>>> Calin
>>>
>>>
>>> SEVERE: illegal access to loading collection
>>> org.hibernate.LazyInitializationException: illegal access to loading
>>> collection
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>
>>> at
>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>
>>> at
>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>> at
>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>
>>> at
>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>
>>> at
>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>
>>> at
>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>
>>> at
>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>> at
>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>
>>> at
>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>
>>> at
>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>
>>> at
>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>
>>> at
>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>
>>> at
>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>
>>> at
>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>
>>> at
>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>
>>> at
>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>
>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>> at
>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>
>>> at
>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>
>>> at
>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>
>>> at
>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>> at
>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>> at
>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>> at
>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>> 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)
>>
>>


--

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] org.hibernate.LazyInitializationException: illegal access to loading collection [message #616049 is a reply to message #116469] Tue, 01 April 2008 18:41 Go to previous message
Calin Medianu is currently offline Calin MedianuFriend
Messages: 12
Registered: July 2009
Junior Member
Hello Martin,

This works much better :) I'll go through the tutorial again to see
where mine was different.

Small problem though. If I create a new book and just accept the default
category (Mistery) and pages (0), the category and pages are not set on
the new object, the save fails and the editor crashes.

Is there a quick way to restart the editor without going through the
File -> New wizard, that creates a new library? The problem is that the
state of the editor is never saved on the disk, the way it was in the
..library file..

Thanks a lot!

Calin

Hibernate: update "library" set e_version=?, "name"=? where e_id=? and
e_version=?
Hibernate: select books0_."writer_e_id" as writer1_2_,
books0_."book_e_id" as book2_2_, books0_."writer_books_idx" as
writer3_2_, book1_.e_id as e1_0_0_, book1_.e_version as e3_0_0_,
book1_."title" as title4_0_0_, book1_."pages" as pages5_0_0_,
book1_."category" as category6_0_0_, book1_."book_author_e_id" as
book7_0_0_, book1_.econtainer_class as econtainer10_0_0_,
book1_.e_container as e11_0_0_, book1_.e_container_featureid as
e12_0_0_, writer2_.e_id as e1_2_1_, writer2_.e_version as e3_2_1_,
writer2_."name" as name4_2_1_, writer2_.econtainer_class as
econtainer7_2_1_, writer2_.e_container as e8_2_1_,
writer2_.e_container_featureid as e9_2_1_ from "writer_books" books0_
left outer join "book" book1_ on books0_."book_e_id"=book1_.e_id left
outer join "writer" writer2_ on book1_."book_author_e_id"=writer2_.e_id
where books0_."writer_e_id"=?
1-Apr-2008 11:22:15 AM org.eclipse.emf.teneo.TeneoException <init>
SEVERE: Diagnosis of
org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
The required feature 'pages' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
The required feature 'category' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
org.eclipse.emf.teneo.StoreValidationException: Diagnosis of
org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
The required feature 'pages' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
The required feature 'category' of
'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
must be set
at
org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:409)
at
org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:347)
at
org.eclipse.example.library.presentation.LibraryEditor$18.ex ecute(LibraryEditor.java:1461)
at
org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
at org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
at
org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
> Hi Calin,
> I have put the Library example (for emf 2.3) in the following cvs location:
> host: dev.eclipse.org
> cvs root: /cvsroot/modeling
> module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)
>
> You can find the source code changes if you look for the string
> teneo.start or teneo.end.
> There are two additional changes:
> - in the plugin.xml of the model project I have changed the extension
> point to use the HibernateResourceFactory
> - the manifest.mf of the model project has two extra dependencies: one
> for the hibernate.teneo plugin and one for a plugin containing all
> hibernate.jar files. This last plugin is not in cvs because of licensing
> reasons. Both dependencies have re-export on true.
>
> Have you set the buddypolicy of the Hibernate plugin to dependent?
>
> The above changes are described in the tutorial also (so afaics I did
> not do anything other then what was described in the tutorial).
>
> Let me know if you see any differences with your setup.
>
> I will add the cvs link to the tutorial.
>
> gr. Martin
>
> Calin Medianu wrote:
>> Hi Martin,
>>
>> Thank you for responding. I don't do anything special, I start a new
>> Eclipse Application from the Run menu, including the workspace
>> plugins, then in the new Eclipse I do File -> New -> Library Model. A
>> new library is created at this point. When I click on it, to add
>> children, I get the error. Is there a version of the finished tutorial
>> available somewhere so I can maybe compare mine with that one, see
>> what's different?
>>
>> Thank you,
>>
>> Calin
>>
>>
>>> Hi Calin,
>>> I have replayed the tutorial and I don't get this exception. Can you
>>> describe which steps you take to open the editor and which editing
>>> actions you do? Then I can try to replicate your steps.
>>>
>>> gr. Martin
>>>
>>> Calin Medianu wrote:
>>>> Hi,
>>>>
>>>> I am trying to go through the library tutorial, but I keep getting
>>>> the following error. Any ideas?
>>>>
>>>> Thank you,
>>>>
>>>> Calin
>>>>
>>>>
>>>> SEVERE: illegal access to loading collection
>>>> org.hibernate.LazyInitializationException: illegal access to loading
>>>> collection
>>>> at
>>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>>
>>>> at
>>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>>
>>>> at
>>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>>
>>>> at
>>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>>> at
>>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>>
>>>> at
>>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>>
>>>> at
>>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>>
>>>> at
>>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>>> at
>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>>
>>>> at
>>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>>
>>>> at
>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>>
>>>> at
>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>>
>>>> at
>>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>>
>>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>>> at
>>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>>
>>>> at
>>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>>
>>>> at
>>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>>
>>>> at
>>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>>> at
>>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>>>
>>>> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>> at
>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>> at
>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>> 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)
>>>
>>>
>
>
Re: [Teneo] org.hibernate.LazyInitializationException: illegal access to loading collection [message #616050 is a reply to message #116506] Tue, 01 April 2008 19:07 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Calin,
This is actually more an issue with that EMF assumes these mandatory features to be unset because it
compares the value with the default value. See the italic text here:
http://www.elver.org/hibernate/tutorialtwo/tutorial2_2.html

I remember thet this topic was discussed earlier on the newsgroup.

For starting the editor directly without going through the wizard, see here:
http://www.elver.org/hibernate/resource_utility.html

When you use this utility, see also the remark in italic:
http://www.elver.org/hibernate/tutorialtwo/tutorial2_1.html

gr. Martin

Calin Medianu wrote:
> Hello Martin,
>
> This works much better :) I'll go through the tutorial again to see
> where mine was different.
>
> Small problem though. If I create a new book and just accept the default
> category (Mistery) and pages (0), the category and pages are not set on
> the new object, the save fails and the editor crashes.
>
> Is there a quick way to restart the editor without going through the
> File -> New wizard, that creates a new library? The problem is that the
> state of the editor is never saved on the disk, the way it was in the
> ..library file..
>
> Thanks a lot!
>
> Calin
>
> Hibernate: update "library" set e_version=?, "name"=? where e_id=? and
> e_version=?
> Hibernate: select books0_."writer_e_id" as writer1_2_,
> books0_."book_e_id" as book2_2_, books0_."writer_books_idx" as
> writer3_2_, book1_.e_id as e1_0_0_, book1_.e_version as e3_0_0_,
> book1_."title" as title4_0_0_, book1_."pages" as pages5_0_0_,
> book1_."category" as category6_0_0_, book1_."book_author_e_id" as
> book7_0_0_, book1_.econtainer_class as econtainer10_0_0_,
> book1_.e_container as e11_0_0_, book1_.e_container_featureid as
> e12_0_0_, writer2_.e_id as e1_2_1_, writer2_.e_version as e3_2_1_,
> writer2_."name" as name4_2_1_, writer2_.econtainer_class as
> econtainer7_2_1_, writer2_.e_container as e8_2_1_,
> writer2_.e_container_featureid as e9_2_1_ from "writer_books" books0_
> left outer join "book" book1_ on books0_."book_e_id"=book1_.e_id left
> outer join "writer" writer2_ on book1_."book_author_e_id"=writer2_.e_id
> where books0_."writer_e_id"=?
> 1-Apr-2008 11:22:15 AM org.eclipse.emf.teneo.TeneoException <init>
> SEVERE: Diagnosis of
> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>
> The required feature 'pages' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> The required feature 'category' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> org.eclipse.emf.teneo.StoreValidationException: Diagnosis of
> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>
> The required feature 'pages' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> The required feature 'category' of
> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
> must be set
> at
> org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:409)
>
> at
> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:347)
> at
> org.eclipse.example.library.presentation.LibraryEditor$18.ex ecute(LibraryEditor.java:1461)
>
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
>
> at
> org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
> at
> org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
>
> at
> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
>
>> Hi Calin,
>> I have put the Library example (for emf 2.3) in the following cvs
>> location:
>> host: dev.eclipse.org
>> cvs root: /cvsroot/modeling
>> module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)
>>
>> You can find the source code changes if you look for the string
>> teneo.start or teneo.end.
>> There are two additional changes:
>> - in the plugin.xml of the model project I have changed the extension
>> point to use the HibernateResourceFactory
>> - the manifest.mf of the model project has two extra dependencies: one
>> for the hibernate.teneo plugin and one for a plugin containing all
>> hibernate.jar files. This last plugin is not in cvs because of
>> licensing reasons. Both dependencies have re-export on true.
>>
>> Have you set the buddypolicy of the Hibernate plugin to dependent?
>>
>> The above changes are described in the tutorial also (so afaics I did
>> not do anything other then what was described in the tutorial).
>>
>> Let me know if you see any differences with your setup.
>>
>> I will add the cvs link to the tutorial.
>>
>> gr. Martin
>>
>> Calin Medianu wrote:
>>> Hi Martin,
>>>
>>> Thank you for responding. I don't do anything special, I start a new
>>> Eclipse Application from the Run menu, including the workspace
>>> plugins, then in the new Eclipse I do File -> New -> Library Model. A
>>> new library is created at this point. When I click on it, to add
>>> children, I get the error. Is there a version of the finished
>>> tutorial available somewhere so I can maybe compare mine with that
>>> one, see what's different?
>>>
>>> Thank you,
>>>
>>> Calin
>>>
>>>
>>>> Hi Calin,
>>>> I have replayed the tutorial and I don't get this exception. Can you
>>>> describe which steps you take to open the editor and which editing
>>>> actions you do? Then I can try to replicate your steps.
>>>>
>>>> gr. Martin
>>>>
>>>> Calin Medianu wrote:
>>>>> Hi,
>>>>>
>>>>> I am trying to go through the library tutorial, but I keep getting
>>>>> the following error. Any ideas?
>>>>>
>>>>> Thank you,
>>>>>
>>>>> Calin
>>>>>
>>>>>
>>>>> SEVERE: illegal access to loading collection
>>>>> org.hibernate.LazyInitializationException: illegal access to
>>>>> loading collection
>>>>> at
>>>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>>>
>>>>> at
>>>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>>>
>>>>> at
>>>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>>>
>>>>> at
>>>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>>>> at
>>>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>>>> at
>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>>>
>>>>> at
>>>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>>>
>>>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>>>> at
>>>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>>>> at
>>>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>>>
>>>>> at
>>>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>>>> at
>>>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>>>>
>>>>> at
>>>>> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>>> at
>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>>> 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)
>>>>
>>>>
>>
>>


--

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] org.hibernate.LazyInitializationException: illegal access to loading collection [message #616051 is a reply to message #116514] Tue, 01 April 2008 19:44 Go to previous message
Calin Medianu is currently offline Calin MedianuFriend
Messages: 12
Registered: July 2009
Junior Member
Thank you very much!

Calin


> Hi Calin,
> This is actually more an issue with that EMF assumes these mandatory
> features to be unset because it compares the value with the default
> value. See the italic text here:
> http://www.elver.org/hibernate/tutorialtwo/tutorial2_2.html

>
> I remember thet this topic was discussed earlier on the newsgroup.
>
> For starting the editor directly without going through the wizard, see
> here:
> http://www.elver.org/hibernate/resource_utility.html
>
> When you use this utility, see also the remark in italic:
> http://www.elver.org/hibernate/tutorialtwo/tutorial2_1.html
>
> gr. Martin
>
> Calin Medianu wrote:
>> Hello Martin,
>>
>> This works much better :) I'll go through the tutorial again to see
>> where mine was different.
>>
>> Small problem though. If I create a new book and just accept the
>> default category (Mistery) and pages (0), the category and pages are
>> not set on the new object, the save fails and the editor crashes.
>>
>> Is there a quick way to restart the editor without going through the
>> File -> New wizard, that creates a new library? The problem is that
>> the state of the editor is never saved on the disk, the way it was in
>> the ..library file..
>>
>> Thanks a lot!
>>
>> Calin
>>
>> Hibernate: update "library" set e_version=?, "name"=? where e_id=? and
>> e_version=?
>> Hibernate: select books0_."writer_e_id" as writer1_2_,
>> books0_."book_e_id" as book2_2_, books0_."writer_books_idx" as
>> writer3_2_, book1_.e_id as e1_0_0_, book1_.e_version as e3_0_0_,
>> book1_."title" as title4_0_0_, book1_."pages" as pages5_0_0_,
>> book1_."category" as category6_0_0_, book1_."book_author_e_id" as
>> book7_0_0_, book1_.econtainer_class as econtainer10_0_0_,
>> book1_.e_container as e11_0_0_, book1_.e_container_featureid as
>> e12_0_0_, writer2_.e_id as e1_2_1_, writer2_.e_version as e3_2_1_,
>> writer2_."name" as name4_2_1_, writer2_.econtainer_class as
>> econtainer7_2_1_, writer2_.e_container as e8_2_1_,
>> writer2_.e_container_featureid as e9_2_1_ from "writer_books" books0_
>> left outer join "book" book1_ on books0_."book_e_id"=book1_.e_id left
>> outer join "writer" writer2_ on
>> book1_."book_author_e_id"=writer2_.e_id where books0_."writer_e_id"=?
>> 1-Apr-2008 11:22:15 AM org.eclipse.emf.teneo.TeneoException <init>
>> SEVERE: Diagnosis of
>> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>>
>> The required feature 'pages' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
>> must be set
>> The required feature 'category' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
>> must be set
>> org.eclipse.emf.teneo.StoreValidationException: Diagnosis of
>> org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}
>>
>> The required feature 'pages' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'
>> must be set
>> The required feature 'category' of
>> 'org.eclipse.example.library.impl.BookImpl@1d88c1f{platform:/resource/test/My.library#/0/@books.1}'

>> must be set
>> at
>> org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:409)
>>
>> at
>> org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:347)
>> at
>> org.eclipse.example.library.presentation.LibraryEditor$18.ex ecute(LibraryEditor.java:1461)
>>
>> at
>> org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(Worksp aceModifyOperation.java:101)
>>
>> at
>> org.eclipse.core.internal.resources.Workspace.run(Workspace. java:1797)
>> at
>> org.eclipse.ui.actions.WorkspaceModifyOperation.run(Workspac eModifyOperation.java:113)
>>
>> at
>> org.eclipse.jface.operation.ModalContext$ModalContextThread. run(ModalContext.java:113)
>>
>>> Hi Calin,
>>> I have put the Library example (for emf 2.3) in the following cvs
>>> location:
>>> host: dev.eclipse.org
>>> cvs root: /cvsroot/modeling
>>> module: org.eclipse.emf/org.eclipse.emf.teneo/examples/library (emf 2.3)
>>>
>>> You can find the source code changes if you look for the string
>>> teneo.start or teneo.end.
>>> There are two additional changes:
>>> - in the plugin.xml of the model project I have changed the extension
>>> point to use the HibernateResourceFactory
>>> - the manifest.mf of the model project has two extra dependencies:
>>> one for the hibernate.teneo plugin and one for a plugin containing
>>> all hibernate.jar files. This last plugin is not in cvs because of
>>> licensing reasons. Both dependencies have re-export on true.
>>>
>>> Have you set the buddypolicy of the Hibernate plugin to dependent?
>>>
>>> The above changes are described in the tutorial also (so afaics I did
>>> not do anything other then what was described in the tutorial).
>>>
>>> Let me know if you see any differences with your setup.
>>>
>>> I will add the cvs link to the tutorial.
>>>
>>> gr. Martin
>>>
>>> Calin Medianu wrote:
>>>> Hi Martin,
>>>>
>>>> Thank you for responding. I don't do anything special, I start a new
>>>> Eclipse Application from the Run menu, including the workspace
>>>> plugins, then in the new Eclipse I do File -> New -> Library Model.
>>>> A new library is created at this point. When I click on it, to add
>>>> children, I get the error. Is there a version of the finished
>>>> tutorial available somewhere so I can maybe compare mine with that
>>>> one, see what's different?
>>>>
>>>> Thank you,
>>>>
>>>> Calin
>>>>
>>>>
>>>>> Hi Calin,
>>>>> I have replayed the tutorial and I don't get this exception. Can
>>>>> you describe which steps you take to open the editor and which
>>>>> editing actions you do? Then I can try to replicate your steps.
>>>>>
>>>>> gr. Martin
>>>>>
>>>>> Calin Medianu wrote:
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to go through the library tutorial, but I keep getting
>>>>>> the following error. Any ideas?
>>>>>>
>>>>>> Thank you,
>>>>>>
>>>>>> Calin
>>>>>>
>>>>>>
>>>>>> SEVERE: illegal access to loading collection
>>>>>> org.hibernate.LazyInitializationException: illegal access to
>>>>>> loading collection
>>>>>> at
>>>>>> org.hibernate.collection.AbstractPersistentCollection.initia lize(AbstractPersistentCollection.java:341)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.collection.AbstractPersistentCollection.read(A bstractPersistentCollection.java:86)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.collection.AbstractPersistentCollection.readSi ze(AbstractPersistentCollection.java:109)
>>>>>>
>>>>>> at
>>>>>> org.hibernate.collection.PersistentList.size(PersistentList. java:91)
>>>>>> at
>>>>>> org.eclipse.emf.common.util.DelegatingEList.delegateSize(Del egatingEList.java:231)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegat eSize(PersistableEList.java:442)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.util.DelegatingEList.size(DelegatingE List.java:222)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.ecore.util.DelegatingEcoreEList.contains(Del egatingEcoreEList.java:447)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.command.AddCommand.prepare(AddCommand.j ava:335)
>>>>>> at
>>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.doC anExecute(AbstractOverrideableCommand.java:118)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.command.AbstractOverrideableCommand.can Execute(AbstractOverrideableCommand.java:111)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.command.CommandWrapper.prepare(Comman dWrapper.java:169)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.common.command.AbstractCommand.canExecute(Ab stractCommand.java:114)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.ui.action.StaticSelectionCommandAction. configureAction(StaticSelectionCommandAction.java:147)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:53)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.emf.edit.ui.action.CreateChildAction.<init>(CreateChildAction.java:63)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.generateCreateChildActions(LibraryActionBarContribu tor.java:304)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryActionBarCon tributor.selectionChanged(LibraryActionBarContributor.java:2 80)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryEditor.setSe lection(LibraryEditor.java:1682)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.example.library.presentation.LibraryEditor$6.sel ectionChanged(LibraryEditor.java:877)
>>>>>>
>>>>>> at org.eclipse.jface.viewers.Viewer$2.run(Viewer.java:162)
>>>>>> at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
>>>>>> at org.eclipse.core.runtime.Platform.run(Platform.java:857)
>>>>>> at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:46)
>>>>>> at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:19 9)
>>>>>> at
>>>>>> org.eclipse.jface.viewers.Viewer.fireSelectionChanged(Viewer .java:160)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.viewers.StructuredViewer.updateSelection(S tructuredViewer.java:2047)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.viewers.StructuredViewer.handleSelect(Stru cturedViewer.java:1138)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected( StructuredViewer.java:1168)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenS trategy.java:227)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.ja va:221)
>>>>>> at
>>>>>> org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrate gy.java:388)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
>>>>>> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
>>>>>> at
>>>>>> org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
>>>>>> 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)
>>>>>
>>>>>
>>>
>>>
>
>
Previous Topic:Deleting objects
Next Topic:class hierarchies
Goto Forum:
  


Current Time: Sat Jul 31 00:33:37 GMT 2021

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

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

Back to the top