The constraint solver/scopegraph context cannot be serialized, because it tries to serialize a org.apache.commons.vfs2.provider.local.LocalFile, which is not serializable. This causes the following exception after analyzing a project:

16:31:13 WARN  - Store context file:///Users/gohla/metaborg/repo/progrepr/lang/mod/mod.example/target/analysis/org.metaborg_mod_1.0.0-SNAPSHOT/scopegraph failed.
java.io.IOException: Context file could not be written.
	at org.metaborg.spoofax.core.context.scopegraph.AbstractScopeGraphContext.writeContext(AbstractScopeGraphContext.java:203) [benchmark.jar:na]
	at org.metaborg.spoofax.core.context.scopegraph.AbstractScopeGraphContext.persistState(AbstractScopeGraphContext.java:190) [benchmark.jar:na]
	at org.metaborg.spoofax.core.context.scopegraph.AbstractScopeGraphContext.persist(AbstractScopeGraphContext.java:101) [benchmark.jar:na]
	at org.metaborg.spoofax.core.context.scopegraph.MultiFileScopeGraphContext.persist(MultiFileScopeGraphContext.java:1) [benchmark.jar:na]
	at org.metaborg.core.build.Builder.analyze(Builder.java:368) [benchmark.jar:na]
	at org.metaborg.core.build.Builder.updateLanguageResources(Builder.java:256) [benchmark.jar:na]
	at org.metaborg.core.build.Builder.build(Builder.java:188) [benchmark.jar:na]
	at org.metaborg.core.processing.BlockingProcessor$1.call(BlockingProcessor.java:49) [benchmark.jar:na]
	at org.metaborg.core.processing.BlockingProcessor$1.call(BlockingProcessor.java:1) [benchmark.jar:na]
	at org.metaborg.core.processing.BlockingTask.schedule(BlockingTask.java:25) [benchmark.jar:na]
	at progrepr.benchmark.core.benchmark.run.BenchmarkRunner.run(BenchmarkRunner.java:51) [benchmark.jar:na]
	at progrepr.benchmark.core.benchmark.Benchmarker.benchmark(Benchmarker.java:51) [benchmark.jar:na]
	at progrepr.benchmark.jmh.benchmark.ExistingProjectBenchmark.analyze(ExistingProjectBenchmark.java:64) [benchmark.jar:na]
	at progrepr.benchmark.jmh.benchmark.generated.ExistingProjectBenchmark_analyze_jmhTest.analyze_avgt_jmhStub(ExistingProjectBenchmark_analyze_jmhTest.java:439) [benchmark.jar:na]
	at progrepr.benchmark.jmh.benchmark.generated.ExistingProjectBenchmark_analyze_jmhTest.analyze_AverageTime(ExistingProjectBenchmark_analyze_jmhTest.java:323) [benchmark.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
	at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:453) [benchmark.jar:na]
	at org.openjdk.jmh.runner.BenchmarkHandler$BenchmarkTask.call(BenchmarkHandler.java:437) [benchmark.jar:na]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_121]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
Caused by: java.io.NotSerializableException: org.apache.commons.vfs2.provider.local.LocalFile
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1378) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[na:1.8.0_121]
	at java.util.HashMap.internalWriteEntries(HashMap.java:1785) ~[na:1.8.0_121]
	at java.util.HashMap.writeObject(HashMap.java:1362) ~[na:1.8.0_121]
	at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1028) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1496) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) ~[na:1.8.0_121]
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) ~[na:1.8.0_121]
	at org.metaborg.spoofax.core.context.scopegraph.AbstractScopeGraphContext.writeContext(AbstractScopeGraphContext.java:201) [benchmark.jar:na]
	... 26 common frames omitted
Submitted by Gabriƫl Konat on 1 February 2017 at 16:32

On 22 March 2017 at 16:14 Hendrik van Antwerpen commented:

THis is fixed in recent builds.


On 22 March 2017 at 16:14 Hendrik van Antwerpen closed this issue.

Log in to post comments