NullPointerException inside SqlJdbcUtil.java
-------------------------------------------- Key: OFBIZ-742 URL: https://issues.apache.org/jira/browse/OFBIZ-742 Project: OFBiz (The Open for Business Project) Issue Type: Bug Components: framework Affects Versions: SVN trunk Environment: SUSE Linux 10.1 with MySQL 5.0.18 Reporter: Michael Imhof <entity entity-name="Archivindex" package-name="ch.nowhow.isgate.archiv" title="Archiv Index Entity" no-auto-stamp="true"> <field name="id" type="id-num"></field> <field name="date" type="date" not-null="true"></field> <prim-key field="id"/> </entity> <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. Method: ====== public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). Code: ===== case 14: sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); break; Solution: ====== case 14: if (fieldValue != null) { sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); } else { sqlP.setValue((java.sql.Date)null); } break; -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474834 ] Si Chen commented on OFBIZ-742: ------------------------------- Do not paste code. Send in a patch and click on grant license option. Otherwise we cannot include it. > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Imhof updated OFBIZ-742: -------------------------------- Attachment: patch742.txt > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490952 ] Jacopo Cappellato commented on OFBIZ-742: ----------------------------------------- Can we close this issue? > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491244 ] Michael Imhof commented on OFBIZ-742: ------------------------------------- Why would you like to close this issue? The bug isn't fixed yet... > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12491367 ] Jacopo Cappellato commented on OFBIZ-742: ----------------------------------------- You are right Michael, sorry. I was just confused by the following commit log (wrongly associated to this issue): "Applied changes from Karl Eilebrecht, plus some formatting changes done while reviewing it; old Jira OFBIZ-742; note no CLA needed as this inherets the already in place apache license" However the jira id is the one of the old site, not this one... > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacopo Cappellato reassigned OFBIZ-742: --------------------------------------- Assignee: Jacopo Cappellato > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Assigned To: Jacopo Cappellato > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497124 ] Jacopo Cappellato commented on OFBIZ-742: ----------------------------------------- It seems good to me (even if the use case is pretty rare); are there comments/concerns before I test and commit? > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Assigned To: Jacopo Cappellato > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David E. Jones closed OFBIZ-742. -------------------------------- Resolution: Fixed Fix Version/s: SVN trunk Thanks Michael, and thanks for looking at it Jacopo. The changes are in SVN rev 539790 for the trunk, and I'll throw it into the 4.0 branch too. > NullPointerException inside SqlJdbcUtil.java > -------------------------------------------- > > Key: OFBIZ-742 > URL: https://issues.apache.org/jira/browse/OFBIZ-742 > Project: OFBiz (The Open for Business Project) > Issue Type: Bug > Components: framework > Affects Versions: SVN trunk > Environment: SUSE Linux 10.1 with MySQL 5.0.18 > Reporter: Michael Imhof > Assigned To: Jacopo Cappellato > Fix For: SVN trunk > > Attachments: patch742.txt > > > <entity entity-name="Archivindex" > package-name="ch.nowhow.isgate.archiv" > title="Archiv Index Entity" no-auto-stamp="true"> > <field name="id" type="id-num"></field> > <field name="date" type="date" not-null="true"></field> > <prim-key field="id"/> > </entity> > <field-type-def type="date" sql-type="DATETIME" java-type="java.util.Date"></field-type-def> > If the date field on the database is NULL, we got an error in the SqlJdbcUtil.java. > Method: > ====== > public static void setValue(SQLProcessor sqlP, ModelField modelField, String entityName, Object fieldValue, ModelFieldTypeReader modelFieldTypeReader). > Code: > ===== > case 14: > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > break; > Solution: > ====== > case 14: > if (fieldValue != null) { > sqlP.setValue(new java.sql.Date(((java.util.Date) fieldValue).getTime())); > } else { > sqlP.setValue((java.sql.Date)null); > } > break; > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |