Skip to content

Commit

Permalink
Merge pull request #576 from pdudits/fish-5955-e
Browse files Browse the repository at this point in the history
FISH-5955: Support for ext/lib
  • Loading branch information
pdudits committed Apr 27, 2022
2 parents 80d0f6f + 16ac64e commit 70b571f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ public abstract class GFLauncher {

private static final Pattern JAVA_VERSION_PATTERN = Pattern.compile(".* version \"([^\"\\-]+)(-.*)?\".*");
private final List<String> commandLine = new ArrayList<String>();
private final List<String> jvmOptionsList = new ArrayList<String>();
private final GFLauncherInfo info;
private Map<String, String> asenvProps;
private JavaConfig javaConfig;
Expand Down Expand Up @@ -227,7 +226,6 @@ public void setup() throws GFLauncherException, MiniXmlParserException {
GFLauncherLogger.addLogFileHandler(logFilename);
setClasspath();
setCommandLine();
setJvmOptions();
logCommandLine();
checkJDKVersion();
// if no <network-config> element, we need to upgrade this domain
Expand Down Expand Up @@ -689,22 +687,12 @@ void setCommandLine() throws GFLauncherException {
}
}

void setJvmOptions() {
List<String> jvmOpts = getJvmOptions();
jvmOpts.clear();

if (jvmOptions != null) {
addIgnoreNull(jvmOpts, jvmOptions.toStringArray());
}

}

/**
* Returns the Java Virtual Machine options
* Returns the Java Virtual Machine options (for testing)
* @return
*/
public final List<String> getJvmOptions() {
return jvmOptionsList;
List<String> getJvmOptions() {
return jvmOptions.toStringArray();
}

/**
Expand Down Expand Up @@ -828,9 +816,16 @@ void setClasspath() throws GFLauncherException {
List<File> prefixCP = javaConfig.getPrefixClasspath();
List<File> suffixCP = javaConfig.getSuffixClasspath();
List<File> profilerCP = profiler.getClasspath();
List<File> extCP = Collections.emptyList();
if (!jvmOptions.getCombinedMap().containsKey("java.ext.dirs")) {
extCP = Collections.singletonList(
new File(info.getInstanceRootDir(), "lib/ext/*")
);
}

// create a list of all the classpath pieces in the right order
List<File> all = new ArrayList<File>();
all.addAll(extCP);
all.addAll(prefixCP);
all.addAll(profilerCP);
all.addAll(mainCP);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ private ClassLoader getExtensionClassLoader() {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
return ClassLoader.getSystemClassLoader().getParent();
return ClassLoader.getSystemClassLoader();
}
});
} else {
return ClassLoader.getSystemClassLoader().getParent();
return ClassLoader.getSystemClassLoader();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ extra-system-packages=${jre-${java.specification.version}}, org.glassfish.embedd
# Although Eclipselink imports these packages, in typical GlassFish installation,
# Oracle JDBC driver may not be available as a bundle, so we ask user to install it in
# java.ext.dirs and the bootdelegation helps there.
eclipselink.bootdelegation=oracle.sql, oracle.sql.*
eclipselink.bootdelegation=oracle.sql, oracle.sql.*,oracle.jdbc, oracle.jdbc.*

# There is no need to use bootdelegation except for the following issues:
# 1. EclipseLink
Expand All @@ -113,10 +113,11 @@ org.osgi.framework.bootdelegation=${eclipselink.bootdelegation}, \
org.netbeans.lib.profiler, org.netbeans.lib.profiler.*

# The OSGi R4.2 spec says boot delegation uses the boot class loader by default. We need
# to configure it to use the framework class loader because that class loader is
# configured with extra classes like jdk tools.jar, derby jars, etc. that must be
# made available in GlassFish to work.
org.osgi.framework.bundle.parent=framework
# to configure it to use the application class loader by default so we have access to
# classes and resources on the system class path. From those classes and resources, only those
# that reside in packages listed in bootdelegation will be exposed, others will not be visible by
# OSGi bundles.
org.osgi.framework.bundle.parent=app

# We don't set this value here, as expanding GlassFish_Platform gives us a file name with upper case
# char in it. GlassFish file layout does not recommend use of upper case char, because some
Expand Down

0 comments on commit 70b571f

Please sign in to comment.