Search code examples
javaspringmemorysax

Initializing any object results in skipping a part of a code


I have a Spring MVC application and in my HomeController I have code for parsing XML:

 SAXParserFactory factory = SAXParserFactory.newInstance();
      // ...
      // load data
      // ....
      // till here everything usually works fine

                SAXParser saxParser = factory.newSAXParser();
                SaxHandler handler = new SaxHandler();
                saxParser.parse(is, handler);
               }
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            return "homeView";
        }

The problem is that when I try to create new instance of any object within SaxHandler that extends DefaultHandler, my app then randomly skips parts of the program and displays the View. When I try to create instance of some other Object, it usually "crashes" in another place - i.e. in HomeController. No stack trace is printed, breakpoints in catch blocks won't help and I'm really confused with this. The version of SDK is 1.8 and AS is Tomcat 8. Any idea what could cause it and how to fix it?


Solution

  • Problem was caused by IDE - IntelliJ Idea Ultimate 14.0.3. In Eclipse Luna it worked without problem. I realized that this problem started to occur, after I installed some plugins to IDE. Deleting IDE with all plugins and reinstallation helped. Nevertheless I still didn't install plugins to it, so I can't say for 100% sure, if this is, what caused the problem. But I sometimes noticed a message in terminal that Mongo plugin could cause memory leaks, so this is my hot candidate.