From: SourceForge.net <no...@so...> - 2012-04-05 01:11:41
|
Bugs item #3515030, was opened at 2012-04-04 18:11 Message generated for change (Tracker Item Submitted) made by wisanupp You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=577089&aid=3515030&group_id=85722 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Normaliser Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Wisanu Promthong (wisanupp) Assigned to: Nobody/Anonymous (nobody) Summary: NPE when normalises the zip file with custom FileNamer Initial Comment: When we specify the ActiveFileNamer, it will cause NPE when trying to normalise the zip file. //-----Code snippet------ xena = new Xena(); //load the plugins xena.loadPlugins(new File(config.getPlugin_path())); //specify the custom FileNamer xena.setActiveFileNamer(new DAFileNamer()); // initialize inputFile and destinationDir here //must use zip file as an input to produce the error NormaliserResults res = xena.normalise(new XenaInputSource(inputFile), new File(destinationDir), true); //------End Code snippet ---- Result: java.lang.NullPointerException at au.gov.naa.digipres.xena.kernel.filenamer.AbstractFileNamer.makeNewOpenFile(AbstractFileNamer.java:110) at au.gov.naa.digipres.xena.plugin.archive.ArchiveNormaliser.parse(ArchiveNormaliser.java:113) at au.gov.naa.digipres.xena.kernel.normalise.NormaliserManager.parse(NormaliserManager.java:877) at au.gov.naa.digipres.xena.kernel.normalise.NormaliserManager.normalise(NormaliserManager.java:1255) at au.gov.naa.digipres.xena.core.Xena.normalise(Xena.java:742) at au.gov.naa.digipres.xena.core.Xena.normalise(Xena.java:610) Per my rough investigation, the root cause is the foreign FileNamer that XENA accept through setActiveFileNamer isn't get the FileNamerManger assigned (in FileNamerManager class) and subsequently case NPE when try to process the zip file. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=577089&aid=3515030&group_id=85722 |