Java – NullPointerException for Enum.values() in WAR archive

I’ve got an Enum class that stores the name and some relevant numbers for 10 different materials.
In my HTML page I want to select one material via a drop down. Therefore I iterate over them via JSTL. I used to have a scriplet for that but I replaced it now. This is my code:


protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        HttpSession session = request.getSession();
        if (session.getAttribute("materialArray") == null) {
            session.setAttribute("materialArray", Material.values());
        request.getRequestDispatcher("/jsp/input.jsp").forward(request, response);


        <fmt:message key="input.label.material" />
    <select name="s_material" id="s_material">
        <c:set var="MaterialEnum" value="${materialArray}" />
        <c:forEach items="${MaterialEnum}" var="material">
            <option value="${material}"><c:out

Problem: When I click ‘Run project on server’ in eclipse and visit the URL in Chrome it works fine.
But when I export the project to a WAR file and deploy it on a server (same tomcat version, different machine) the drop down doesn’t fill and I get a NullPointerException for Material.values(). Also when I look at it in the eclipse intern browser, the material drop down menu isn’t filled. (I used System.out.println() in doGet() to check if it does anything, it just prints the materials when accessing the page via Chrome.)

Why? Is there a way to bypass these enum-methods .values() and .valueOf() (which I use later to process the selected value from the drop down)?

(The scriplet I used before worked in both environments.)