jzelenkov
I'm new here

Cannot create 1-N/N-N relationship with external DB

FS Version: 4.2.461.48921

I have an internal DB (derbyDB) & external DB (ibm db2) connected in FS. External DB has a table of items with PK of type VARCHAR(45).

I want to create a N-N relationship between a table in internal DB and a table of items in external DB.

I use "FirstSpirit-Editor[xml]" column in internal DB mapped by FS_LIST component. In datasources, when I try adding elements to the list, I can see them listed correctly but when I highlight the neeeded item and click "OK", I get a "ClassCastException: java.lang.String cannot be cast to java.lang.Number".

No errrors are thrown and elements are added correctly, when I use a table in the external DB, which has a PK of type integer or long. Sadly, in my case, external db PK must remain VARCHAR. I am also not sure, why EntityFormData.updateFsId() method is called, since external DB is not supposed to be updated (it is also connected in read-only mode).

Complete log:

(de.espirit.firstspirit.client.AWTDispatchingEventQueue): Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(564,491),absolute(556,483),button=1,modifiers=Button1,clickCount=1] on FS_MAIN_FRAME

FSVersion=4.2.461.48921#3165;JDK=1.7.0_09 64bit Oracle Corporation;OS=Windows 7 6.1 amd64;Date=30.04.2013 09:58:49

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number

          at de.espirit.firstspirit.access.store.contentstore.gom.list.EntityFormData.updateFsId(EntityFormData.java:53)

          at de.espirit.firstspirit.access.store.contentstore.gom.list.EntityFormData.<init>(EntityFormData.java:47)

          at de.espirit.firstspirit.access.store.contentstore.gom.list.EntityFormData.<init>(EntityFormData.java:39)

          at de.espirit.firstspirit.access.store.contentstore.gom.list.ContentDataFactory.createFormData(ContentDataFactory.java:264)

          at de.espirit.firstspirit.access.store.contentstore.gom.list.ContentDataFactory.create(ContentDataFactory.java:248)

          at de.espirit.firstspirit.access.store.contentstore.gom.list.ContentDataFactory.create(ContentDataFactory.java:197)

          at de.espirit.firstspirit.access.store.contentstore.gom.list.ContentDataFactory$ContentDataConfiguration$ContentActions$Add.actionPerformed(ContentDataFactory.java:1904)

          at de.espirit.firstspirit.access.store.templatestore.gom.fslist.DefaultActionHandler.actionPerformed(DefaultActionHandler.java:39)

          at de.espirit.firstspirit.ui.gadgets.swing.fslist.FsListGadgetUI$Handler.actionPerformed(FsListGadgetUI.java:615)

          at de.espirit.firstspirit.ui.gadgets.swing.fslist.ToolbarAction.notifyActionListener(ToolbarAction.java:68)

          at de.espirit.firstspirit.ui.gadgets.swing.fslist.ToolbarAction.actionPerformed(ToolbarAction.java:41)

          at de.espirit.firstspirit.ui.gadgets.aspects.toolbar.Action$1.actionPerformed(Action.java:38)

          at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)

          at de.espirit.firstspirit.common.gui.FsButton.fireActionPerformed(FsButton.java:86)

          at de.espirit.firstspirit.common.gui.StoreHoverButton.fireActionPerformed(StoreHoverButton.java:97)

          at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)

          at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

          at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)

          at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)

          at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

          at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)

          at java.awt.Component.processMouseEvent(Component.java:6505)

          at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)

          at java.awt.Component.processEvent(Component.java:6270)

          at java.awt.Container.processEvent(Container.java:2229)

          at java.awt.Component.dispatchEventImpl(Component.java:4861)

          at java.awt.Container.dispatchEventImpl(Container.java:2287)

          at java.awt.Component.dispatchEvent(Component.java:4687)

          at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)

          at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)

          at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)

          at java.awt.Container.dispatchEventImpl(Container.java:2273)

          at java.awt.Window.dispatchEventImpl(Window.java:2719)

          at java.awt.Component.dispatchEvent(Component.java:4687)

          at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)

          at java.awt.EventQueue.access$200(EventQueue.java:103)

          at java.awt.EventQueue$3.run(EventQueue.java:682)

          at java.awt.EventQueue$3.run(EventQueue.java:680)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

          at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)

          at java.awt.EventQueue$4.run(EventQueue.java:696)

          at java.awt.EventQueue$4.run(EventQueue.java:694)

          at java.security.AccessController.doPrivileged(Native Method)

          at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

          at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)

          at de.espirit.firstspirit.client.AWTDispatchingEventQueue.defaultDispatchEvent(AWTDispatchingEventQueue.java:130)

          at de.espirit.firstspirit.client.AWTDispatchingEventQueue._dispatchEvent(AWTDispatchingEventQueue.java:115)

          at de.espirit.firstspirit.client.AWTDispatchingEventQueue.dispatchEvent(AWTDispatchingEventQueue.java:108)

          at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:244)

          at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:163)

          at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)

          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:147)

          at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:139)

          at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

0 Kudos
1 Reply
Peter_Jodeleit
Crownpeak employee

Please report this to the e-spirit helpdesk.

Peter
0 Kudos