New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException trying to run any Orchid gradle task #123

Closed
robfletcher opened this Issue May 23, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@robfletcher
Copy link

robfletcher commented May 23, 2018

Following the quick start instructions I am unable to run any gradle orchid* task. It blows up with a NullPointerException.

[INFO] Orchid: Running Orchid version 0.8.5, site version unspecified in debug environment
[INFO] TaskServiceImpl: Build Starting...
[DEBUG] GeneratorServiceImpl: Indexing [10000: assets]
[DEBUG] GeneratorServiceImpl: Indexing [1000: home]
java.lang.NullPointerException
        at com.eden.orchid.impl.generators.HomepageGenerator.getHomepage(HomepageGenerator.java:62)
        at com.eden.orchid.impl.generators.HomepageGenerator.startIndexing(HomepageGenerator.java:31)
        at com.eden.orchid.api.generators.GeneratorServiceImpl.indexGenerator(GeneratorServiceImpl.java:131)
        at java.util.TreeMap$KeySpliterator.forEachRemaining(TreeMap.java:2746)
        at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
        at com.eden.orchid.api.generators.GeneratorServiceImpl.buildInternalIndex(GeneratorServiceImpl.java:115)
        at com.eden.orchid.api.generators.GeneratorServiceImpl.startIndexing(GeneratorServiceImpl.java:106)
        at com.eden.orchid.api.generators.GeneratorService.startIndexing(GeneratorService.java:15)
        at com.eden.orchid.api.tasks.TaskServiceImpl.build(TaskServiceImpl.java:172)
        at com.eden.orchid.api.tasks.TaskService.build(TaskService.java:26)
        at com.eden.orchid.impl.tasks.BuildTask.run(BuildTask.java:30)
        at com.eden.orchid.api.tasks.TaskServiceImpl.runTask(TaskServiceImpl.java:95)
        at com.eden.orchid.api.tasks.TaskServiceImpl.onPostStart(TaskServiceImpl.java:80)
        at java.util.HashMap$Values.forEach(HashMap.java:981)
        at com.eden.orchid.api.OrchidContextImpl.start(OrchidContextImpl.java:97)
        at com.eden.orchid.Orchid.start(Orchid.java:104)
        at com.eden.orchid.Orchid.start(Orchid.java:71)
        at com.eden.orchid.Orchid.main(Orchid.java:62)

It's not clear what I'm missing. Presumably something in this chain context.getSite().getSiteInfo().getSiteName(). I guess that might be because my config.yml is empty. But even when adding the basic configuration described later in the docs I still get the same error.

@cjbrooks12

This comment has been minimized.

Copy link
Member

cjbrooks12 commented May 23, 2018

Yup, it looks like a bug with the options extractor was making context.getSite().getSiteInfo() null when there was nothing in your config to populate it. I'll push out a fix tonight, but in the meantime, adding options for the siteName to your config.yml will ensure that it gets extracted properly.

site:
  about:
    siteName: Orchid

# or just 'site: {about: {}}' at a minimum to keep it from crashing

@cjbrooks12 cjbrooks12 closed this May 23, 2018

@cjbrooks12 cjbrooks12 reopened this May 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment