Skip to content
Miguel Gamallo edited this page Jun 29, 2018 · 39 revisions

This site reflects common pitfalls and solutions. For other common pitfalls please refer to the ROMA Common Pitfalls site.


I created a bean which is supposed to be used in a form, e.g. the ProposalAdvancingBean. However when I save the form, I get an Exception.

The bean does not have an empty default constructor (e.g. public ProposalAdvancingBean()). Add it then it should work.

I'm getting an ErrorCode: 1067. Invalid default value for <timestamp field> when creating the database schema

This error happens when you try to create a table which has more than one "timestamp" type fields and your SQL instance has the "ZERO_DATE" or "ZERO_IN_DATE" modes enabled, as well as the "strict" mode. Having these modes enabled means that your server will not allow a timestamp consisting of zeros, '0000-00-00 00:00:00', or a day or month which are zero, '2018-00-03'. When a table has more than one "timestamp" type fields without default values, the first one defaults to the system date and the second one defaults to '0000-00-00 00:00:00'.

This error might be easily encountered as MySQL 5.7 has both these modes and the "strict" setting enabled by default (at least when performing a Linux installation). To solve it, disable both "ZERO_DATE" and "ZERO_IN_DATE" modes as explained in Setting SQL Modes (MySQL 5.7).

For a more detailed explanation, refer to this StackOverflow post.

Including external JavaScript files in a JSPX document yields unexpected results (erroneous page rendering, subsequent code not executing...)

The reason for this error is that JSPX parser transforms empty elements in self-closing ones. However, the <script> tag cannot be self-closed, so the browser interprets what follows as JavaScript code.

You can fix that by adding a comment between the tags, e.g. <script src="/path/your_file.js"> <!-- empty --> </script> .

From the JSP Specification,section 6.2.3 "Semantic Model":

The first step in processing a JSP document is to identify the nodes of the document. Then, all textual nodes that have only white space are dropped from the document; the only exception are nodes in a jsp:text element, which are kept verbatim.

Clone this wiki locally