Thursday, November 21, 2013

How to monitor your tomee+ app running at eclipse indigo

It's so sad that Eclipse dropped its support to TPTP project, so it's not available for Indigo or June. MAT is not exactly something friendly. So, the easiest way to monitor the heap I've found was to use GCViewer. It's simple, it has a button to refresh the graph on every file change (it parses the garbage collector file and presents in a nice graph) and it really helps.

So, download the GCViewer fork (that will allow you to parse the most recent JVM gc files) and add these to your tomee server launch configuration parameters

-Xloggc:gc.log -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError

Just notice that when the server shuts down, the gc file vanishes too.

I wonder why Eclipse can't integrate such a simple tool.

Upgrading from TomEE+ 1.5.2 to TomEE+ 1.6.0

It's getting to an end. My impressions

  • I had to recreate JMS tables at Oracle, or you'll get a mysterious ORA-01465: invalid hex number.
  • I had to update Quartz DB Schema adding a new column as described at http://quartz-scheduler.org/documentation/quartz-2.2.x/new-in-quartz-2_2  . They say "ALTER TABLE QRTZ_FIRED_TRIGGERS ADD COLUMN SCHED_TIME NUMBER(13) NOT NULL;" but this query seems not to work, so just open sqldeveloper and create the column by hand.
  • OpenJPA seems to have a bug related to embedded composite keys, see http://stackoverflow.com/questions/20123910/openjpa-persistenceexception-while-trying-to-save-class-with-composite-primary , so I'll have to write more code to use a surrogate key + unique clause for the original composite key. Lucky me I only use a few (it seems that composite primary keys in JPA are some sort of old-fashioned anyway) otherwise this would be a showstopper.
  • I had to change my applications.properties file to replace the driver to driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate instead of the standard one.
  • Performance was significantly improved from 1.5.2 to 1.6.0 but it's early to say it's more stable. At least, seems to be better and apache developers seem to be focusing on 1.6.0, so several fixes are being addressed in this version. 1.5.2 seems to be receiving less attention, even for 1.5.3, I hear almost nothing about it. So it seems 1.6.0 is "de facto" version. Milestones would be nice. Working only with snapshots gives me the sensation that I am developing in a slack line.
  • When people say TomEE community is active, they're probably meaning that Romain is there. No one else answers the questions as fast as him. The same about OpenJPA and Rick.