{"record":{"id":"5af5f884357d5e4d","repo":"pentaho/pentaho-kettle","slug":"error-0001-cannot-load-job-entry-from-xml-node-5af5f8","errorCode":"ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node","errorMessage":"JobEntryCheckDbConnections.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node","messagePattern":"JobEntryCheckDbConnections\\.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node","errorType":"error_code","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/core/impl/src/main/java/org/pentaho/di/job/entries/checkdbconnection/JobEntryCheckDbConnections.java","lineNumber":224,"sourceCode":"    try {\n      super.loadXML( entrynode, databases, slaveServers );\n      Node fields = XMLHandler.getSubNode( entrynode, \"connections\" );\n\n      // How many hosts?\n      int nrFields = XMLHandler.countNodes( fields, \"connection\" );\n      connections = new DatabaseMeta[nrFields];\n      waitfors = new String[nrFields];\n      waittimes = new int[nrFields];\n      // Read them all...\n      for ( int i = 0; i < nrFields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"connection\", i );\n        String dbname = XMLHandler.getTagValue( fnode, \"name\" );\n        connections[i] = DatabaseMeta.findDatabase( databases, dbname );\n        waitfors[i] = XMLHandler.getTagValue( fnode, \"waitfor\" );\n        waittimes[i] = getWaitByCode( Const.NVL( XMLHandler.getTagValue( fnode, \"waittime\" ), \"\" ) );\n      }\n    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"JobEntryCheckDbConnections.ERROR_0001_Cannot_Load_Job_Entry_From_Xml_Node\", xe.getMessage() ) );\n    }\n  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId id_jobentry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      // How many connections?\n      int argnr = rep.countNrJobEntryAttributes( id_jobentry, \"id_database\" );\n      connections = new DatabaseMeta[argnr];\n      waitfors = new String[argnr];\n      waittimes = new int[argnr];\n      // Read them all...\n      for ( int a = 0; a < argnr; a++ ) {\n        connections[a] =\n          rep.loadDatabaseMetaFromJobEntryAttribute( id_jobentry, \"connection\", a, \"id_database\", databases );\n        waitfors[a] = rep.getJobEntryAttributeString( id_jobentry, a, \"waitfor\" );\n        waittimes[a] =","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/core/impl/src/main/java/org/pentaho/di/job/entries/checkdbconnection/JobEntryCheckDbConnections.java#L206-L242","documentation":"JobEntryCheckDbConnections.loadXML throws KettleXMLException with ERROR_0001 when the job entry cannot be parsed from its XML node — e.g. reading connection names, waitfor, or waittime values fails. The original XML exception message is appended to the message.","triggerScenarios":"loadXML called on a <entry> node whose <connection>/<name>/<waitfor>/<waittime> subnodes are missing or malformed, or getWaitByCode receiving an unrecognized waittime code.","commonSituations":"Manually edited .kjb files, jobs copied between environments with database names that no longer resolve, or XML produced by incompatible Pentaho versions.","solutions":["Inspect xe.getMessage() in the thrown message to find the exact XML parse failure.","Fix the <field>-style subnodes in the .kjb so each connection entry has name/waitfor/waittime.","Re-create the CheckDbConnections entry in Spoon and set connections/wait settings through the UI.","Verify database names in the entry match connections defined in the transformation's metadata."],"exampleFix":"// before\nwaittimes[i] = getWaitByCode( Const.NVL( XMLHandler.getTagValue( fnode, \"waittime\" ), \"\" ) );\n// after (guard against unknown codes at parse site)\nString wt = Const.NVL( XMLHandler.getTagValue( fnode, \"waittime\" ), \"\" );\nwaittimes[i] = wt.isEmpty() ? defaultWaitTime : getWaitByCode( wt );","handlingStrategy":"try-catch","validationCode":"// validate waittime code is recognized before relying on loadXML\nSet<String> valid = Set.of( \"millisec\", \"sec\", \"min\" );\n// any <waittime> value read from the XML should be in valid","typeGuard":null,"tryCatchPattern":"try { entry.loadXML( entrynode, databases, metaStore ); } catch ( KettleXMLException e ) { logError( \"ERROR_0001: \" + e.getMessage() ); /* e.getMessage() already embeds the XML cause */ }","preventionTips":["Create CheckDbConnections entries via the Spoon UI, not raw XML.","Keep connection names defined in job metadata in sync with the entry.","Diff job XML after merges to catch dropped subnodes."],"tags":["xml","job-entry","deserialization","database-connection"],"backgroundTag":"xml-parse-error","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}