final JAXBContext jaxbContext = JAXBContext.newInstance(Constants.class);
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
servletContext.getResourceAsStream("constants.xml");
final InputStream is
= servletContext.
getResourceAsStream("/WEB-INF/classes/constants.xml"); final Constants constants = (Constants) unmarshaller.unmarshal(is);
ZmluYWwgSkFYQkNvbnRleHQgamF4YkNvbnRleHQgPSBKQVhCQ29udGV4dC5uZXdJbnN0YW5jZShDb25zdGFudHMuY2xhc3MpOwpmaW5hbCBVbm1hcnNoYWxsZXIgdW5tYXJzaGFsbGVyID0gamF4YkNvbnRleHQuY3JlYXRlVW5tYXJzaGFsbGVyKCk7CnNlcnZsZXRDb250ZXh0LmdldFJlc291cmNlQXNTdHJlYW0oImNvbnN0YW50cy54bWwiKTsKZmluYWwgSW5wdXRTdHJlYW0gaXMgPSBzZXJ2bGV0Q29udGV4dC5nZXRSZXNvdXJjZUFzU3RyZWFtKCIvV0VCLUlORi9jbGFzc2VzL2NvbnN0YW50cy54bWwiKTsKZmluYWwgQ29uc3RhbnRzIGNvbnN0YW50cyA9IChDb25zdGFudHMpIHVubWFyc2hhbGxlci51bm1hcnNoYWwoaXMpOw==
Main.java:1: class, interface, or enum expected
final JAXBContext jaxbContext = JAXBContext.newInstance(Constants.class);
^
Main.java:1: <identifier> expected
final JAXBContext jaxbContext = JAXBContext.newInstance(Constants.class);
^
Main.java:3: <identifier> expected
servletContext.getResourceAsStream("constants.xml");
^
Main.java:3: illegal start of type
servletContext.getResourceAsStream("constants.xml");
^
Main.java:5: reached end of file while parsing
final Constants constants = (Constants) unmarshaller.unmarshal(is);
^
5 errors