[
http://jira.codehaus.org/browse/MHIBERNATE-63?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_122560
]
James Olsen commented on MHIBERNATE-63:
---------------------------------------
Unfortunately I don't have anything approximating this anymore. The 'empty
subclass' work-around I was using eventually became unmanageable as there were
too many. I switched to embedding Ant commands into the Maven build instead
via the maven-antrun-plugin.
I think to duplicate it's a simple matter of trying to use an instance of the
same toolclass in two executions bound to the same phase.
The
<hibernatetool.reveng.toolclass>
com.xxx.hibernate.tools.reveng.ReverseEngineeringTool
</hibernatetool.reveng.toolclass>
fragment is placed in the componentProperties section. The use of tools wasn't
documented but this matched the pattern for other property entries mapped from
the Ant equivalents and works for a single execution.
Each execution is for an hbmtemplate with a template file that uses the tool.
> Cannot run multiple executions and have custom tool
> ---------------------------------------------------
>
> Key: MHIBERNATE-63
> URL: http://jira.codehaus.org/browse/MHIBERNATE-63
> Project: Maven 2.x Hibernate Plugin
> Issue Type: Bug
> Affects Versions: 2.0-alpha-2
> Reporter: James Olsen
> Assignee: Johann Reyes
>
> If the plugin is configured to have multiple executions you cannot use a
> hibernate toolclass such as:
> <hibernatetool.reveng.toolclass>
> com.xxx.hibernate.tools.reveng.ReverseEngineeringTool
> </hibernatetool.reveng.toolclass>
> The second execution will fail with an error as shown below. This seems to
> be a ClassLoader issue. I think FreeMarker is using a static/singleton cache
> of method information and is loaded with the plugin ClassLoader. The tool
> however is loaded via a different ClassLoader managed by the plugin. During
> the second execution FreeMarker determines that the tool class has been
> reloaded via a different ClassLoader and therefore it's cached copy of method
> info for the tool could be wrong so it clears it's caches - unfortunately it
> clears all of it's cached info! It is then unable to find method info for
> anything.
> I've tried placing the tool class in a separate jar in the plugin's
> extensions but the plugin doesn't look in that ClassLoader when trying to
> load tools.
> 11:17:53,090 INFO freemarker.beans - Detected a reloaded class
> [com.xxx.hibernate.tools.reveng.ReverseEngineeringTool]. Clearing
> BeansWrapper caches.
> 11:17:53,090 ERROR freemarker.runtime - get(getMetaAttribAsBool) failed on
> instance of org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
> The problematic instruction:
> ----------
> ==> if pojo.getMetaAttribAsBool(property, "gen-property", true) [on line 3,
> column 1 in src/main/resources/pojo-query-keys/PojoPropertyAccessors.ftl]
> in include "PojoPropertyAccessors.ftl" [on line 4, column 1 in
> src/main/resources/pojo-query-keys/Pojo.ftl]
> ----------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email