-
1. Re: Using sockets from JBoss AS?
mbrowne Nov 30, 2010 7:53 PM (in response to mbrowne)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.
Thanks
-
2. Re: Using sockets from JBoss AS?
ron_sigal Dec 14, 2010 5:32 PM (in response to mbrowne)Hi Matthew,
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?
-Ron
-
3. Re: Using sockets from JBoss AS?
mbrowne Dec 14, 2010 5:53 PM (in response to ron_sigal)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);
remotingClient.connect();
And this is how I'm sending the invocation (request is just a simple DTO object):
remotingClient.invoke(request, null);
Could this maybe have something to do with the Seam framework?
Thanks so much,
Matt
-
4. Re: Using sockets from JBoss AS?
mbrowne Jan 1, 2011 8:47 PM (in response to mbrowne)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.