This happens when the LocalSDK is not able to read the element’s code at all. This means that no code at all can be found and the loder is giving up entirely. Typically you see this error in the logs:
dev.getelements.elements.sdk.exception.SdkElementNotFoundException: null
at java.base/java.util.Optional.orElseThrow(Optional.java:403)
at dev.getelements.elements.sdk.local.internal.LocalApplicationElementService.doLoadElement(LocalApplicationElementService.java:102)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:722)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at dev.getelements.elements.sdk.local.internal.LocalApplicationElementService.lambda$getOrLoadApplication$1(LocalApplicationElementService.java:65)
Missing @ElementDefinition Annotation #
The annotation is missing. Add to your package-info.java
package-info.java
@ElementDefinition
package com.mystudio.mygame;
import dev.getelements.elements.sdk.annotation.ElementDefinition;
Check that the correct Element is Requested (Local SDK Only) #
The example Element using the LocalSDK uses a block of code to load. Make sure that you have specified the correct Element to load, or else you will see this error:
Main.java
// Create the local instance of the Elements server
final var local = ElementsLocalBuilder.getDefault()
.withElementNamed(
"example",
"com.mystudio.mygame",
PropertiesAttributes.wrap(elementProperties))
.build();
In this case, change the com.mystudio.mygame to the correct Package or Element where the @ElementDefinition exists.

