catch (Throwable ex)
{
ex.printStackTrace();
}
YajswConfigurationImpl config = new YajswConfigurationImpl();
// config.setDebug(false);
config.init();
try
{
_overrideStdErr = config.getBoolean("wrapper.java.dump.override", false);
}
catch (Exception ex)
{
System.out.println("Error getting wrapper.java.dump.override " + ex.getMessage());
}
String mainClassName = config.getString("wrapper.java.app.mainclass");
String jarName = config.getString("wrapper.java.app.jar");
String groovyScript = config.getString("wrapper.groovy");
if (mainClassName == null && jarName == null && groovyScript == null)
mainClassName = config.getString("wrapper.app.parameter.1");
if (jarName == null && mainClassName == null && groovyScript == null)
{
System.out.println("missing main class name or jar file or groovy file. please check configuration");
return;
}
if (jarName != null)
{
mainMethod = loadJar(jarName);
}
else if (mainClassName != null)
try
{
Class cls = ClassLoader.getSystemClassLoader().loadClass(mainClassName);// Class.forName(mainClassName,
// currentContext);
mainMethod = cls.getMethod("main", new Class[]
{ String[].class });
}
catch (Exception e)
{
System.out.println("error finding main method in class: " + mainClassName + " : " + e.getMessage());
// log.throwing(WrapperMain.class.getName(), "main", e);
e.printStackTrace();
return;
}
else
_groovyScript = groovyScript;
String stopConfig = config.getString("wrapper.stop.conf");
if (stopConfig != null)
{
File f = new File(stopConfig);
_externalStop = true;
}
System.out.println("external stop " + _externalStop);
exitOnMainTerminate = config.getInt("wrapper.exit_on_main_terminate", DEFAULT_EXIT_ON_MAIN_TERMINATE);
exitOnException = config.getInt("wrapper.exit_on_main_exception", DEFAULT_EXIT_ON_MAIN_EXCEPTION);
mainMethodArgs = getAppParam((Configuration) config);
setConfiguration((Configuration) config);
if (_config.getBoolean("wrapper.java.jmx", false))
registerMBean(config);