TritonDataCenter / java-manta

Java Manta Client SDK
Mozilla Public License 2.0
16 stars 26 forks source link

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

Open douglasAtJoyent opened 4 years ago

douglasAtJoyent commented 4 years ago

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)

kennethvt437 commented 4 years ago

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.