Question

I have a java web application running in tomcat, communicating with my db through hibernate. The field is_enabled on the database is mapped as a TINYINT on the db, but a boolean in the hbm.xml:

<property name="isEnabled" type="boolean">
        <column name="is_enabled"  />
</property>

I know nothing is wrong with the mapping as I have another column which is a TINYINT(1) and mapped as a boolean in the hbm.xml. But when I add this property my WAR doesn't load and in Tomcat I get several:

org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
 SEVERE: The web application [] appears to have started a thread name
 [Job_Executor2] but has failed to stop it.  This is very likely to
 create a memory leak.

Any idea how to go about debugging this?

Was it helpful?

Solution

I know nothing is wrong with the mapping as I have another column which is a TINYINT(1) and mapped as a boolean in the hbm.xml.

It is hard to comment just by looking at the boolean property by itself. Perhaps a look at the entire hbm.xml might give an idea. Also, is there code executed at the init of your app (or one of your servlets or beans or what have you) that is looking at this property and doing something with it?

It is extremely unlikely that this property alone is the culprit. Chances are the memory leak (or what have you as root cause) is already there, and that the presence of this property (and whatever code in hibernate ... or in your app) causes to go over the tipping point.

That is, the culprit is not this property. It is simply a catalyst that makes an existing software or system bug to manifest itself.

Any idea how to go about debugging this?

For problems like this, it is best to use a professional ($$$) profiling tool like JProfiler.

But I've also used other open source or free tools out there to troubleshoot memory related problems (caused by web services, hibernate or what have you.) There are some options.

  1. Eclipse Memory Analyzer - this tool was a godsend for me when I had to root cause some problems with code interacting with hibernate.

  2. VisualGC and VisualVM - these are two distinct but closely related tools that could help you root cause the problem (or at least narrow where the problems might be.)

Things like these require a multi-pronged approach and you will find yourself using several tools to skin this cat.

Give these three tools listed above. Hope they help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top