Author: scabanovich
Date: 2012-01-18 19:53:11 -0500 (Wed, 18 Jan 2012)
New Revision: 37961
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsGenerator.java
Log:
JBIDE-10639
https://issues.joss.org/browse/JBIDE-10639
Start velocity with context class loader set to current class loader.
Modified:
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsGenerator.java
===================================================================
---
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsGenerator.java 2012-01-18
22:06:49 UTC (rev 37960)
+++
trunk/struts/plugins/org.jboss.tools.struts/src/org/jboss/tools/struts/model/helpers/StrutsGenerator.java 2012-01-19
00:53:11 UTC (rev 37961)
@@ -181,6 +181,10 @@
private void executeTemplate(Map<String,Object> parameters, String templatePath,
String targetPath) {
ServiceDialog d = PreferenceModelUtilities.getPreferenceModel().getService();
+
+ ClassLoader c = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+
try {
VelocityContext context = new VelocityContext(parameters);
final Template template;
@@ -222,6 +226,8 @@
StrutsModelPlugin.getPluginLog().logError(e);
d.showDialog(StrutsUIMessages.ERROR, e.getMessage(), new
String[]{StrutsUIMessages.OK}, null, ServiceDialog.ERROR);
/// ErrorDialog.openError(ModelPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell(),e);
+ } finally {
+ Thread.currentThread().setContextClassLoader(c);
}
};