[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[p2-dev] java.lang.RuntimeException: Attempt to access stopped agent: org.eclipse.equinox.internal.p2.core.ProvisioningAgent@65fa65fa


I am using the IProvisioningAgentProvider.createAgent() and IProvisioningAgent.stop() APIs and I'm getting this exception:

java.lang.RuntimeException: Attempt to access stopped agent: org.eclipse.equinox.internal.p2.core.ProvisioningAgent@65fa65fa
        at org.eclipse.equinox.internal.p2.core.ProvisioningAgent.checkRunning(ProvisioningAgent.java:79)
        at org.eclipse.equinox.internal.p2.core.ProvisioningAgent.getService(ProvisioningAgent.java:45)
        at org.eclipse.equinox.internal.p2.engine.ProfilePreferences.doSave(ProfilePreferences.java:112)
        at org.eclipse.equinox.internal.p2.engine.ProfilePreferences$SaveJob.run(ProfilePreferences.java:49)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

The ProfilePreferences.save() method schedules a job with the IProvisioningAgent instance that I created and am stopping:

Thread [main] (Suspended (breakpoint at line 40 in ProfilePreferences$SaveJob))        
        ProfilePreferences$SaveJob.<init>(ProfilePreferences, IProvisioningAgent) line: 40        
        ProfilePreferences.save() line: 275        
        ProfilePreferences(EclipsePreferences).flush() line: 352        
        ProfilePreferences(EclipsePreferences).flush() line: 340        
        MetadataRepositoryManager(AbstractRepositoryManager<T>).saveToPreferences() line: 979        
        MetadataRepositoryManager(AbstractRepositoryManager<T>).remember(RepositoryInfo<T>, boolean) line: 839        
        MetadataRepositoryManager(AbstractRepositoryManager<T>).addRepository(URI, boolean, boolean) line: 167        
        MetadataRepositoryManager(AbstractRepositoryManager<T>).loadRepository(URI, IProgressMonitor, String, int) line: 639        
        MetadataRepositoryManager(AbstractRepositoryManager<T>).doCreateRepository(URI, String, String, Map<String,String>) line: 271        
        MetadataRepositoryManager.createRepository(URI, String, String, Map<String,String>) line: 41        

How can I safely stop an IProvisioningAgent  instance when there is a scheduled job that will access it?  Is this a bug?