- private void initWebServer() {
- String httpPort = getFrameworkProp("org.osgi.service.http.port");
- String httpsPort = getFrameworkProp("org.osgi.service.http.port.secure");
- try {
- if (httpPort != null || httpsPort != null) {
- final Hashtable<String, Object> jettyProps = new Hashtable<String, Object>();
- if (httpPort != null) {
- jettyProps.put(JettyConstants.HTTP_PORT, httpPort);
- jettyProps.put(JettyConstants.HTTP_ENABLED, true);
- }
- if (httpsPort != null) {
- jettyProps.put(JettyConstants.HTTPS_PORT, httpsPort);
- jettyProps.put(JettyConstants.HTTPS_ENABLED, true);
- jettyProps.put(JettyConstants.SSL_KEYSTORETYPE, "PKCS12");
- // jettyProps.put(JettyConstants.SSL_KEYSTORE,
- // nodeSecurity.getHttpServerKeyStore().getCanonicalPath());
- jettyProps.put(JettyConstants.SSL_PASSWORD, "changeit");
- jettyProps.put(JettyConstants.SSL_WANTCLIENTAUTH, true);
- }
- if (configurationAdmin != null) {
- // TODO make filter more generic
- String filter = "(" + JettyConstants.HTTP_PORT + "=" + httpPort + ")";
- if (configurationAdmin.listConfigurations(filter) != null)
- return;
- Configuration jettyConf = configurationAdmin
- .createFactoryConfiguration(KernelConstants.JETTY_FACTORY_PID, null);
- jettyConf.update(jettyProps);
-
- } else {
- JettyConfigurator.startServer("default", jettyProps);
- }
- }
- } catch (Exception e) {
- throw new CmsException("Cannot initialize web server on " + httpPortsMsg(httpPort, httpsPort), e);
+ Bundle bitronixBundle = FrameworkUtil.getBundle(bitronix.tm.Configuration.class);
+ File tmBaseDir = bitronixBundle.getDataFile(KernelConstants.DIR_TRANSACTIONS);
+ File tmDir1 = new File(tmBaseDir, "btm1");
+ tmDir1.mkdirs();
+ tmConf.setLogPart1Filename(new File(tmDir1, tmDir1.getName() + ".tlog").getAbsolutePath());
+ File tmDir2 = new File(tmBaseDir, "btm2");
+ tmDir2.mkdirs();
+ tmConf.setLogPart2Filename(new File(tmDir2, tmDir2.getName() + ".tlog").getAbsolutePath());