Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java23
1 files changed, 16 insertions, 7 deletions
diff --git a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
index 612c4c1d8..abbcdd43a 100644
--- a/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
+++ b/bundles/org.eclipse.osgi/core/framework/org/eclipse/osgi/framework/internal/core/Framework.java
@@ -385,18 +385,17 @@ public class Framework implements EventDispatcher, EventPublisher {
// we assume a URL
url = new URL(propJavaProfile);
} catch (MalformedURLException e1) {
- // TODO consider logging ...
+ // try using a relative path in the system bundle
+ url = findInSystemBundle(propJavaProfile);
}
if (url == null && vmProfile != null) {
// look for a profile in the system bundle based on the vm profile
String javaProfile = vmProfile + ".profile"; //$NON-NLS-1$
- url = systemBundle.getEntry(javaProfile);
- if (url == null) {
- // Check the ClassLoader in case we're launched off the Java boot classpath
- ClassLoader loader=getClass().getClassLoader();
- url = loader==null ? ClassLoader.getSystemResource(javaProfile) : loader.getResource(javaProfile);
- }
+ url = findInSystemBundle(javaProfile);
}
+ if (url == null)
+ // the profile url is still null then use the osgi min profile in OSGi by default
+ url = findInSystemBundle("OSGi_Minimum-1.0.profile"); //$NON-NLS-1$
if (url != null) {
InputStream in = null;
try {
@@ -423,6 +422,16 @@ public class Framework implements EventDispatcher, EventPublisher {
return result;
}
+ private URL findInSystemBundle(String entry) {
+ URL result = systemBundle.getEntry(entry);
+ if (result == null) {
+ // Check the ClassLoader in case we're launched off the Java boot classpath
+ ClassLoader loader = getClass().getClassLoader();
+ result = loader == null ? ClassLoader.getSystemResource(entry) : loader.getResource(entry);
+ }
+ return result;
+ }
+
/**
* This method return the state of the framework.
*

Back to the top