Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-34785 #10683

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1006,7 +1006,7 @@ private void _registerServletContext(ServletContext servletContext) {
}

private void _setupInitialBundles() throws Exception {
FrameworkWiring frameworkWiring = getFramework().adapt(
FrameworkWiring frameworkWiring = _framework.adapt(
FrameworkWiring.class);

List<Bundle> lazyActivationBundles = new ArrayList<Bundle>();
Expand Down
Expand Up @@ -21,6 +21,7 @@
import com.liferay.portal.kernel.util.MethodKey;
import com.liferay.portal.kernel.util.ReflectionUtil;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.security.lang.DoPrivilegedUtil;
import com.liferay.portal.util.ClassLoaderUtil;
import com.liferay.portal.util.FileImpl;
import com.liferay.portal.util.PropsValues;
Expand Down Expand Up @@ -62,7 +63,7 @@ public static ClassLoader getClassLoader() {
URL[] urls = new URL[files.length];

for (int i = 0; i < urls.length; i++) {
urls[i] = new URL("file:" + files[i].getAbsolutePath());
urls[i] = new URL("file", null, files[i].getAbsolutePath());
}

_classLoader = new ModuleFrameworkClassLoader(
Expand Down Expand Up @@ -137,7 +138,7 @@ private static void _initDir(String sourcePath, String destinationPath)
if (FileUtil.getFile() == null) {
FileUtil fileUtil = new FileUtil();

fileUtil.setFile(new FileImpl());
fileUtil.setFile(DoPrivilegedUtil.wrap(new FileImpl()));
}

if (!FileUtil.exists(destinationPath)) {
Expand Down
Expand Up @@ -21,7 +21,7 @@

/**
* This class is a simple wrapper in order to make the framework module running
* under its own classlaoder
* under its own class loader.
*
* @author Miguel Pastor
* @author Raymond Augé
Expand Down
Expand Up @@ -120,25 +120,21 @@ public void contextDestroyed(ServletContextEvent servletContextEvent) {
_log.error(e, e);
}

if (PropsValues.MODULE_FRAMEWORK_ENABLED) {
try {
ModuleFrameworkUtilAdapter.stopRuntime();
}
catch (Exception e) {
_log.error(e, e);
}
try {
ModuleFrameworkUtilAdapter.stopRuntime();
}
catch (Exception e) {
_log.error(e, e);
}

try {
super.contextDestroyed(servletContextEvent);

if (PropsValues.MODULE_FRAMEWORK_ENABLED) {
try {
ModuleFrameworkUtilAdapter.stopFramework();
}
catch (Exception e) {
_log.error(e, e);
}
try {
ModuleFrameworkUtilAdapter.stopFramework();
}
catch (Exception e) {
_log.error(e, e);
}
}
finally {
Expand Down Expand Up @@ -175,13 +171,11 @@ public void contextInitialized(ServletContextEvent servletContextEvent) {
PropsValues.LIFERAY_WEB_PORTAL_CONTEXT_TEMPDIR =
tempDir.getAbsolutePath();

if (PropsValues.MODULE_FRAMEWORK_ENABLED) {
try {
ModuleFrameworkUtilAdapter.startFramework();
}
catch (Exception e) {
_log.error(e, e);
}
try {
ModuleFrameworkUtilAdapter.startFramework();
}
catch (Exception e) {
throw new RuntimeException(e);
}

PortalContextLoaderLifecycleThreadLocal.setInitializing(true);
Expand Down Expand Up @@ -239,16 +233,14 @@ public void contextInitialized(ServletContextEvent servletContextEvent) {

clearFilteredPropertyDescriptorsCache(autowireCapableBeanFactory);

if (PropsValues.MODULE_FRAMEWORK_ENABLED) {
try {
ModuleFrameworkUtilAdapter.registerContext(applicationContext);
ModuleFrameworkUtilAdapter.registerContext(servletContext);
try {
ModuleFrameworkUtilAdapter.registerContext(applicationContext);
ModuleFrameworkUtilAdapter.registerContext(servletContext);

ModuleFrameworkUtilAdapter.startRuntime();
}
catch (Exception e) {
_log.error(e, e);
}
ModuleFrameworkUtilAdapter.startRuntime();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}

Expand Down
2 changes: 0 additions & 2 deletions portal-impl/src/com/liferay/portal/util/PropsValues.java
Expand Up @@ -1146,8 +1146,6 @@ public class PropsValues {

public static final int MODULE_FRAMEWORK_BEGINNING_START_LEVEL = GetterUtil.getInteger(PropsUtil.get(PropsKeys.MODULE_FRAMEWORK_BEGINNING_START_LEVEL));

public static final boolean MODULE_FRAMEWORK_ENABLED = GetterUtil.getBoolean(PropsUtil.get(PropsKeys.MODULE_FRAMEWORK_ENABLED));

public static final String[] MODULE_FRAMEWORK_INITIAL_BUNDLES = PropsUtil.getArray(PropsKeys.MODULE_FRAMEWORK_INITIAL_BUNDLES);

public static final String MODULE_FRAMEWORK_PORTAL_DIR = PropsUtil.get(PropsKeys.MODULE_FRAMEWORK_PORTAL_DIR);
Expand Down
6 changes: 0 additions & 6 deletions portal-impl/src/portal.properties
Expand Up @@ -6517,12 +6517,6 @@
## Module Framework
##

#
# Set this property to true to enable the module framework. Set this to
# false for compatibility with older application servers.
#
module.framework.enabled=false

#
# Set the module framework beginning start level. The module framework will
# proceed to this start level before the Spring context is initialized.
Expand Down
Expand Up @@ -1603,8 +1603,6 @@ public interface PropsKeys {

public static final String MODULE_FRAMEWORK_BEGINNING_START_LEVEL = "module.framework.beginning.start.level";

public static final String MODULE_FRAMEWORK_ENABLED = "module.framework.enabled";

public static final String MODULE_FRAMEWORK_INITIAL_BUNDLES = "module.framework.initial.bundles";

public static final String MODULE_FRAMEWORK_PORTAL_DIR = "module.framework.portal.dir";
Expand Down