Skip to content

JSONException when trying to retrieve allocation info #83

@tomkeuper

Description

@tomkeuper

After creating a server using a ServerCreationAction I want to retrieve the allocation details and store the IP and Port number.
But when trying to get this data using the AplicationServer#retrieveDefaultAllocation() method I get the following error:

Exception in thread "Thread-7" org.json.JSONException: JSONObject["data"] not found.
	at org.json.JSONObject.get(JSONObject.java:570)
	at org.json.JSONObject.getJSONArray(JSONObject.java:763)
	at com.mattmalec.pterodactyl4j.application.entities.impl.ApplicationServerImpl.getAllocations(ApplicationServerImpl.java:116)
	at com.mattmalec.pterodactyl4j.application.entities.impl.ApplicationServerImpl.retrieveDefaultAllocation(ApplicationServerImpl.java:127)
	at com.fyreblox.democreator.DemoServer.lambda$setupServer$1(DemoServer.java:126)
	at java.lang.Thread.run(Thread.java:748)

The server has been created on the node and it does have allocation details:
image

The same error also appears when trying to use the AplicationServer#getAllocations() method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions