Skip to content
  • Our Product
    • Namazu Elements
      • What is Elements?
      • Why open source?
      • Docs
        • Namazu Elements in Five Minutes or Less
        • RESTful APIs Library
        • Security Model
        • Accessing the Web UI (CMS)

    Our Product

    A logomark with three layered rhombuses adorning the lettermark that says Elements in bold all-caps sans-serif letters.
    • What is Namazu Elements? Discover our easy-to-use backend network solution built for online games. Rapidly enables full-scale multiplayer games or online solo adventures.
    • Why open source? Is there a truly open source server backend for connected games? There is now. Download and run a local copy of Namazu Elements and try it for yourself.
    Download Namazu Elements

    Get started

    • Quick start Read our Elements 5-minute quick start guide
    • Documentation Read our developer docs for learning more about Elements
    • RESTful APIs A full list of core API specs for working with the Elements framework
    • Security An overview of the server-authoritative security model of Elements
    • Accessing the CMS Manage your game with ease via the Namazu Elements CMS.

    Co-development Reimagined

    • Best real-time game backends in 2026 If you're researching an alternative to your current backend solution, we've prepared a report of all of the backend solutions on the market in 2026 and how Namazu Elements compares.
      Co-dev

    Recent Posts

    • The watercolor-styled Namazu Studios logo over a giant namazu lurking in the depth
      Namazu Studios Featured in San Diego Business Journal
      22 Sep 2025 Press
    • Namazu Elements 3.1 Released – Service Layer Fixes, Secure APIs, and Steam Bug Fix
      22 Apr 2025 Release Notes
  • Case Studies
  • About Us
  • News
  • Services
  • Book a call
namazu-studios-logo
Book a call

Getting Started

  • Namazu Elements in Five Minutes or Less
  • Accessing the Web UI (CMS)
  • CMS Feature Overview

Fundamentals

  • Why You Need a Server (and What “Authoritative” Means)
  • Elements as a Game Runtime
  • Where Your Authoritative Code Runs
  • Lifecycles and Flows

General Concepts

  • Overview
  • Custom Elements
  • Data Models
  • Security Model
  • N-Tier Architecture

Namazu Elements Core Features

  • User Authentication / Sign In
    • What is a User?
    • User Authentication in Elements
    • Email Verification
    • Auth Schemes
      • Auth Schemes
      • OAuth2
      • OIDC
  • Features
    • Applications
    • Sessions
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Progress and Missions (3.4+)
    • Leaderboards
    • Matchmaking – Comprehensive Guide
    • Followers
    • Friends
    • Product Bundles and SKUs
    • Receipts
    • Item Ledger
    • Reward Issuances
    • Save Data
    • Metadata
    • Metadata (3.4+)
    • Email Service
    • Queries
    • Web3
      • Wallets
      • Vaults
      • Omni Chain Support
      • Smart Contracts
        • Smart Contracts
  • Queries
    • Advanced Operators
    • Object Graph Navigation
    • Boolean Queries
    • Base Query Syntax
  • Advanced Operators
    • .name
    • .ref

Your Game Code - Adding Custom Elements

  • Custom Code Overview
  • Windows Setup
  • Mac OS Setup
  • Ubuntu Linux Setup
  • Element Anatomy: A Technical Deep Dive
  • Introduction to Guice and Jakarta in Elements
  • Structuring your Element
  • Events
  • Packaging an Element with Maven
  • Deploying an Element
  • Preparing for code generation
  • Properties
  • Websockets
  • RESTful APIs
  • Direct MongoDB Access (3.5+)

Configuration

  • Matchmaking – Comprehensive Guide
  • Direct Database Access and Batch Configuration
  • Batch Samples
    • Mission Upload Bash Script Sample
    • Item Upload Bash Script Sample

RESTful APIs

  • Importing into Postman
  • RESTful APIs Library
  • Swagger and Swagger UI

Add-Ons

  • Crossplay
    • Namazu Crossfire (Multiplayer)
    • Deploying Namazu Crossfire in your game
  • Roblox
    • Roblox Overview
    • Secure Player Authentication & Registration
    • Global Matchmaking
    • Roblox Security Best Practices

Game Engine & Client Support

  • Unity
    • Elements Unity Plugin
    • Unity Crossfire Plugin

Troubleshooting

  • Common Issues with Docker
  • Local SDK
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Could not load class : java.lang.NoClassDefFoundError
  • Namazu Elements Community Edition
    • Common Issues with Docker
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Running in the IDE
      • Exception in monitor thread while connecting to server localhost:27017
      • Could not deployAvailableApplications Jetty server Failed to bind to /0.0.0.0:8080 Address already in use

Releases

  • 3.6 Release Notes
  • 3.5 Release Notes
  • 3.4 Release Notes
  • 3.3 Release Notes
  • 3.2 Release Notes
  • 3.1 Release Notes
View Categories
  • Home
  • Docs
  • Troubleshooting
  • Local SDK
  • Could not load class : java.lang.NoClassDefFoundError

Could not load class : java.lang.NoClassDefFoundError

Est. read time: 4 min read

When using the Local SDK, you will often times run into errors related to the ClassLaoder. A log will typically look like this. This article outlines a few causes and their solutions to this process.

java.lang.IllegalArgumentException: Could not load class dev.getelements.robloxkit.service.StandardRobloxAuthService : java.lang.NoClassDefFoundError: dev/getelements/robloxkit/RobloxAuthService
	at io.github.classgraph.ScanResult.loadClass(ScanResult.java:1459)
	at io.github.classgraph.ScanResultObject.loadClass(ScanResultObject.java:228)
	at io.github.classgraph.ScanResultObject.loadClass(ScanResultObject.java:252)
	at io.github.classgraph.FieldInfo.loadClassAndGetField(FieldInfo.java:260)
	at java.base/

Code is missing the @ElementPublic annotation. #

Any class, interface, or package that is exposed as a service (via the @ElementServiceExport annotation) must also be made public. There’s a few ways to do this.

Ensure All Related Types Are Public

The requirement to be public requires to the interface type itself as well as any types referenced within the interface.

Ensure that the package is annotated with ElementPublic #

☕
package-info.java
@ElementPublic
package com.example.mystudio.mygame;

import dev.getelements.elements.sdk.annotation.ElementPublic;

Ensure that the type is annotated with ElementPublic #

📄
filename.js
package com.example.mystudio.mygame;

import dev.getelements.elements.sdk.annotation.ElementPublic;

@ElementPublic
public interface MyInterface {

 void foo();

}

A Required Dependency is Missing #

Each Element must supply its own dependencies. This means that the Element must have included that dependency on the Classpath. Our example projects automate this process using the Maven Copy Dependencies Plugin and the local SDK expects those dependencies to be provided in target/element-libs relative to your project directory. The local SDK Maven runner will attempt to run Maven just before your code runs, but this may not always work correctly.

Check your pom.xml #

The pom should have a step to copy those dependencies in. The snippet in our example code ensures that only third-party code is included in that directory.

📄
pom.xml
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.0</version>
                <executions>
                    <execution>
                        <id>copy-element-deps</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <prependGroupId>true</prependGroupId>
                            <excludeScope>provided</excludeScope>
                            <excludeGroupIds>ch.qos.logback</excludeGroupIds>
                            <excludeArtifactIds>sdk-local,sdk-local-maven,sdk-logback</excludeArtifactIds>
                            <outputDirectory>${project.build.directory}/element-libs</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Typically, everything you need should appear in your IDE:

Jars need Installed #

Because we use Maven to organize the local SDK, it will always copy from the jars installed in your Local Maven Repository. In short a Maven Repository is a directory containing compiled Java code in an organized directory structure complete with version tagging. Just before your code runs, the LocalSDK copies pre-built code from that directory and copies it to your project. If you are running a project for the first time, you may have to manually build and install the code.

To do this quickly, execute the following command in the root of your project:

mvn -DskipTests clean install

This tells Maven to clean, build, and install all jars in your project to your local Maven Repository. The -DskipTests ensures that integration and unit tests do not run, saving time and allowing you to debug code that may not be currently passing tests.

Special Cases with OAS3 and MongoDB Drivers #

The Server does everything it can to avoid forcing its opinions on the Elements. In doing so there are some oddities and nuance required with certain situations. Specifically when dealing with the following libraries:

  • MongoDB Client Code
  • OpenAPI Annotations

To make some features work, we allow your code to inherit those opinions when necessary. We cover these cases here. In general, when using a type from the server, this must be done using the @ElementTypeRequest (3.7 and up) annotation. Additionally, you must ensure that the classpath entry is set to provided. This way the class does not appear in multiple places.

Future Proofing

This is not an exhaustive list. We do our best to keep this up to date. If you encounter these issues, please put them in the feedback section of this page, email us, or reach out in Discord so we can update.

Opinion: Using the Server’s MongoClient, MongoDatabase, or OpenAPI #

📄
pom.xml
<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver-core</artifactId>
    <scope>provided</provided>
</dependency>
<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver-sync</artifactId>
    <scope>provided</provided>
</dependency>

When you want to use the actual share connection with the database, you are inheriting the MongoClient from the Elements server core. To do so you must ensure that your pom does not include the jar on the classpath of the Element. You must ensure that it is included as a provided dependency.

☕
package-info.java
@ElementPublic
@ElementTypeRequest("com.mongodb.client.MongoClient")
package com.mystudio.mygame;

import dev.getelements.elements.sdk.annotation.ElementTypeRequest;

import dev.getelements.elements.sdk.annotation.ElementPublic;

These combined indicate htat because the scope is provided the jars do not get packed in the Element and the ElementTypeRequest indicates that they will be made available to your Element. In most cases, this is what you want.

Opinion: Providing your Own Types

If you wish to use your own types, you may do so by including the drivers in the compiled scope. This ensures you are able to include the code in the Element. If you do not set the scope, then these will not appears in the resulting bundle.

📄
pom.xml
<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver-core</artifactId>
    <scope>compile</provided>
</dependency>
<dependency>
    <groupId>org.mongodb</groupId>
    <artifactId>mongodb-driver-sync</artifactId>
    <scope>compile</provided>
</dependency>

Sharing Types

Do not add these types to your Element if you wish to return or hand the type with the server. You will likely get an instance of ClassCastExcpption for the same types. eg Cannoot cast com.mongodb.client.MongoDatabase to com.mongodb.client.MongoDatabase.

In most cases you do not want this, unless you have a particularly advanced use case.

What are your Feelings
Still stuck? How can we help?

How can we help?

Updated on March 18, 2026
Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundExceptionUnable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
Table of Contents
  • Code is missing the @ElementPublic annotation.
    • Ensure that the package is annotated with ElementPublic
    • Ensure that the type is annotated with ElementPublic
  • A Required Dependency is Missing
    • Check your pom.xml
  • Jars need Installed
  • Special Cases with OAS3 and MongoDB Drivers
    • Opinion: Using the Server's MongoClient, MongoDatabase, or OpenAPI
  • Documentation
  • Terms of Service
  • Privacy Policy
  • Contact us
  • Linkedin
  • Join our Discord

Namazu Studios LLC is powered by Namazu Elements, an open source modular backend framework for connected games.

Namazu Elements
  • Download
  • About Elements
  • Open source
  • Documentation
  • Support
Namazu Studios
  • Case Studies
  • About Us
  • News
Best realtime game backends 2026
Get in Touch
  • info@namazustudios.com
  • Book a call
  • (619) 862-2890
  • Linkedin
  • Discord

©2008-2026 Namazu Studios. All Rights Reserved.