Skip to content

NullPointerException handling multiple connections. #11

@kikekr

Description

@kikekr

Hi,
When I try to establish more than one simultaneous connection to my llrp server the NioHandler launches a NullPointerException with the next message:

Error while processing network channel
java.lang.NullPointerException
	at net.enilink.llrp4j.net.NioServer.run(NioServer.java:80)
	at java.lang.Thread.run(Thread.java:745)

With only one connection it works properly. Is your class 'LlrpServer' currently multithread?
This is my endpoint implementation:

LlrpEndpoint() {

	@Override
	public void errorOccured(String arg0, Throwable arg1) {
		System.err.println(arg0);
		System.err.println(arg1.getMessage());
		arg1.printStackTrace();
	}

	@Override
	public void messageReceived(LlrpMessage message) {
		String messageName = message.getClass().getSimpleName(); 
		Class<?> responseType = message.getResponseType();
		LlrpMessage response = handleMessage(message);
		if (response != null) {
			server.send(response);
		}
	}
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions