Discussion:
Exception when value is null
Junior Manzini
2018-10-23 19:17:35 UTC
Permalink
Hi Lukas, when I get a null value an exception is thrown

java.lang.IllegalArgumentException:* Field (null) is not contained in Row*

pesquisaRhDto.setFotoUrl(r.get(RH.SFOTOEXT));


using jOOQ 3.9.1
Thanks
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lukas Eder
2018-10-24 05:30:11 UTC
Permalink
Hi Junior

Thank you for your message. This is very unusual, the message would
indicate that your RH.SFOTOEXT reference is null, meaning that something
might have gone wrong when initialising it. One reason I could imagine is
that you're using Eclipse and the RH table doesn't compile. Eclipse would
then still produce byte code through its incremental compiler. Can you
confirm that RH.SFOTOEXT is null? If so, why is it null?

If not, can you please help reproduce the issue? Ideally through an MCVE:
https://stackoverflow.com/help/mcve

Thanks,
Lukas
Post by Junior Manzini
Hi Lukas, when I get a null value an exception is thrown
java.lang.IllegalArgumentException:* Field (null) is not contained in Row*
pesquisaRhDto.setFotoUrl(r.get(RH.SFOTOEXT));
using jOOQ 3.9.1
Thanks
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junior Manzini
2018-10-24 13:22:18 UTC
Permalink
Hi Lukas, thanks for the help, I'm not using Eclipse but Intellij.
I noticed that this happens when the record I'm trying to access through
GET is null, the reference to the table is not null only the table records
in my database are null.

[image: jooq_issue.png]
Select

try {
ctx = DSL.using(connection, SQLDialect.MYSQL);
Result<?> result = ctx.select(RH.LNUM, RH.SNOME, RH.SAPELIDO, RH.SRG, RH.SEMAIL, RH.ICARGO, RH.SCPF)
.from(RH)
.fetch();

for (Record r : result) {
pesquisaRhDto = new PesquisaRhDto();
pesquisaRhDto.setRhId(r.get(RH.LNUM));
pesquisaRhDto.setNome(r.get(RH.SNOME));
pesquisaRhDto.setApelido(r.get(RH.SAPELIDO));
String fotoExt = r.get(RH.SFOTOEXT).toString();//Exception
pesquisaRhDto.setEmail(r.get(RH.SEMAIL));
pesquisaRhDto.setCpf(r.get(RH.SCPF));
rhList.add(pesquisaRhDto);
}
} catch (Exception e) {
log.error(e.toString());
} finally {
if (ctx != null) {
ctx.close();
}
}
return rhList;
}


Thanks Again...

Em terça-feira, 23 de outubro de 2018 16:17:35 UTC-3, Junior Manzini
Post by Junior Manzini
Hi Lukas, when I get a null value an exception is thrown
java.lang.IllegalArgumentException:* Field (null) is not contained in Row*
pesquisaRhDto.setFotoUrl(r.get(RH.SFOTOEXT));
using jOOQ 3.9.1
Thanks
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junior Manzini
2018-10-24 14:06:47 UTC
Permalink
*Sorry folks, messy my ... I did not pass the table on select ....*
:/

Em terça-feira, 23 de outubro de 2018 16:17:35 UTC-3, Junior Manzini
Post by Junior Manzini
Hi Lukas, when I get a null value an exception is thrown
java.lang.IllegalArgumentException:* Field (null) is not contained in Row*
pesquisaRhDto.setFotoUrl(r.get(RH.SFOTOEXT));
using jOOQ 3.9.1
Thanks
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Lukas Eder
2018-10-24 14:15:36 UTC
Permalink
Hi Junior,

Indeed, I've just seen it again :) Glad you found it!

Cheers,
Lukas
Post by Junior Manzini
*Sorry folks, messy my ... I did not pass the table on select ....*
:/
Em terça-feira, 23 de outubro de 2018 16:17:35 UTC-3, Junior Manzini
Post by Junior Manzini
Hi Lukas, when I get a null value an exception is thrown
java.lang.IllegalArgumentException:* Field (null) is not contained in Row*
pesquisaRhDto.setFotoUrl(r.get(RH.SFOTOEXT));
using jOOQ 3.9.1
Thanks
--
You received this message because you are subscribed to the Google Groups
"jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...