Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Greetings:
I am trying to read file name as an input from context param and pass it to s3Get to read it from a bucket. I tried using s3List and s3Get to read files and it works fine. But my requirement is to read a file that is given through command line argument. I am getting NullPointer exception when the code is trying to look for the context param in the context. I ran the debugger and found the following code acting weird. I appreciate any help.
if (inContext == null) {
inContext = S3ReadFile.class.getClassLoader()
.getResourceAsStream("config/contexts/" + contextStr + ".properties");
}
if (inContext != null) {
// defaultProps is in order to keep the original context value
if (context != null && context.isEmpty()) {
defaultProps.load(inContext);
context = new ContextProperties(defaultProps);
}
inContext.close();
} else if (!isDefaultContext) {
// print info and job continue to run, for case: context_param is not empty.
System.err.println("Could not find the context " + contextStr);
}
I am using Studio for Data Integration v7.3. Here are my project details.
Yes, that is what I tried. I also tried setting up prompt value to test run from the studio. Same error both times.