java-manta icon indicating copy to clipboard operation
java-manta copied to clipboard

A null pointer exception is thrown when trying to list bucket objects on the buckets directory.

Open douglasAtJoyent opened this issue 5 years ago • 1 comments

A null pointer exception is thrown when trying to list bucket objects on the buckets directory.

e.g. client.listObjects(client.getContext().getMantaBucketsDirectory());

The exception that I see is : java.lang.NullPointerException: Modification time is null at com.joyent.manta.org.apache.commons.lang3.Validate.notNull(Validate.java:225) at com.joyent.manta.client.MantaObjectConversionFunction.apply(MantaObjectConversionFunction.java:83) at com.joyent.manta.client.MantaObjectConversionFunction.apply(MantaObjectConversionFunction.java:29) at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) at java.util.Iterator.forEachRemaining(Iterator.java:116) at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) at com.joyent.jmetersampler.AtomicBucketListing.runTest(AtomicBucketListing.java:93) at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:197) at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:622) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:546) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:486) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253) at java.lang.Thread.run(Thread.java:745)

douglasAtJoyent avatar Sep 17 '19 17:09 douglasAtJoyent

Before the line that is throwing the exception, I would recommend writing the following: System.out.println(client == null); System.out.println(client.getContext() == null);

If either of the booleans printed is true, look back in your code to see whether you correctly initialized the exception-causing variable.

kennethvt437 avatar Sep 19 '19 03:09 kennethvt437