javaee / jaxb-v2

Other
211 stars 100 forks source link

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

Open glassfishrobot opened 12 years ago

glassfishrobot commented 12 years ago

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)

Environment

Linux x64 redhat 5

Affected Versions

[2.1.10]

glassfishrobot commented 12 years ago

Reported by kuoweiwang

glassfishrobot commented 12 years ago

laune said: 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.)

glassfishrobot commented 12 years ago

kuoweiwang said: got it .thanks

glassfishrobot commented 12 years ago

Was assigned to yaroska

glassfishrobot commented 8 years ago

This issue was imported from java.net JIRA JAXB-951