Skip to content

Commit

Permalink
Fix hazelcast plugin xalan NoClassDefFoundError
Browse files Browse the repository at this point in the history
  • Loading branch information
maxjiang153 committed Nov 4, 2015
1 parent baf9fd7 commit 90f7efd
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -48,6 +48,9 @@ public class HazelcastPlugin extends TimerTask implements Plugin {
private static final long CLUSTER_STARTUP_DELAY_TIME =
JiveGlobals.getLongProperty("hazelcast.startup.delay.seconds", 5);

private static final String TRANSFORMERFACTORY = "javax.xml.transform.TransformerFactory";
private static String OLDTRANSFORMERFACTORY;

public void initializePlugin(PluginManager manager, File pluginDirectory) {
// start cluster using a separate thread after a short delay
// this will allow other plugins to initialize during startup
Expand All @@ -72,10 +75,16 @@ public boolean accept(File pathname) {
logger.warn("Conflicting clustering plugins found; remove Coherence and/or Enterprise jar files");
throw new IllegalStateException("Clustering plugin configuration conflict (Coherence)");
}

// https://github.com/hazelcast/hazelcast/issues/6614
OLDTRANSFORMERFACTORY = System.getProperty(TRANSFORMERFACTORY);
System.setProperty(TRANSFORMERFACTORY, "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");

ClusterManager.startup();
}

public void destroyPlugin() {
System.setProperty(TRANSFORMERFACTORY, OLDTRANSFORMERFACTORY);
// Shutdown is initiated by XMPPServer before unloading plugins
if (!XMPPServer.getInstance().isShuttingDown()) {
ClusterManager.shutdown();
Expand Down

0 comments on commit 90f7efd

Please sign in to comment.