Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-784

Workbench: AbstractSolution.score can't be marshaled when using JAXB

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.1.0.Beta1
    • None
    • optaplanner-wb
    • None
    • NEW
    • NEW

      When a class extends AbstractSolution class & JAXB marshaling is used, the following exception is thrown:

      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
      org.optaplanner.core.api.score.Score is an interface, and JAXB can't handle interfaces.
      this problem is related to the following location:
      at org.optaplanner.core.api.score.Score
      at public org.optaplanner.core.api.score.Score org.optaplanner.core.impl.domain.solution.AbstractSolution.getScore()
      at org.optaplanner.core.impl.domain.solution.AbstractSolution
      at org.optaplanner.persistence.jaxb.impl.testdata.domain.JaxbTestdataAbstractSolution

      at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:460)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:292)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:139)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1138)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:162)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:247)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:441)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
      at org.optaplanner.persistence.jaxb.impl.domain.solution.JaxbSolutionFileIO.<init>(JaxbSolutionFileIO.java:48)
      ... 29 more

              mcimbora_jira Matej Čimbora (Inactive)
              mcimbora_jira Matej Čimbora (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: