Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15610

NPE in CamelXmlTreeParserHelper.parseCamelRouteTree(CamelXmlTreeParserHelper.java:47) when routes are empty

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.6.0
    • Component/s: tooling
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      java.lang.NullPointerException
      	at org.apache.camel.parser.helper.CamelXmlTreeParserHelper.parseCamelRouteTree(CamelXmlTreeParserHelper.java:47)
      	at org.apache.camel.parser.XmlRouteParser.parseXmlRouteTree(XmlRouteParser.java:99)
      	at com.github.cameltooling.lsp.internal.documentsymbol.DocumentSymbolXMLProcessor.getSymbolInformations(DocumentSymbolXMLProcessor.java:56)
      

      minimal test to reproduce:

      	@Test
      	void minimalTestShowingNPE() throws IOException {
      		String textTotest =
      				"<camelContext id=\"camel\" xmlns=\"http://camel.apache.org/schema/spring\">\r\n" + 
      				"\r\n" + 
      				"    <route id=\"a route\">\r\n" + 
      				"    </route>\r\n" + 
      				"\r\n"
      				+ "</camelContext>\n";
      		File camelFile = File.createTempFile("camelFile", ".xml");
      		Files.write(textTotest.getBytes(), camelFile);
      		XmlRouteParser.parseXmlRouteTree(new ByteArrayInputStream(textTotest.getBytes()), "", camelFile.getAbsolutePath());
      	}
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                apupier Aurélien Pupier
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: