Details
-
Bug
-
Status: Open
-
Normal
-
Resolution: Unresolved
-
12.6.9
-
None
-
None
-
0.5
Description
As reported on the community list:
it cant serialize files in version 1.0.2.
java.lang.NullPointerException: null [INFO] [talledLocalContainer] at org.onehippo.cm.model.serializer.SourceSerializer.serializeResourceValue(SourceSerializer.java:381) ~[hippo-configuration-management-model-1.0.2.jar:1.0.2] [INFO] [talledLocalContainer] at org.onehippo.cm.model.serializer.SourceSerializer.representNamespaceDefinition(SourceSerializer.java:366) ~[hippo-configuration-management-model-1.0.2.jar:1.0.2] [INFO] [talledLocalContainer] at org.onehippo.cm.model.serializer.SourceSerializer.representSource(SourceSerializer.java:88) ~[hippo-configuration-management-model-1.0.2.jar:1.0.2] [INFO] [talledLocalContainer] at org.onehippo.cm.engine.autoexport.EventJournalProcessor.createChangesModule(EventJournalProcessor.java:551) ~[hippo-repository-engine-5.0.2.jar:5.0.2] [INFO] [talledLocalContainer] at org.onehippo.cm.engine.autoexport.EventJournalProcessor.processEvents(EventJournalProcessor.java:356) ~[hippo-repository-engine-5.0.2.jar:5.0.2] [INFO] [talledLocalContainer] at org.onehippo.cm.engine.autoexport.EventJournalProcessor.tryProcessEvents(EventJournalProcessor.java:253) ~[hippo-repository-engine-5.0.2.jar:5.0.2] [INFO] [talledLocalContainer] at org.onehippo.cm.engine.autoexport.EventJournalProcessor.lambda$new$0(EventJournalProcessor.java:127) ~[hippo-repository-engine-5.0.2.jar:5.0.2] [INFO] [talledLocalContainer] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_121] [INFO] [talledLocalContainer] at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_121] [INFO] [talledLocalContainer] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_121] [INFO] [talledLocalContainer] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_121] [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121] [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121] [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
This happens because the module context is null:
protected void serializeResourceValue(ValueImpl value) { this.moduleContext.serializeResourceValue(this.source, value); //this.moduleContext is null }
This is null, because its initialized with null at EventJournalProcessor (hippo-repository-engine-5.0.2):
if (log.isInfoEnabled()) { SourceSerializer sourceSerializer = new SourceSerializer((ModuleContext)null, configSource, false); //this initialized it with null StringWriter writer = new StringWriter(); sourceSerializer.serializeNode(writer, sourceSerializer.representSource()); log.info("Computed diff: \n{}", writer.toString()); log.info("added content: \n\t{}", String.join("\n\t", addedContent)); log.info("changed content: \n\t{}", String.join("\n\t", this.pendingChanges.getChangedContent())); log.info("deleted content: \n\t{}", String.join("\n\t", deletedContent)); }