Community
Participate
Working Groups
Installing a configuration artifact after installing Pax Logging causes the thread that's monitoring the pickup directory to die, and it doesn't restart. Steps: 1) Extract Virgo Kernel 2.1.1 2) start 3) Install Pax Logging 1.6.2 via pickup directory. (First install the API, then the Service: http://wiki.ops4j.org/display/paxlogging/Pax+Logging+-+1.6.2) 4) touch pickup/foo.properties Result: java.lang.NoClassDefFoundError: org/osgi/service/log/LogService in the "fs-watcher" thread. Thereafter, no activity in the pickup directory is noticed until Virgo is restarted. Log excerpt follows. [2011-05-27 22:16:02.721] fs-watcher org.eclipse.virgo.medic.eventlog.default HD0001I Hot deployer processing 'CREATED' event for file 'foo.properties'. [2011-05-27 22:16:02.721] fs-watcher o.e.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener ApplicationDeploying path '/home/ryan/dev/tools/virgo-pax-logging-problem/pickup/foo.properties'. [2011-05-27 22:16:02.760] fs-watcher o.e.v.k.m.i.deployer.ModelInstallArtifactLifecycleListener Processing installing event for configuration 'foo' version '0.0.0' [2011-05-27 22:16:02.764] fs-watcher org.eclipse.virgo.medic.eventlog.default DE0000I Installing configuration 'foo' version '0.0.0'. [2011-05-27 22:16:02.765] fs-watcher o.e.virgo.kernel.userregion.internal.quasi.DependencyCalculator Calculating missing dependencies of bundle(s) '{}' [2011-05-27 22:16:02.768] fs-watcher o.e.virgo.kernel.userregion.internal.quasi.DependencyCalculator The dependencies of '[]' are '[]' [2011-05-27 22:16:02.773] fs-watcher org.eclipse.virgo.medic.eventlog.default DE0001I Installed configuration 'foo' version '0.0.0'. [2011-05-27 22:16:02.775] fs-watcher o.e.v.k.i.a.internal.AtomicInstallArtifactLifecycleListener No atomic parent of configuration 'foo' version '0.0.0' in scope 'null' to propagate starting event to [2011-05-27 22:16:02.779] fs-watcher org.eclipse.virgo.medic.eventlog.default DE0004I Starting configuration 'foo' version '0.0.0'. [2011-05-27 22:16:02.780] fs-watcher System.err Exception in thread "fs-watcher" java.lang.NoClassDefFoundError: org/osgi/service/log/LogService [2011-05-27 22:16:02.781] fs-watcher System.err at org.apache.felix.cm.impl.ConfigurationManager.log(ConfigurationManager.java:898) [2011-05-27 22:16:02.781] fs-watcher System.err at org.apache.felix.cm.impl.UpdateThread.schedule(UpdateThread.java:111) [2011-05-27 22:16:02.781] fs-watcher System.err at org.apache.felix.cm.impl.ConfigurationManager.updated(ConfigurationManager.java:571) [2011-05-27 22:16:02.781] fs-watcher System.err at org.apache.felix.cm.impl.ConfigurationImpl.update(ConfigurationImpl.java:317) [2011-05-27 22:16:02.781] fs-watcher System.err at org.apache.felix.cm.impl.ConfigurationAdapter.update(ConfigurationAdapter.java:110) [2011-05-27 22:16:02.781] fs-watcher System.err at org.eclipse.virgo.kernel.install.artifact.internal.ConfigLifecycleEngine.updateConfiguration(ConfigLifecycleEngine.java:64) [2011-05-27 22:16:02.781] fs-watcher System.err at org.eclipse.virgo.kernel.install.artifact.internal.ConfigLifecycleEngine.start(ConfigLifecycleEngine.java:40) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.install.artifact.internal.ConfigInstallArtifact.doStart(ConfigInstallArtifact.java:83) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.driveDoStart(AbstractInstallArtifact.java:203) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.start(AbstractInstallArtifact.java:194) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.start(PipelinedApplicationDeployer.java:285) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.deployer.core.internal.PipelinedApplicationDeployer.deploy(PipelinedApplicationDeployer.java:195) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener.deploy(HotDeploymentFileSystemListener.java:174) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.deployer.hot.HotDeploymentFileSystemListener.onChange(HotDeploymentFileSystemListener.java:78) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.util.io.FileSystemChecker.notifyListeners(FileSystemChecker.java:245) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.util.io.FileSystemChecker.check(FileSystemChecker.java:166) [2011-05-27 22:16:02.782] fs-watcher System.err at org.eclipse.virgo.kernel.deployer.hot.WatchTask.run(WatchTask.java:58) [2011-05-27 22:16:02.783] fs-watcher System.err at java.lang.Thread.run(Thread.java:662)
Pax logging registers a service with the following names: import org.osgi.service.log.LogService ... private static final String[] LOGSERVICE_NAMES = { LogService.class.getName(), org.knopflerfish.service.log.LogService.class.getName(), PaxLoggingService.class.getName(), ManagedService.class.getName() }; ... // register the Pax Logging service PaxLoggingServiceImpl paxLogging = new PaxLoggingServiceImpl( bundleContext, logReader, m_eventAdmin ); Hashtable serviceProperties = new Hashtable(); serviceProperties.put( Constants.SERVICE_ID, "org.ops4j.pax.logging.configuration" ); serviceProperties.put( Constants.SERVICE_PID, CONFIGURATION_PID ); m_RegistrationPaxLogging = bundleContext.registerService( LOGSERVICE_NAMES, paxLogging, serviceProperties ); It seems like "org.osgi.service.log.LogService" causes the NoClassDef.
The issue is not reproducible on 3.0M04, but on 2.1.1 (as reported) it can be reproduced on Windows and Linux even after restart (no -clean).
Updating Apache Felix ConfigAdmin to 1.2.8 fixed the problem
(In reply to comment #3) > Updating Apache Felix ConfigAdmin to 1.2.8 fixed the problem Cool. Would I replace the one in repository/ext, in lib/kernel, or both. I only generally know what ConfigAdmin is. Why is it both places? Also, it seems there should be some better exception handling around the fs-thread to keep it from dying on stray exceptions like this.
I replaced just the classes in ConfigAdmin JAR with the ones from 1.2.8, so I didn't have to adapt the bundle manifests. I guess that replacing the classes in both lib and repository/ext should provide you with a quick workaround.
Please note that we have switched to Equinox Config Admin in the 3.0 line, which is presumably why the problem does not recreate there. I don't think there's much need to fix 2.1.x given that there is a relatively straightforward workaround. So perhaps we should use this bug to beef up the fs watcher thread exception handling, in which case we should change the bug title appropriately. Hristo: wdyt since the bug is currently yours?
The problem with the watcher thread seems to be that it handles only Exceptions, while we have Error here.
Commit 1f9341d18c38a798879a7f5d4ffcf2c46bc324de will no longer allow listeners to interrupt artifact scanning in FileSystemChecker
Commit 5813b337159873f5c6cea936f7279c2335dcedfd improves the exception handling of WatchTask
File system watcher thread is now better protected against exception/errors. The fix should appear in 3.0.0.M06, while for 2.1.1 one can workaround the issue by updating Apache Felix ConfigAdmin.