[JAVA-363] NPE in GridFSFile.validate Created: 01/Jun/11 Updated: 19/Oct/16 Resolved: 24/Oct/11 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.7 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Tom Baeyens | Assignee: | Scott Hernandez (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB 1.8.2 mac 64 bit |
||
| Description |
|
java.lang.NullPointerException Seems to be similar to a bug that was fixed before: Strange thing is that this bug is reproducable in maven and when running the same test in Eclipse it runs fine. Both test runs use the same mongodb. My code: 81 GridFSInputFile gridFsFile = fileSystem.createFile(uploadStream, caze.getOid()+"/"+fileName); Driver code: 54 public void validate() throws MongoException { 55 if ( _fs == null ) 56 throw new MongoException( "no _fs" ); 57 if ( _md5 == null ) 58 throw new MongoException( "no _md5 stored" ); 59 60 DBObject cmd = new BasicDBObject( "filemd5" , _id ); 61 cmd.put( "root" , _fs._bucketName ); 62 DBObject res = _fs._db.command( cmd ); 63 String m = res.get( "md5" ).toString(); 64 if ( m.equals( _md5 ) ) 65 return; 66 67 throw new MongoException( "md5 differ. mine [" + _md5 + "] theirs [" + m + "]" ); 68 } |
| Comments |
| Comment by auto [ 24/Oct/11 ] |
|
Author: {u'login': u'scotthernandez', u'name': u'Scott Hernandez', u'email': u'scotthernandez@gmail.com'}Message: |
| Comment by Tom Baeyens [ 01/Jun/11 ] |
|
16:05:42,350 INF | activiti.cases.chunks ----------------------- [org.activiti.douglass.api.Activiti] , "files_id" : { "$oid" : "4de647361c8d6ce7c7cb725f"} , "n" : 0 , "data" : <Binary Data>} [org.activiti.douglass.api.Activiti] , "chunkSize" : 262144 , "length" : 250 , "md5" : "3ba45e774d5b7a7d767cd0dc02da97df" , "filename" : "4de647361c8d6ce7c7cb725e/warning.txt" , "contentType" : "text conf def list log in = text/plain" , "uploadDate" : { "$date" : "2011-06-01T14:05:42Z"}, "aliases" : null } [org.activiti.douglass.api.Activiti] |