Niue + Red Dwarf Server

3 views
Skip to first unread message

Patrick Chapman

unread,
May 25, 2010, 5:27:27 AM5/25/10
to niue-...@googlegroups.com
I am trying to use Niue as a scripting engine in a Red Dwarf Server (RDS) program. When RDS receives a message from the client it calls: receivedMessage(ByteBuffer message)

When the message is '.program', receivedMessage executes the following lines of code:

try {
InputStream is = new ByteArrayInputStream(message.array());
PrintStream ps = new PrintStream(new ByteArrayOutputStream(), true);
Niue niue = new Niue(is, ps);
niue.run();
} catch (VmException ex) {
System.out.println(ex.getMessage());
}

... which generates the following warning message and continues:

WARNING: dropping a task that failed: com.sun.sgs.impl.service.session.ClientSessionHandler$2[NotifyListenerMessageReceived][owner:guest-153]
java.nio.ReadOnlyBufferException
at java.nio.ByteBuffer.array(ByteBuffer.java:942)
at org.pmc.server.pmud.Player.receivedMessage(Player.java:273)
,,,

Player.java line 273 is the second line of code above. Is Niue trying to write to the InputStream?

Any help on using Niue and RDS will be appreciated.


Message has been deleted

Patrick Chapman

unread,
May 27, 2010, 4:39:38 AM5/27/10
to niue-users
That was just what I needed. Now I have RDS calling the Niue VM and
returning the result (or error) to the client.

Thank you Vijay

Reply all
Reply to author
Forward
0 new messages