Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NoSuchMethodException when using FetchType.Lazy and weaving
NoSuchMethodException when using FetchType.Lazy and weaving [message #501747] Thu, 03 December 2009 16:32 Go to next message
habakuk  is currently offline habakuk Friend
Messages: 32
Registered: October 2009
Member
Dear all!

Once again I need your help! Rolling Eyes

I'm getting strange NoSuchMethodExceptions for all of my one-to-one and one-to-many relations. The problem goes away when I turn off weaving or when I use FetchType.EAGER. I generated the code with DALI to make sure I did not make any mistake.

Here are the exceptions:

Local Exception Stack: 
Exception [EclipseLink-60] (Eclipse Persistence Services - 2.0.0.v20091121-r5847): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The method [_persistence_setdv_vh] or [_persistence_getdv_vh] is not defined in the object [ppd.model.entities.Vertrag].
Internal Exception: java.lang.NoSuchMethodException: ppd.model.entities.Vertrag._persistence_getdv_vh()
Mapping: org.eclipse.persistence.mappings.OneToOneMapping[dv]
Descriptor: RelationalDescriptor(ppd.model.entities.Vertrag --> [DatabaseTable(VERTRAG)])
	at org.eclipse.persistence.exceptions.DescriptorException.noSuchMethodWhileInitializingAttributesInMethodAccessor(DescriptorException.java:1152)
	at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:154)
	at org.eclipse.persistence.mappings.DatabaseMapping.preInitialize(DatabaseMapping.java:1208)
	at org.eclipse.persistence.mappings.ForeignReferenceMapping.preInitialize(ForeignReferenceMapping.java:804)
	at org.eclipse.persistence.mappings.ObjectReferenceMapping.preInitialize(ObjectReferenceMapping.java:940)
	at org.eclipse.persistence.descriptors.ClassDescriptor.preInitialize(ClassDescriptor.java:3317)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:429)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:406)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:671)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:620)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:366)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195)
	at ppd.datastore.MitarbeiterDAO.getListe(MitarbeiterDAO.java:30)
	at ppd.provider.PersonenProvider.getElements(PersonenProvider.java:15)
	at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:935)
	at org.eclipse.jface.viewers.ColumnViewer.getRawChildren(ColumnViewer.java:692)
	at org.eclipse.jface.viewers.AbstractTableViewer.getRawChildren(AbstractTableViewer.java:1077)
	at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:869)
	at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:992)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:690)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:638)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:624)
	at org.eclipse.jface.viewers.AbstractTableViewer$2.run(AbstractTableViewer.java:579)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1363)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1326)
	at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:577)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:251)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1601)
	at ppd.view.PersonSucheFrmView.createPartControl(PersonSucheFrmView.java:70)
	at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:371)
	at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:230)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:312)
	at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:545)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:185)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:265)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:64)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:478)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1268)
	at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1221)
	at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1620)
	at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:659)
	at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:585)
	at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:569)
	at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:269)
	at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:930)
	at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2494)
	at org.eclipse.ui.internal.WorkbenchWindow$22.run(WorkbenchWindow.java:2933)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
	at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:2914)
	at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:720)
	at org.eclipse.ui.internal.Workbench$18.runWithException(Workbench.java:1065)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:32)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync(UICallBackManager.java:115)
	at org.eclipse.swt.widgets.Display$2.run(Display.java:695)
	at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler.runNonUIThreadWithFakeContext(UICallBackServiceHandler.java:460)
	at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeContext(UICallBack.java:44)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:693)
	at org.eclipse.ui.internal.StartupThreading.runWithWorkbenchExceptions(StartupThreading.java:55)
	at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:1061)
	at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1888)
	at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1824)
	at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:188)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:790)
	at org.eclipse.ui.internal.Workbench$25.runWithException(Workbench.java:1430)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:32)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync(UICallBackManager.java:115)
	at org.eclipse.swt.widgets.Display$2.run(Display.java:695)
	at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler.runNonUIThreadWithFakeContext(UICallBackServiceHandler.java:460)
	at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeContext(UICallBack.java:44)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:693)
	at org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:110)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1425)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2406)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2295)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:514)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:497)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at ppd.PersonEntryPoint.createUI(PersonEntryPoint.java:27)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:231)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:119)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchMethodException: ppd.model.entities.Vertrag._persistence_getdv_vh()
	at java.lang.Class.getDeclaredMethod(Class.java:1937)
	at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.findMethod(PrivilegedAccessHelper.java:61)
	at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getMethod(PrivilegedAccessHelper.java:228)
	at org.eclipse.persistence.internal.helper.Helper.getDeclaredMethod(Helper.java:1039)
	at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.initializeAttributes(MethodAttributeAccessor.java:145)
	... 85 more

Runtime Exceptions: 
---------------------------------------------------------


java.lang.NullPointerException
	at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getMethodReturnType(PrivilegedAccessHelper.java:302)
	at org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor.getGetMethodReturnType(MethodAttributeAccessor.java:105)
	at org.eclipse.persistence.mappings.ForeignReferenceMapping.validateBeforeInitialization(ForeignReferenceMapping.java:1505)
	at org.eclipse.persistence.descriptors.ClassDescriptor.validateBeforeInitialization(ClassDescriptor.java:5260)
	at org.eclipse.persistence.descriptors.ClassDescriptor.preInitialize(ClassDescriptor.java:3323)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:429)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.initializeDescriptors(DatabaseSessionImpl.java:406)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.postConnectDatasource(DatabaseSessionImpl.java:671)
	at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:620)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
	at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:366)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:151)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:207)
	at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:195)
	at ppd.datastore.MitarbeiterDAO.getListe(MitarbeiterDAO.java:30)
	at ppd.provider.PersonenProvider.getElements(PersonenProvider.java:15)
	at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:935)
	at org.eclipse.jface.viewers.ColumnViewer.getRawChildren(ColumnViewer.java:692)
	at org.eclipse.jface.viewers.AbstractTableViewer.getRawChildren(AbstractTableViewer.java:1077)
	at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:869)
	at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:992)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefreshAll(AbstractTableViewer.java:690)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:638)
	at org.eclipse.jface.viewers.AbstractTableViewer.internalRefresh(AbstractTableViewer.java:624)
	at org.eclipse.jface.viewers.AbstractTableViewer$2.run(AbstractTableViewer.java:579)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1363)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1326)
	at org.eclipse.jface.viewers.AbstractTableViewer.inputChanged(AbstractTableViewer.java:577)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:251)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1601)
	at ppd.view.PersonSucheFrmView.createPartControl(PersonSucheFrmView.java:70)
	at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:371)
	at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:230)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:594)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:312)
	at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:545)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:185)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:265)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:64)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:478)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1268)
	at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1221)
	at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1620)
	at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:659)
	at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:585)
	at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:569)
	at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:269)
	at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:930)
	at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2494)
	at org.eclipse.ui.internal.WorkbenchWindow$22.run(WorkbenchWindow.java:2933)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:66)
	at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:2914)
	at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:720)
	at org.eclipse.ui.internal.Workbench$18.runWithException(Workbench.java:1065)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:32)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync(UICallBackManager.java:115)
	at org.eclipse.swt.widgets.Display$2.run(Display.java:695)
	at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler.runNonUIThreadWithFakeContext(UICallBackServiceHandler.java:460)
	at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeContext(UICallBack.java:44)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:693)
	at org.eclipse.ui.internal.StartupThreading.runWithWorkbenchExceptions(StartupThreading.java:55)
	at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:1061)
	at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1888)
	at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1824)
	at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:188)
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:790)
	at org.eclipse.ui.internal.Workbench$25.runWithException(Workbench.java:1430)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:32)
	at org.eclipse.rwt.internal.lifecycle.UICallBackManager.addSync(UICallBackManager.java:115)
	at org.eclipse.swt.widgets.Display$2.run(Display.java:695)
	at org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler.runNonUIThreadWithFakeContext(UICallBackServiceHandler.java:460)
	at org.eclipse.rwt.lifecycle.UICallBack.runNonUIThreadWithFakeContext(UICallBack.java:44)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:693)
	at org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:110)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1425)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2406)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2295)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:514)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:497)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at ppd.PersonEntryPoint.createUI(PersonEntryPoint.java:27)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:92)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:231)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:119)
	at java.lang.Thread.run(Thread.java:619)



I use M16. I tried the current RC1, but had some error so I switched back. I'd like to know if this is a bug or a misconfiguration. I use Eclipselink in a RAP-Project.

Thanks!
icon12.gif  Re: NoSuchMethodException when using FetchType.Lazy and weaving [message #501940 is a reply to message #501747] Fri, 04 December 2009 14:33 Go to previous messageGo to next message
habakuk  is currently offline habakuk Friend
Messages: 32
Registered: October 2009
Member
Found the problem myself. If found out that the problem only occured when it was launched from within Eclipse. Running it standalone worked. To make it short:
In the launch configuration there was missing a VM parameter:
-Dosgi.framework.extensions=org.eclipse.persistence.jpa.equi nox.weaving

Without that parameter weaving will not work. This is a litte weaving pitfall Smile

Greetings to everybody who had the same problem



Re: NoSuchMethodException when using FetchType.Lazy and weaving [message #504561 is a reply to message #501940] Mon, 21 December 2009 14:32 Go to previous messageGo to next message
jz  is currently offline jz Friend
Messages: 2
Registered: December 2009
Junior Member
Dear i am getting the same error, and i added the VM argument but not effect. So can you tell how to disable runtime weaving and make it happen all on build time?

Thanks
Re: NoSuchMethodException when using FetchType.Lazy and weaving [message #505306 is a reply to message #504561] Tue, 29 December 2009 08:16 Go to previous message
habakuk  is currently offline habakuk Friend
Messages: 32
Registered: October 2009
Member
There is more than one way to do it. I put this in persistence.xml:

<property name="eclipselink.weaving" value="false"/>


You can also set this property in java of course.

HTH

[Updated on: Tue, 29 December 2009 13:16]

Report message to a moderator

Previous Topic:OSGI & JPA
Next Topic:JPA 2.0 BUG
Goto Forum:
  


Current Time: Sat Nov 29 09:08:10 GMT 2014

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

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