• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trouble marshalling

 
N Fowl
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I previously got this to work with two classes: Window and Data. I had the same XML annotation tags in the Data class as I do now in the Window class. My question is, why is it not working, and what do I need to change? I looked around on the web, and didn't find much help for annotating fields in a class when that class is the same class you are marshalling from. So another question is, should I simply go back to using the Data class to store the data field?

I have just one class in my project, Window.

In the main() in Window, I initialize all the components, including a list.

I add and remove from 'data' and it seems to work fine. The problem is marshalling to XML. I get the following errors, and also below is the rest of the relevant code.




Here is the error:

com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 9 counts of IllegalAnnotationExceptions
java.awt.LayoutManager is an interface, and JAXB can't handle interfaces.

this problem is related to the following location:
at java.awt.LayoutManager
at public java.awt.LayoutManager java.awt.Container.getLayout()
at java.awt.Container
at public java.awt.Container javax.swing.JFrame.getContentPane()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
java.awt.datatransfer.FlavorMap is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.awt.datatransfer.FlavorMap
at public java.awt.datatransfer.FlavorMap java.awt.dnd.DropTarget.getFlavorMap()
at java.awt.dnd.DropTarget
at public synchronized java.awt.dnd.DropTarget java.awt.Component.getDropTarget()
at java.awt.Component
at java.awt.Container
at public java.awt.Container javax.swing.JFrame.getContentPane()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
javax.swing.Action is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.swing.Action
at public javax.swing.Action javax.swing.AbstractButton.getAction()
at javax.swing.AbstractButton
at javax.swing.JMenuItem
at javax.swing.JMenu
at public javax.swing.JMenu javax.swing.JMenuBar.getHelpMenu()
at javax.swing.JMenuBar
at public javax.swing.JMenuBar javax.swing.JFrame.getJMenuBar()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
javax.swing.Icon is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.swing.Icon
at public javax.swing.Icon javax.swing.AbstractButton.getDisabledIcon()
at javax.swing.AbstractButton
at javax.swing.JMenuItem
at javax.swing.JMenu
at public javax.swing.JMenu javax.swing.JMenuBar.getHelpMenu()
at javax.swing.JMenuBar
at public javax.swing.JMenuBar javax.swing.JFrame.getJMenuBar()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
javax.swing.ButtonModel is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.swing.ButtonModel
at public javax.swing.ButtonModel javax.swing.AbstractButton.getModel()
at javax.swing.AbstractButton
at javax.swing.JMenuItem
at javax.swing.JMenu
at public javax.swing.JMenu javax.swing.JMenuBar.getHelpMenu()
at javax.swing.JMenuBar
at public javax.swing.JMenuBar javax.swing.JFrame.getJMenuBar()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
javax.swing.border.Border is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.swing.border.Border
at public javax.swing.border.Border javax.swing.JComponent.getBorder()
at javax.swing.JComponent
at javax.swing.AbstractButton
at javax.swing.JMenuItem
at javax.swing.JMenu
at public javax.swing.JMenu javax.swing.JMenuBar.getHelpMenu()
at javax.swing.JMenuBar
at public javax.swing.JMenuBar javax.swing.JFrame.getJMenuBar()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
javax.swing.SingleSelectionModel is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at javax.swing.SingleSelectionModel
at public javax.swing.SingleSelectionModel javax.swing.JPopupMenu.getSelectionModel()
at javax.swing.JPopupMenu
at public javax.swing.JPopupMenu javax.swing.JComponent.getComponentPopupMenu()
at javax.swing.JComponent
at javax.swing.AbstractButton
at javax.swing.JMenuItem
at javax.swing.JMenu
at public javax.swing.JMenu javax.swing.JMenuBar.getHelpMenu()
at javax.swing.JMenuBar
at public javax.swing.JMenuBar javax.swing.JFrame.getJMenuBar()
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
java.awt.Shape is an interface, and JAXB can't handle interfaces.
this problem is related to the following location:
at java.awt.Shape
at public java.awt.Shape java.awt.Window.getShape()
at java.awt.Window
at java.awt.Frame
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
Two classes have the same XML type name "window". Use @XmlType.name and @XmlType.namespace to assign different names to them.
this problem is related to the following location:
at java.awt.Window
at java.awt.Frame
at javax.swing.JFrame
at private javax.swing.JFrame com.cooksys.assessment.Window.frame
at com.cooksys.assessment.Window
this problem is related to the following location:
at com.cooksys.assessment.Window

at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
at javax.xml.bind.ContextFinder.find(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
at com.cooksys.assessment.Window.save(Window.java:226)
at com.cooksys.assessment.Window$3.actionPerformed(Window.java:148)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(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.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(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)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!