[jboss-user] [Beginner's Corner] - JBOSS AS 6 M4 Issue: Can't connect remotely to HornetQ. Please help!!
Ahmad Siddiqi
do-not-reply at jboss.com
Fri Aug 13 19:11:19 EDT 2010
Ahmad Siddiqi [http://community.jboss.org/people/omarsiddiqi] created the discussion
"JBOSS AS 6 M4 Issue: Can't connect remotely to HornetQ. Please help!!"
To view the discussion, visit: http://community.jboss.org/message/557387#557387
--------------------------------------------------------------
I installed Jboss AS6 on my local machine and installed it as a windows service. The admin-console comes up fine and I can see everything setup correctly however I can't connect to the Queues via code from a remote computer although it works fine when i use localhost as my url. Following is the error that i'm getting
Error: javax.naming.CommunicationException: Could not obtain connection to any of these urls: 192.168.217.1:5445 and discovery failed with error: javax.naming.CommunicationException: Receive timed out Root exception is java.net.SocketTimeoutException: Receive timed outat org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1690)at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1761)at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:695)at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:688)at javax.naming.InitialContext.lookup(InitialContext.java:392)at HelloJms.runExample(HelloJms.java:51)at HelloJms.main(HelloJms.java:29) Caused by: java.net.SocketTimeoutException: Receive timed outat java.net.PlainDatagramSocketImpl.receive0(Native Method)at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java:136)at java.net.DatagramSocket.receive(DatagramSocket.java:725)at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1659)
After reviewing various blogs I realized that AS6 sets everything up for you by itself. For example it sets up the NettyConnectors and NettyAcceptors by default and uses port 5445 as the default. Even though I attached the hornetq-configuration.xml with the post I want to show a partial view of the hornetq-configuration.xml I have for connectors and acceptors.
My client is extremely simple and all im doing in the client is loading my properties, specifying the url and port and trying to get a queue as follows.
Connection connection = null;
InitialContext initialContext = null;
TransportConfiguration config = new TransportConfiguration();
Properties props = new Properties();
// I've tried all sorts of urls here
props.put(Context.PROVIDER_URL, "jnp://192.168.217.1:1099");
props.put(Context.PROVIDER_URL, "jnp://192.168.217.1:5445");
props.put(Context.PROVIDER_URL, "jnp://192.168.217.1:5445");
props.put(Context.PROVIDER_URL, "jnp://ahmads-pc3:5445");
props.put(Context.PROVIDER_URL, "jnp://ahmads-pc3.saccap.int:1099"); // fullname.
props.put(Context.PROVIDER_URL, "jnp://ahmads-pc3.saccap.int:5445"); // fullname.
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES, "java.naming.factory.url.pkgs");
initialContext = new InitialContext(props);
ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/557387#557387]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100813/5da65fca/attachment-0001.html
More information about the jboss-user
mailing list