From: <aft...@us...> - 2007-06-08 18:56:32
|
Revision: 4278 http://svn.sourceforge.net/smartfrog/?rev=4278&view=rev Author: aftereight Date: 2007-06-08 11:56:26 -0700 (Fri, 08 Jun 2007) Log Message: ----------- start/uninstall/install/start works again, but weirder ClassCastException with user bundles Modified Paths: -------------- branches/core-branch-osgi/extras/osgi/daemon-bundle/META-INF/MANIFEST.MF branches/core-branch-osgi/extras/osgi/daemon-bundle/src/org/smartfrog/osgi/SmartFrogActivator.java branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/security/SFClassLoader.java Modified: branches/core-branch-osgi/extras/osgi/daemon-bundle/META-INF/MANIFEST.MF =================================================================== --- branches/core-branch-osgi/extras/osgi/daemon-bundle/META-INF/MANIFEST.MF 2007-06-08 18:35:03 UTC (rev 4277) +++ branches/core-branch-osgi/extras/osgi/daemon-bundle/META-INF/MANIFEST.MF 2007-06-08 18:56:26 UTC (rev 4278) @@ -11,9 +11,10 @@ sfCoreSecurity-3.10.051dev.jar, . Bundle-Activator: org.smartfrog.osgi.SmartFrogActivator +Import-Package: org.osgi.framework, + org.osgi.service.log; resolution:=optional, + org.smartfrog.sfcore.security.rmispi; version=1.0.0 DynamicImport-Package: * -Import-Package: org.osgi.framework, - org.osgi.service.log; resolution:=optional Export-Package: org.smartfrog.sfcore; version=1.0.0, org.smartfrog.sfcore.prim; version=1.0.0, org.smartfrog.sfcore.common; version=1.0.0, Modified: branches/core-branch-osgi/extras/osgi/daemon-bundle/src/org/smartfrog/osgi/SmartFrogActivator.java =================================================================== --- branches/core-branch-osgi/extras/osgi/daemon-bundle/src/org/smartfrog/osgi/SmartFrogActivator.java 2007-06-08 18:35:03 UTC (rev 4277) +++ branches/core-branch-osgi/extras/osgi/daemon-bundle/src/org/smartfrog/osgi/SmartFrogActivator.java 2007-06-08 18:56:26 UTC (rev 4278) @@ -47,12 +47,13 @@ // Not needed in Equinox as it deals with this nicely : // http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements // Needed in Knopflerfish, not checked in Felix -// -// debug("Setting the thread context CL to bundle's CL."); -// -// ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); -// Thread.currentThread().setContextClassLoader(bundleCL); +// Seems to be needed even in Eclipse after all : start / uninstall / install / start +// doesn't work without it. + debug("Setting the current thread context CL to the bundle's CL."); + ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(bundleCL); + rootProcess = SFSystem.runSmartFrog(); rootProcess.vmExitOnTermination(false); rootProcess.sfAddAttribute(SmartFrogCoreKeys.SF_CORE_BUNDLE_CONTEXT, bundleContext); @@ -60,7 +61,7 @@ info("SmartFrog daemon running..."); releaseLogService(bundleContext); -// Thread.currentThread().setContextClassLoader(oldClassLoader); + Thread.currentThread().setContextClassLoader(oldClassLoader); } private void printClassLoaderHierarchy(final ClassLoader bundleCL) { Modified: branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/security/SFClassLoader.java =================================================================== --- branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/security/SFClassLoader.java 2007-06-08 18:35:03 UTC (rev 4277) +++ branches/core-branch-osgi/smartfrog/src/org/smartfrog/sfcore/security/SFClassLoader.java 2007-06-08 18:56:26 UTC (rev 4278) @@ -392,7 +392,7 @@ //First, try the thread context class loader result = opHelperWithReporting(name, null, isForName, msg); - if (debug != null) {if (result!=null) debug.println(" - Using thread context class loader");}; + if (debug != null) {if (result!=null) debug.println(" - Using thread context class loader");} // Second try the default codebase (if enabled) if (result==null && (useDefaultCodebase) && (getTargetClassBase() != null)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |