| Implemeting postMerge events [message #907971] |
Tue, 04 September 2012 09:50  |
Amit B Messages: 12 Registered: July 2012 |
Junior Member |
|
|
Hi,
Getting a crash when trying to implement post merge event. My application defines a custom annotation to maintain a cache on the client side. The application is also implementing a post merge event so that some transient data in each entity can be merge post persist or post merge calls. The event listener class is defines using the annotation @EntityListeners(value = {MyEventListener.class}) for each of the entities. When the application calls getAnnotation() method on the same entity to get the custom annotation the client crashes with the stack trace shown below -
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseArray(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(Unknown Source)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(Unknown Source)
at java.lang.Class.initAnnotationsIfNecessary(Unknown Source)
at java.lang.Class.getAnnotation(Unknown Source)
at com.easyautomation.feedoffice.FOEDataCache.initializeInternalListeners(FOEDataCache.java:34)
at com.easyautomation.DataCache.<init>(DataCache.java:20)
at com.easyautomation.feedoffice.FOEDataCache.<init>(FOEDataCache.java:16)
at com.easyautomation.feedoffice.ClientDataCache.<init>(ClientDataCache.java:163)
at com.easyautomation.feedoffice.ClientDataCache.<clinit>(ClientDataCache.java:171)
at com.easyautomation.feedoffice.forms.FOENumericTextFieldFactory.<init>(FOENumericTextFieldFactory.java:14)
at com.easyautomation.feedoffice.forms.FOENumericTextFieldFactory.getInstance(FOENumericTextFieldFactory.java:24)
at com.easyautomation.feedoffice.FOEApplet.displayMenu(FOEApplet.java:282)
at com.easyautomation.feedoffice.FOEApplet.loginWindowClosed(FOEApplet.java:215)
at com.easyautomation.feedoffice.forms.AppLogin.submitButtonClicked(AppLogin.java:49)
at com.easyautomation.feedoffice.forms.AppLogin.performSubmitAction(AppLogin.java:106)
at com.easyautomation.forms.TitledInternalFrame$2.actionPerformed(TitledInternalFrame.java:88)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Note that this crash only happens when I define the @EntityListeners. If I comment this out everything works fine. It looks an issue with reflection. Is their any other jar file besides eclipselink and jpa 2.0 that needs to be included to implement postmerge events ?. Any help is appreciated.
Thanks
|
|
|