mysql> insert into mysql.user (host, user, password) values(‘localhost’, ‘userstore’, password(‘userstore’));
mysql> flush privileges;
Need to do the same for user ‘registry’
Start script: wso2server.sh
Main class: org.wso2.carbon.bootstrap.Bootstrap
public static void main(String[] args) {
//Setting Carbon Home
if (System.getProperty(LauncherConstants.CARBON_HOME) == null) {
System.setProperty(LauncherConstants.CARBON_HOME, ".");
}
System.setProperty(LauncherConstants.AXIS2_HOME, System.getProperty(LauncherConstants.CARBON_HOME));
//To keep track of the time taken to start the Carbon server.
System.setProperty("wso2carbon.start.time", System.currentTimeMillis() + "");
writePID(System.getProperty(LauncherConstants.CARBON_HOME));
processCmdLineArgs(args);
invokeExtensions();
launchCarbon();
}
setup framework class loader ?? java.security.AccessController.doPrivileged (why)
launch() {
build initial property map - read from repository/conf/etc/launch.ini
for osgi properties, mainly defined the JDK packages exported through the system bundle
org.osgi.framework.system.packages
then invoke org.eclipse.core.runtime.adaptor.EclipseStarter.startup()
}
how to handle class loader in a framework
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
frameworkClassLoader = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<URLClassLoader>() {
public URLClassLoader run() {
URLClassLoader cl = null;
try {
cl = new ChildFirstURLClassLoader(
new URL[]{new URL(initialPropsMap.get(OSGI_FRAMEWORK))}, null);
} catch (MalformedURLException e) {
log.error(e.getMessage(), e);
}
return cl;
}
}
);
} finally {
Thread.currentThread().setContextClassLoader(original);
}
org.wso2.carbon.tomcat.internal.TomcatBundleActivator