Just wanted to try to simplify my question in the hope of a quick response from someone... is it possible to use JBoss Remoting with sockets from within JBoss AS, or does JBoss AS block raw sockets, requiring that you use a different protocol?
That way I can know whether troubleshooting the sockets issue is a waste of time... my issue here doesn't have much to do with the musical programming environment (MaxMSP) - I just mentioned that for context.
I'm not sure I understand the question "is it possible to use JBoss Remoting with sockets from within JBoss AS". But I'll try to answer anyway. When you wrote your standalone application, you created a Remoting server by creating an org.jboss.remoting.transport.Connector, right? Well, you can do the same thing by configuring the Connector declaratively in a file in $JBOSS_HOME/server/$CONFIG/deploy. The nature of your file will depend on the version of AS you are using.
I'm not aware of any socket blocking.
Hope that helps. Am I close?
Thanks for the response...
I was able to determine that the socket is in fact being created (by creating a SocketCreationListener), but that I'm getting the error when invoke() is called. I wasn't using a Connector but rather an InvokerLocator (see my code below).InvokerLocator locator = new InvokerLocator(maxMspUri);remotingClient = new Client(locator);remotingClient.connect();callbackServerConnector = new Connector();callbackServerConnector.setInvokerLocator(locator.getLocatorURI());callbackServerConnector.start(
The only thing I was able to find with respect to the "end of file" error message was this:
I don't really understand the versioning issues, and I'm just using the code from the manual...but that ticket does mention "unusable socket connections," so I'm guessing the socket connection I established is considered unusable for some reason?
I've tried using remoting-jboss-beans.xml for the configuration instead of doing programmatic configuration, but it doesn't seem to make any difference...then again, maybe I wasn't doing that part correctly.
My code is pretty simple; at this point I'd be happy to get any communication working at all from my Seam app using sockets. Here's my connection code:
InvokerLocator locator = new InvokerLocator(maxMspUri);
remotingClient = new Client(locator);
And this is how I'm sending the invocation (request is just a simple DTO object):
Could this maybe have something to do with the Seam framework?
Thanks so much,
I ended up using the Netty framework instead. It was simpler to get working since all I needed was to send simple DTOs over the network.
FYI, the only gotcha was that MaxMSP uses a special classloader, but fortunately Netty allows you to tell it what classloader to use when instantiating the ObjectDecoder object.