jaxb
  1. jaxb
  2. JAXB-951

JAXB error when unmarshalling, Exception in thread "main" javax.xml.bind.UnmarshalException:

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.10
    • Fix Version/s: None
    • Component/s: xjc
    • Labels:
      None
    • Environment:

      Linux x64 redhat 5

      Description

      I have a really wierd problem here.
      Setup:

      package jaxb_conainer_class;
      package loader_class;

      Main.java imports both loader_class and jaxb_conainer_class In the loader_class:

      JAXBContext context = JAXBContext.newInstance("jaxb_conainer_class");
      Unmarshaller u = context.createUnmarshaller();
      MClass mClass = (MClass) u.unmarshal(file);

      The problem i see is if I compile the packages above separately, everything works. i.e "javac axb_conainer_class; javac Main.java", everything works. However, If I remove all the .class files and do "javac Main.java" only then I got the error. Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"M.class"). Expected elements are (none)

        Activity

        Hide
        laune added a comment -

        Please don't use the JIRA bug tracking system to ask for help. Restate your problem on the JAXB user mailing list, making sure to use correct terms and statements. (The description of your problem contains several very implausible statements. For instance, compiling just Main.java will not let you run it as it depends on other classes.)

        Show
        laune added a comment - Please don't use the JIRA bug tracking system to ask for help. Restate your problem on the JAXB user mailing list, making sure to use correct terms and statements. (The description of your problem contains several very implausible statements. For instance, compiling just Main.java will not let you run it as it depends on other classes.)
        Hide
        kuoweiwang added a comment -

        got it .thanks

        Show
        kuoweiwang added a comment - got it .thanks

          People

          • Assignee:
            Iaroslav Savytskyi
            Reporter:
            kuoweiwang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: