Topic
No replies
SystemAdmin
SystemAdmin
757 Posts
ACCEPTED ANSWER

Pinned topic Inner class (strange) behavior

‏2008-06-30T03:11:44Z |
Hi everybody,
I have an issue with this code:

public static void main(String[] args) {
MatchedRecord nextRecord = null;
MatchedRecord headerRecord = null;
Vector detailRecordList = new Vector();
MatchedRecord trailerRecord = null;
MatchedRecord generic01Record = null;
String inputFileName = null;

class PCFIfile extends InputFile {
public PCFIfile(String aFileName, final String MAPPING_FILE_NAME) {
super(aFileName);
ConfigurationReader parser = new ConfigurationReader();
try {
fileParser = parser.loadConfigurationFile(MAPPING_FILE_NAME);
} catch (FlatwormConfigurationValueException flatwormConfigurationValueError) {
// logger.info(flatwormConfigurationValueError.getMessage());
flatwormConfigurationValueError.printStackTrace();
} catch (FlatwormUnsetFieldValueException flatwormUnsetFieldValueError) {
// logger.info(flatwormUnsetFieldValueError.getMessage());
flatwormUnsetFieldValueError.printStackTrace();
}

}
}

// Log4j configuration file
PropertyConfigurator.configure("Configuration//log4j.properties");

// Load the application configuration details
appConfig = ConfigurationDriver.loadApplicationProperties();

System.out.println("\n\nStart reading PCF");
// Open PCF for input
inputFileName = args[0];
PCFIfile policyCreationFile = new PCFIfile(inputFileName,MAPPING_FILE_NAME);
policyCreationFile.openFile();
This thing runs fine when executed inside my RAD workspace. However, I created an exact replica outside the workspace so I can run it from the windows command line. When I try to do that, I get an exception associated with the code within the try statement ( fileParser = parser.loadConfigurationFile(MAPPING_FILE_NAME); ) inside the inner class (PCFIfile). The important point is that I never see the message "Start reading PCF" from main() on the output.
It looks to me like I'm getting the exception before I actually create an instance of the inner class.
Does it make sense?
Any help greatly appreciated.

Thanks in advance.