I have spring mvc project in whicn I upload xml file and try to write it to the my xml by DOM, but confront with this exception. When I make attempts to do the same proccesses in usual project - all works fine. Can't understand why it happens.. \[code\] type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)root cause java.lang.NullPointerException org.apache.xml.utils.TreeWalker.dispatachChars(TreeWalker.java:303) org.apache.xml.utils.TreeWalker.startNode(TreeWalker.java:447) org.apache.xml.utils.TreeWalker.traverse(TreeWalker.java:202) org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:343) com.mycompany.xmlloader.xmlHandler.DOMParser.saveToCatalog(DOMParser.java:147) com.mycompany.xmlloader.service.XMLServiceImpl.updateCatalog(XMLServiceImpl.java:48) com.mycompany.xmlloader.controller.XMLController.uploadToCatalog(XMLController.java:47) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:601) org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:641) javax.servlet.http.HttpServlet.service(HttpServlet.java:722) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)\[/code\]And snippet of code: \[code\]TransformerFactory transfac = TransformerFactory.newInstance(); Transformer trans = transfac.newTransformer(); trans.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); trans.setOutputProperty(OutputKeys.INDENT, "yes"); StreamResult result = new StreamResult(catalogFile.toURI().getPath()); Source source = new DOMSource(doc); trans.transform(source, result);\[/code\]