fork download
  1. final JAXBContext jaxbContext = JAXBContext.newInstance(Constants.class);
  2. final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
  3. servletContext.getResourceAsStream("constants.xml");
  4. final InputStream is = servletContext.getResourceAsStream("/WEB-INF/classes/constants.xml");
  5. final Constants constants = (Constants) unmarshaller.unmarshal(is);
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
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
stdout
Standard output is empty