Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      MongoDB 1.8.2 mac 64 bit
      Java driver 2.5.3
    • # Replies:
      2
    • Last comment by Customer:
      true

      Description

      java.lang.NullPointerException
      at com.mongodb.gridfs.GridFSFile.validate(GridFSFile.java:63)
      at org.activiti.douglass.api.Cases.uploadCaseAttachment(Cases.java:84)

      Seems to be similar to a bug that was fixed before: JAVA-160

      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);
      82 gridFsFile.setContentType(mimeType);
      83 gridFsFile.save();
      84 gridFsFile.validate();

      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 }

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                6 years, 7 weeks, 6 days ago
                Date of 1st Reply: