Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359294

Summary: NPE writing the state when weaving hooks are present
Product: [Eclipse Project] Equinox Reporter: Alasdair Nottingham <alasdair>
Component: FrameworkAssignee: Thomas Watson <tjwatson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tjwatson
Version: 3.7   
Target Milestone: Juno M3   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 359310    

Description Alasdair Nottingham CLA 2011-09-28 15:14:50 EDT
Build Identifier: org.eclipse.osgi_3.7.0.v20110613

Exception in thread "State Saver" java.lang.NullPointerException
        at org.eclipse.osgi.internal.resolver.StateWriter.writeImportPackageSpec(StateWriter.java:599)
        at org.eclipse.osgi.internal.resolver.StateWriter.writeStateWire(StateWriter.java:532)
        at org.eclipse.osgi.internal.resolver.StateWriter.writeList(StateWriter.java:521)
        at org.eclipse.osgi.internal.resolver.StateWriter.writeMap(StateWriter.java:490)
        at org.eclipse.osgi.internal.resolver.StateWriter.writeBundleDescriptionLazyData(StateWriter.java:344)
        at org.eclipse.osgi.internal.resolver.StateWriter.saveState(StateWriter.java:112)
        at org.eclipse.osgi.internal.resolver.StateObjectFactoryImpl.writeState(StateObjectFactoryImpl.java:439)
        at org.eclipse.osgi.internal.baseadaptor.StateManager.writeState(StateManager.java:178)
        at org.eclipse.osgi.internal.baseadaptor.StateManager.update(StateManager.java:116)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.saveStateData(BaseStorage.java:661)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage.saveAllData(BaseStorage.java:458)
        at org.eclipse.osgi.internal.baseadaptor.BaseStorage$StateSaver.run(BaseStorage.java:1304)
        at java.lang.Thread.run(Thread.java:680)

This doesn't seem to cause a huge issue but it causes unsightly worrying messages in log files

Reproducible: Sometimes

Steps to Reproduce:
I haven't been able to reliably introduce this. I've tried with a clean and dirty work area and I've tried several different methods. I can reproduce but not reliably.
Comment 1 Thomas Watson CLA 2011-09-28 16:43:22 EDT
The issue is that we are not reading the bundle wiring correctly from the resolver cache when dynamic imports are added and resolved from weaving hooks.
Comment 2 Thomas Watson CLA 2011-09-28 17:24:51 EDT
Fix and testcase release in the following commit:

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=2f1876381b370bff65fed6f35db1e4f24a17d881