{"record":{"id":"1eb83ccdea7d938b","repo":"pentaho/pentaho-kettle","slug":"jobentrycheckfileslocked-unabletoloadfromxml","errorCode":null,"errorMessage":"JobEntryCheckFilesLocked.UnableToLoadFromXml","messagePattern":"JobEntryCheckFilesLocked\\.UnableToLoadFromXml","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/job/entries/checkfilelocked/JobEntryCheckFilesLocked.java","lineNumber":149,"sourceCode":"      super.loadXML( entrynode, databases, slaveServers );\n      argFromPrevious = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, ARG_FROM_PREVIOUS_ATTR ) );\n      includeSubfolders = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( entrynode, INCLUDE_SUBFOLDERS_ATTR ) );\n\n      Node fields = XMLHandler.getSubNode( entrynode, \"fields\" );\n\n      // How many field arguments?\n      int nrFields = XMLHandler.countNodes( fields, \"field\" );\n      allocate( nrFields );\n\n      // Read them all...\n      for ( int i = 0; i < nrFields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n\n        arguments[i] = XMLHandler.getTagValue( fnode, NAME_ATTR );\n        filemasks[i] = XMLHandler.getTagValue( fnode, FILE_MASK_ATTR );\n      }\n    } catch ( KettleXMLException xe ) {\n      throw new KettleXMLException(\n        BaseMessages.getString( PKG, \"JobEntryCheckFilesLocked.UnableToLoadFromXml\" ), xe );\n    }\n  }\n\n  public void loadRep( Repository rep, IMetaStore metaStore, ObjectId idJobEntry, List<DatabaseMeta> databases,\n    List<SlaveServer> slaveServers ) throws KettleException {\n    try {\n      argFromPrevious = rep.getJobEntryAttributeBoolean( idJobEntry, ARG_FROM_PREVIOUS_ATTR );\n      includeSubfolders = rep.getJobEntryAttributeBoolean( idJobEntry, INCLUDE_SUBFOLDERS_ATTR );\n\n      // How many arguments?\n      int argnr = rep.countNrJobEntryAttributes( idJobEntry, NAME_ATTR );\n      arguments = new String[argnr];\n      filemasks = new String[argnr];\n\n      // Read them all...\n      for ( int a = 0; a < argnr; a++ ) {\n        arguments[a] = rep.getJobEntryAttributeString( idJobEntry, a, NAME_ATTR );","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/job/entries/checkfilelocked/JobEntryCheckFilesLocked.java#L131-L167","documentation":"JobEntryCheckFilesLocked.loadXML wraps any KettleXMLException raised while parsing its saved XML fields (the list of file/folder entries with name and filemask attributes) into this error. It signals the entry's XML fragment could not be decoded into the arguments/filemasks arrays.","triggerScenarios":"Calling loadXML on this job entry when XMLHandler.getNodeValue/getSubNodeByNr for 'fields'/'field' nodes, or getTagValue, throws — e.g. missing <fields> container, wrong node count, or malformed entry XML.","commonSituations":"A .kjb exported from a different PDI version where the entry's XML layout changed; hand-edited job file removed the <fields> node; XML fragment pasted from another entry type.","solutions":["Open the .kjb and check the entry XML contains <fields> with <field><name>…</name><filemask>…</filemask></field> children","Recreate the 'Check if files are locked' entry in Spoon and re-save the job","If migrating versions, re-export the job from the original PDI version","Read the chained KettleXMLException for the exact XMLHandler failure point"],"exampleFix":"// before\n<fields><field><name>only name, no mask tag closed</name></field>\n// after\n<fields><field><name>/data/file.txt</name><filemask>.*</filemask></field></fields>","handlingStrategy":"try-catch","validationCode":"// XML fragment sanity check before loadXML\norg.w3c.dom.Node fields = XMLHandler.getSubNode(entryNode, \"fields\");\nif (fields == null) throw new IllegalArgumentException(\"CheckFilesLocked entry XML missing <fields>\");","typeGuard":null,"tryCatchPattern":"try {\n  entry.loadXML(entryNode, databases, slaveServers, metaStore);\n} catch (KettleXMLException e) {\n  log.error(\"Cannot parse CheckFilesLocked entry XML: \" + e.getCause(), e);\n}","preventionTips":["Do not hand-edit <fields> blocks in .kjb files","When copying entry XML between jobs, keep the full fragment intact","Test job files in the same PDI version that produced them"],"tags":["xml","job-entry","kettle","deserialization"],"backgroundTag":"json-unmarshal-failed","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"}