<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:55:35 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-1820] Unable to Map JSON to POJO </title>
                <link>https://jira.mongodb.org/browse/JAVA-1820</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Unable to Map JSON to POJO.&lt;/p&gt;

&lt;p&gt;I have inserted JSON from R tool.&lt;br/&gt;
I am able to read and map the JSON to Java POJO using MongoTemplate API(Spring) in my windows environment.&lt;br/&gt;
But If I try to Map JSON to Java POJO using MongoTemplate API(Spring) &lt;br/&gt;
in Ubuntu environment,It is failing and throwing exception.&lt;/p&gt;

&lt;p&gt;Please find the attached error log and bson dump .&lt;/p&gt;</description>
                <environment>Ubuntu 14.04</environment>
        <key id="205114">JAVA-1820</key>
            <summary>Unable to Map JSON to POJO </summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="-1">Unassigned</assignee>
                                    <reporter username="murali.lancer">murali</reporter>
                        <labels>
                    </labels>
                <created>Tue, 19 May 2015 13:21:24 +0000</created>
                <updated>Wed, 11 Sep 2019 19:10:37 +0000</updated>
                            <resolved>Wed, 20 May 2015 08:33:20 +0000</resolved>
                                                                    <component>BSON</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="918748" author="ross@10gen.com" created="Wed, 20 May 2015 08:33:20 +0000"  >&lt;p&gt;As you can read and Map to a POJO when you manually insert the data, you have confirmed this isn&apos;t a Java driver issue.  For that reason I&apos;m closing this ticket as &quot;Works as Designed&quot;.&lt;/p&gt;

&lt;p&gt;Rather it seems that this is an integration issue with the tooling you are using for whatever reason.  There is little information to go on to help identify the cause and as mentioned previously this isn&apos;t the best place to get support.&lt;/p&gt;

&lt;p&gt;Please could you post your question to &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user mailinglist&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stackoverflow&lt;/a&gt; and link it to this ticket so I can follow it.  The reasons being are you will reach a boarder audience there, some of whom may have had similar issues in the past.&lt;/p&gt;

&lt;p&gt;It might prove helpful in your post to include what the JSON looks like and the POJO object as well.  Also, provide version information, what version of Spring, Java Driver, MongoDB etc.&lt;/p&gt;</comment>
                            <comment id="918686" author="murali.lancer" created="Wed, 20 May 2015 05:32:58 +0000"  >&lt;p&gt;The data set in both environments(ubuntu and Windows) is same.&lt;br/&gt;
Steps to reproduce : &lt;br/&gt;
1) Create JSON from R tool/Script  and save in Mongo db.&lt;br/&gt;
2) Fetch the JSON from java rest API (Mapping to POJO and return the POJO to client)&lt;br/&gt;
Note:If I copy the same JSON (which was created by R tool ) from Mongo terminal(Ubuntu) and if I re-insert using Mongo commands(like db.insert),&lt;br/&gt;
I am able to read and Map to POJO.&lt;/p&gt;</comment>
                            <comment id="918003" author="ross@10gen.com" created="Tue, 19 May 2015 15:25:00 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=murali.lancer&quot; class=&quot;user-hover&quot; rel=&quot;murali.lancer&quot;&gt;murali.lancer&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;It seems strange that it works on Windows but not on Ubuntu, is the dataset the same?  I&apos;d see anything attached to the ticket - can you provide a reproduction case?  Also, does querying the data from the mongo shell work as expected?&lt;/p&gt;

&lt;p&gt;Just to let you know for future reference, the JAVA Jira project is really for Java driver bugs or feature requests. The best place for questions regarding MongoDB usage or the Java driver specifics is the &lt;a href=&quot;https://groups.google.com/forum/#!forum/mongodb-user&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mongodb-user mailinglist&lt;/a&gt; or &lt;a href=&quot;http://stackoverflow.com&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;stackoverflow&lt;/a&gt; as you will reach a boarder audience there and who may have had similar issues in the past.&lt;/p&gt;

&lt;p&gt;Ross&lt;/p&gt;</comment>
                            <comment id="917828" author="murali.lancer" created="Tue, 19 May 2015 13:23:19 +0000"  >&lt;p&gt;Java.lang.IllegalArgumentException: BasicBSONList can only work with numeric keys, not: []&lt;br/&gt;
        at org.bson.types.BasicBSONList._getInt(BasicBSONList.java:161)&lt;br/&gt;
        at org.bson.types.BasicBSONList._getInt(BasicBSONList.java:152)&lt;br/&gt;
        at org.bson.types.BasicBSONList.put(BasicBSONList.java:66)&lt;br/&gt;
        at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:69)&lt;br/&gt;
        at com.mongodb.DefaultDBCallback.objectStart(DefaultDBCallback.java:64)&lt;br/&gt;
        at org.bson.BasicBSONCallback.objectStart(BasicBSONCallback.java:63)&lt;br/&gt;
        at org.bson.BasicBSONDecoder.decodeElement(BasicBSONDecoder.java:205)&lt;br/&gt;
        at org.bson.BasicBSONDecoder.decodeElement(BasicBSONDecoder.java:196)&lt;br/&gt;
        at org.bson.BasicBSONDecoder._decode(BasicBSONDecoder.java:79)&lt;br/&gt;
        at org.bson.BasicBSONDecoder.decode(BasicBSONDecoder.java:57)&lt;br/&gt;
        at com.mongodb.DefaultDBDecoder.decode(DefaultDBDecoder.java:61)&lt;br/&gt;
        at com.mongodb.Response.&amp;lt;init&amp;gt;(Response.java:83)&lt;br/&gt;
        at com.mongodb.DBPort.go(DBPort.java:142)&lt;br/&gt;
        at com.mongodb.DBPort.call(DBPort.java:92)&lt;br/&gt;
        at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)&lt;br/&gt;
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)&lt;br/&gt;
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)&lt;br/&gt;
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)&lt;br/&gt;
        at com.mongodb.DBCollection.findOne(DBCollection.java:728)&lt;br/&gt;
        at com.mongodb.DBCollection.findOne(DBCollection.java:670)&lt;br/&gt;
        at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:2069)&lt;br/&gt;
        at org.springframework.data.mongodb.core.MongoTemplate$FindOneCallback.doInCollection(MongoTemplate.java:2053)&lt;br/&gt;
        at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1828)&lt;br/&gt;
        at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1645)&lt;br/&gt;
        at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:560)&lt;br/&gt;
        at org.springframework.data.mongodb.core.MongoTemplate.findOne(MongoTemplate.java:555)&lt;/p&gt;</comment>
                            <comment id="917827" author="murali.lancer" created="Tue, 19 May 2015 13:21:53 +0000"  >&lt;p&gt;Please help me &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|hs9he7:</customfieldvalue>

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