# Bug | JDBC not mapping properly in 4.5.0

**URL:** <https://community.cratedb.com/t/bug-jdbc-not-mapping-properly-in-4-5-0/662>\
**Category:** CrateDB\
**Created:** [April 28, 2021, 8:40am UTC](https://community.cratedb.com/t/bug-jdbc-not-mapping-properly-in-4-5-0/662 "2021-04-28T08:40:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpdev](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/cpdev/32/305_2.png) [@cpdev](https://community.cratedb.com/u/cpdev)\
**Post date:** [April 28, 2021, 8:40am UTC](https://community.cratedb.com/t/bug-jdbc-not-mapping-properly-in-4-5-0/662/1 "2021-04-28T08:40:46Z")

</div>

Curl request on the database:

```auto
/usr/bin/curl -on/json' -sSXPOST '127.0.0.1:4200/_sql?pretty' -d@- << EOF
 {"stmt":"SELECT allowed_users FROM myproject.projects WHERE allowed_users != [NULL]"}
EOF

```

Result:

```auto
{"cols":["allowed_users"],"rows":[[[{"accepted":false,"role":"developer","email":"email@gmail.com"}]]],
"rowcount":1,"duration":50.122208}

```

Java line on which error occurs:

```auto
Object[] array = (Object[]) rs.getArray("allowed_users").getArray();

```

Java model AllowedUser:

```auto
public class AllowedUser {

    @JsonProperty
    String email;
    @JsonProperty
    String role;
    @JsonProperty
    Boolean accepted;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public Boolean getAccepted() {
        return accepted;
    }

    public void setAccepted(Boolean accepted) {
        this.accepted = accepted;
    }
}

```

Error that Crate returns:

```auto
Unrecognized field "type" (class models.AllowedUser), not marked as ignorable 
(3 known properties: "email", "role", "accepted"]) at [Source: (String)"[{"type":"json","value":
"{\"accepted\":false,\"email\":\"email@gmail.com\",\"role\":\"developer\"}"}]"; line: 1, column: 11] 
(through reference chain: java.util.ArrayList[0]->models.AllowedUser["type"])

```

Column allowed\_users defined as:

```auto
allowed_users ARRAY(OBJECT(IGNORED))

```

Locally and on the QA server Crate doesn’t return any errors and works as expected. The issue occurs only on the production server. The dataset is identical on all envs.

Local and QA Crate version: 4.0.10  
Production Crate version: 4.5.0

---

<div class="post-metadata">

**Author:** ![proddata](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/proddata/32/1379_2.png) [@proddata](https://community.cratedb.com/u/proddata)\
**Post date:** [April 28, 2021, 3:18pm UTC](https://community.cratedb.com/t/bug-jdbc-not-mapping-properly-in-4-5-0/662/2 "2021-04-28T15:18:56Z")

</div>

Hi @cpdev

Welcome to the CrateDB Community 😉  
I would kindly ask you to not crosspost across **github** / **community**.

I answered on the GitHub issue and mark the discussion as solved/closed.

> <https://github.com/crate/crate/issues/11325>
>
> Curl request on the database:
> \`\`\`
> /usr/bin/curl -on/json' -sSXPOST '127.0.0.1:…4200/\_sql?pretty' -d@- \<\< EOF
> {"stmt":"SELECT allowed\_users FROM myproject.projects WHERE allowed\_users != \[NULL\]"}
> EOF
> \`\`\`
> 
> Result:
> \`\`\`
> {"cols":\["allowed\_users"\],"rows":\[\[\[{"accepted":false,"role":"developer","email":"email@gmail.com"}\]\]\],
> "rowcount":1,"duration":50.122208}
> \`\`\`
> 
> 
> Java line on which error occurs:
> \`\`\`
> Object\[\] array = (Object\[\]) rs.getArray("allowed\_users").getArray();
> \`\`\`
> 
> Java model AllowedUser:
> \`\`\`
> public class AllowedUser {
> 
> @JsonProperty
> String email;
> @JsonProperty
> String role;
> @JsonProperty
> Boolean accepted;
> 
> public String getEmail() {
> return email;
> }
> 
> public void setEmail(String email) {
> this.email = email;
> }
> 
> public String getRole() {
> return role;
> }
> 
> public void setRole(String role) {
> this.role = role;
> }
> 
> public Boolean getAccepted() {
> return accepted;
> }
> 
> public void setAccepted(Boolean accepted) {
> this.accepted = accepted;
> }
> }
> \`\`\`
> 
> Error that Crate returns:
> \`\`\`
> Unrecognized field "type" (class models.AllowedUser), not marked as ignorable 
> (3 known properties: "email", "role", "accepted"\]) at \[Source: (String)"\[{"type":"json","value":
> "{\\"accepted\\":false,\\"email\\":\\"email@gmail.com\\",\\"role\\":\\"developer\\"}"}\]"; line: 1, column: 11\] 
> (through reference chain: java.util.ArrayList\[0\]-\>models.AllowedUser\["type"\])
> \`\`\`
> 
> Column allowed\_users defined as:
> \`\`\`
> allowed\_users ARRAY(OBJECT(IGNORED))
> \`\`\`
> 
> Locally and on the QA server Crate doesn't return any errors and works as expected. The issue occurs only on the production server. The dataset is identical on all envs.
> 
> Local and QA Crate version: 4.0.10 
> Production Crate version: 4.5.0

best regards  
Georg

---

<div class="post-metadata">

**Author:** ![proddata](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/proddata/32/1379_2.png) [@proddata](https://community.cratedb.com/u/proddata)\
**Post date:** [April 28, 2021, 3:19pm UTC](https://community.cratedb.com/t/bug-jdbc-not-mapping-properly-in-4-5-0/662/3 "2021-04-28T15:19:55Z")

</div>


