<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:52:06 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[JAVA-363] NPE in GridFSFile.validate</title>
                <link>https://jira.mongodb.org/browse/JAVA-363</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;java.lang.NullPointerException&lt;br/&gt;
	at com.mongodb.gridfs.GridFSFile.validate(GridFSFile.java:63)&lt;br/&gt;
	at org.activiti.douglass.api.Cases.uploadCaseAttachment(Cases.java:84)&lt;/p&gt;

&lt;p&gt;Seems to be similar to a bug that was fixed before: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-160&quot; title=&quot;bug with GridFSFile.valdate() when using non-standard bucket&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-160&quot;&gt;&lt;del&gt;JAVA-160&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;My code:&lt;/p&gt;

&lt;p&gt;81    GridFSInputFile gridFsFile = fileSystem.createFile(uploadStream, caze.getOid()+&quot;/&quot;+fileName);&lt;br/&gt;
82    gridFsFile.setContentType(mimeType);&lt;br/&gt;
83    gridFsFile.save();&lt;br/&gt;
84    gridFsFile.validate();&lt;/p&gt;

&lt;p&gt;Driver code:&lt;/p&gt;

&lt;p&gt;54     public void validate() throws MongoException &lt;/p&gt;
{
55         if ( _fs == null )
56             throw new MongoException( &quot;no _fs&quot; );
57         if ( _md5 == null )
58             throw new MongoException( &quot;no _md5 stored&quot; );
59         
60         DBObject cmd = new BasicDBObject( &quot;filemd5&quot; , _id );
61         cmd.put( &quot;root&quot; , _fs._bucketName );
62         DBObject res = _fs._db.command( cmd );
63         String m = res.get( &quot;md5&quot; ).toString();
64         if ( m.equals( _md5 ) )
65             return;
66 
67         throw new MongoException( &quot;md5 differ.  mine [&quot; + _md5 + &quot;] theirs [&quot; + m + &quot;]&quot; );
68     }
</description>
                <environment>MongoDB 1.8.2 mac 64 bit&lt;br/&gt;
Java driver 2.5.3</environment>
        <key id="17755">JAVA-363</key>
            <summary>NPE in GridFSFile.validate</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="scotthernandez">Scott Hernandez</assignee>
                                    <reporter username="tombaeyens">Tom Baeyens</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Jun 2011 14:27:41 +0000</created>
                <updated>Wed, 19 Oct 2016 14:17:24 +0000</updated>
                            <resolved>Mon, 24 Oct 2011 07:18:47 +0000</resolved>
                                                    <fixVersion>2.7</fixVersion>
                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="62111" author="auto" created="Mon, 24 Oct 2011 07:15:46 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;scotthernandez&apos;, u&apos;name&apos;: u&apos;Scott Hernandez&apos;, u&apos;email&apos;: u&apos;scotthernandez@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/JAVA-363&quot; title=&quot;NPE in GridFSFile.validate&quot; class=&quot;issue-link&quot; data-issue-key=&quot;JAVA-363&quot;&gt;&lt;del&gt;JAVA-363&lt;/del&gt;&lt;/a&gt;: npe fix&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-java-driver/commit/e177d745d6e0a76a7b03e09147035075a0e77494&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-java-driver/commit/e177d745d6e0a76a7b03e09147035075a0e77494&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="35560" author="tombaeyens" created="Wed, 1 Jun 2011 14:45:26 +0000"  >&lt;p&gt;16:05:42,350 INF  | activiti.cases.chunks -----------------------  &lt;span class=&quot;error&quot;&gt;&amp;#91;org.activiti.douglass.api.Activiti&amp;#93;&lt;/span&gt;&lt;br/&gt;
16:05:42,350 INF  |   { &quot;_id&quot; : &lt;/p&gt;
{ &quot;$oid&quot; : &quot;4de647361c8d6ce7c7cb7260&quot;}
&lt;p&gt; , &quot;files_id&quot; : &lt;/p&gt;
{ &quot;$oid&quot; : &quot;4de647361c8d6ce7c7cb725f&quot;}
&lt;p&gt; , &quot;n&quot; : 0 , &quot;data&quot; : &amp;lt;Binary Data&amp;gt;}  &lt;span class=&quot;error&quot;&gt;&amp;#91;org.activiti.douglass.api.Activiti&amp;#93;&lt;/span&gt;&lt;br/&gt;
16:05:42,354 INF  | activiti.cases.files -----------------------  &lt;span class=&quot;error&quot;&gt;&amp;#91;org.activiti.douglass.api.Activiti&amp;#93;&lt;/span&gt;&lt;br/&gt;
16:05:42,355 INF  |   { &quot;_id&quot; : &lt;/p&gt;
{ &quot;$oid&quot; : &quot;4de647361c8d6ce7c7cb725f&quot;}
&lt;p&gt; , &quot;chunkSize&quot; : 262144 , &quot;length&quot; : 250 , &quot;md5&quot; : &quot;3ba45e774d5b7a7d767cd0dc02da97df&quot; , &quot;filename&quot; : &quot;4de647361c8d6ce7c7cb725e/warning.txt&quot; , &quot;contentType&quot; : &quot;text conf def list log in = text/plain&quot; , &quot;uploadDate&quot; : &lt;/p&gt;
{ &quot;$date&quot; : &quot;2011-06-01T14:05:42Z&quot;}
&lt;p&gt; , &quot;aliases&quot; :  null }  &lt;span class=&quot;error&quot;&gt;&amp;#91;org.activiti.douglass.api.Activiti&amp;#93;&lt;/span&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrhc1j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14751</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>