JBoss not accepting external connections on port 1099
by Allan Kamau
Hi,
Am running JBoss-4.2.0.GA and it appears I am unable
to establish a connection from a client running
remotely.
A quite port scan (between port 1000 and 10000) using
'localhost' or '127.0.0.1' indicates an open port
1099. But a similar scan using 192.168.0.2 (the
computer's ip) reports the port 1099 closed.
How can I enable JBoss to listen on all the server's
IPs?
When I run the client locally and connect using
'localhost:1099' or '172.0.0.1:1099' the connection
succeeds, but when I provide the computer's ip
'192.168.0.2:1099' I get the printStackTrace() output
below
<error>
[java] javax.naming.CommunicationException: Could
not obtain connection to any of these urls:
jnp://192.168.0.2:1099 and discovery failed with
error: javax.naming.CommunicationException: Receive
timed out [Root exception is
java.net.SocketTimeoutException: Receive timed out]
[Root exception is
javax.naming.CommunicationException: Failed to connect
to server 192.168.0.2:1099 [Root exception is
javax.naming.ServiceUnavailableException: Failed to
connect to server 192.168.0.2:1099 [Root exception is
java.net.ConnectException: Connection refused]]]
[java] at
org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1414)
[java] at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:594)
[java] at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
[java] at
javax.naming.InitialContext.lookup(InitialContext.java:351)
</error>
Below is my client code
public static Context getInitialContext()
throws javax.naming.NamingException
{
InitialContext ctx=null;
try{
ctx = new InitialContext();
ctx.addToEnvironment("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
ctx.addToEnvironment("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
ctx.addToEnvironment(Context.PROVIDER_URL,
"jnp://192.168.0.2:1099");
/*
SimpleSession simpleSession =
(SimpleSession)ctx.lookup(SimpleSession.class.getName());
System.out.println(simpleSession.sayHello("EJB3"));
*/
}catch (NamingException e){
e.printStackTrace();
}
return ctx;
//return new javax.naming.InitialContext();
}
Allan.
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news
18 years, 11 months
[JBoss Messaging] - Re: Queue MessageCount - JMX Help
by mskonda
You can locate/create a Queue/TopicMBean by following method (from Kabutar):
| private void initDestinationInfo(String destName, String type)
| {
|
| try
| {
|
| mBeanServer = JMXUtil.getMBeanServer(ContextUtil.getContext());
|
| serverObjectName = new ObjectName(
| "jboss.messaging.destination:service=" + type + ",name="
| + destName);
| if (type.equalsIgnoreCase(Destination.QUEUE))
| {
|
| queueMBean = (QueueMBean) MBeanServerInvocationHandler
| .newProxyInstance(mBeanServer, serverObjectName,
| QueueMBean.class, false);
| setIsQueue(true);
|
| } else if (type.equalsIgnoreCase(Destination.TOPIC))
| {
|
| topicMBean = (TopicMBean) MBeanServerInvocationHandler
| .newProxyInstance(mBeanServer, serverObjectName,
| TopicMBean.class, false);
| setIsQueue(false);
| }
|
| } catch (NamingException e)
| {
| logger.warn("NamingException:" + e.getMessage());
| logger.error(e);
| } catch (Exception e)
| {
| logger.info("Exception:" + e.getMessage());
| logger.error(e);
| }
| }
|
Once you get the Queue/TopicMBean, all you have to do is to invoke approriate methods:
| qMBean.getMessageCount()
| qMBean.getConsumerCount()
| etc..
|
You get the idea, didn't you?
You can browse the above code in Kabutar:
http://kabutar.googlecode.com/svn/trunk/src/com/agilyx/kabutar/browser/jms/
Thanks
Madhu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048608#4048608
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048608
18 years, 11 months