Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Tomcat - JSP/Servlet container
Struts - A MVC web framework
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
JSP - A mailing list about Java Server Pages specification and reference
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
- Remote JMS connection over NAT 'ed IP

- Remote JMS connection over NAT 'ed IP

2007-07-17       - By swatkat1976

 Back
Hi,

I am trying to connect to a remote JMS queue from my JBoss Server 4.0.3SP1 and
using JBossMQ. The other server also hosts JBossMQ.

The machines involved and their IPs are as below:

The client Machine:
Name: XYZ
Config: JBoss Server 4.0.3SP1
Network IP: 122.xx.xx.xx {Say Network MC)

The host machine:
Name: ABC
JBoss Server 4.0.2
Network IP: 60.23.xx.xx {Say Network JS}
JMS Config: JBossMQ and is configured with HAJNDI on port 1100

Connection from Machine ABC to XYZ:

Method: VPN
Host IP: 122.xx.xx.xx {Network MC}
NAT'ed IP: 172.xx.xx.xxx {NATIP}, this IP has port mapping to
Final Destination IP 60.23.xx.xx {Network JS}
Ports Mapped: 1100 and 1099,

I can ping,telnet and access Network JS from Network MC through NATIP

Remote host hajndi-jms-ds.xml file


 |   <mbean code="org.jboss.jms.jndi.JMSProviderLoader Source code of org.jboss.jms.jndi.JMSProviderLoader"
 |   name="jboss.mq:service=JMSProviderLoader,name=HAJNDIJMSProvider">
 |     <attribute name="ProviderName">DefaultJMSProvider</attribute>
 |     <attribute name="ProviderAdapterClass">
 |       org.jboss.jms.jndi.JNDIProviderAdapter
 |     </attribute>
 |     <!-- The combined connection factory -->
 |     <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
 |     <!-- The queue connection factory -->
 |     <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
 |     <!-- The topic factory -->
 |     <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
 |     <!-- Access JMS via HAJNDI -->
 |     <attribute name="Properties">
 |        java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
 |        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
 |        java.naming.provider.url=<someObscureServer>.com:1100
 |     </attribute>
 |   </mbean>



Remote JNDIView Output: using NAT'ed IP http://172.xx.xx.xxx:8080/jmx-console
/HtmlAdaptor

java: Namespace
 |   +- JmsXA
 |   +- ConnectionFactory
 |   +- DefaultJMSProvider
 |   +- XAConnectionFactory
 |
 | Global JNDI Namespace
 |   +- ConnectionFactory
 |   +- HTTPConnectionFactory
 |   +- XAConnectionFactory
 |   +- UILXAConnectionFactory[link -> XAConnectionFactory]
 |   +- UIL2XAConnectionFactory[link -> XAConnectionFactory]
 |   +- UIL2ConnectionFactory[link -> ConnectionFactory]
 |   +- UILConnectionFactory[link -> ConnectionFactory]
 |   +- queue
 |   |   +- A
 |   |   +- DataFeed
 |
I have made various attempts to connect to remote JNDI using the configurations
below
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Trial 1 JMS Provider on port 1100

jms-ds.xml


 | <mbean code="org.jboss.jms.jndi.JMSProviderLoader Source code of org.jboss.jms.jndi.JMSProviderLoader" name="jboss.mq:service
=JMSProviderLoader,name=RemoteJMSProvider,server=RemoteSite">
 | <attribute name="ProviderName">RemoteSiteJMSProvider</attribute>
 | <attribute name="ProviderAdapterClass">org.jboss.jms.jndi
.JNDIProviderAdapter</attribute>
 | <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
 | <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
 | <attribute name="Properties">
 |   java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
 |   java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
 |   java.naming.provider.url=172.xx.xx.xxx:1100
 | </attribute>
 | </mbean>
 | <tx-connection-factory>
 |    <jndi-name>JSTJmsXA</jndi-name>
 |    <rar-name>jms-ra.rar</rar-name>
 |    <connection-definition>org.jboss.resource.adapter.jms
.JmsConnectionFactory</connection-definition>
 |    <config-property name="SessionDefaultType" type="java.lang.String Source code of java.lang.String">javax
.jms.Queue</config-property>
 |    <config-property name="JmsProviderAdapterJNDI" type="java.lang.String Source code of java.lang.String"
>java:/RemoteSiteJMSProvider</config-property>
 | </tx-connection-factory>
 |
 |

Java Code: (Standalone Java Client)

properties.put("java.naming.factory.initial","org.jnp.interfaces
.NamingContextFactory");
 | properties.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp
.interfaces");
 | properties.put("java.naming.provider.url","jnp://localhost:1099");
 | initialContext = new InitialContext(properties);
 |
 | queueConFac = (QueueConnectionFactory) initialContext.lookup("JSTJmsXA");
 |
 |

Result:

javax.naming.NameNotFoundException Source code of javax.naming.NameNotFoundException: JSTJmsXA not bound

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Trial 2 External Context on port 1100

jms-ds.xml

<mbean code="org.jboss.naming.ExternalContext Source code of org.jboss.naming.ExternalContext" name="jboss.jndi:service
=ExternalContext,jndiName=jstRemoteJNDI">
 | <attribute name="JndiName">jstRemoteJNDI</attribute>
 | <attribute name="Properties">
 |   java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
 |   java.naming.factory.url.pkgs=org.jnp.interfaces
 |   java.naming.provider.url=172.xx.xx.xxx:1100
 | </attribute>
 |     <attribute name="InitialContext">javax.naming.InitialContext Source code of javax.naming.InitialContext</attribute>
 |     <attribute name="RemoteAccess">true</attribute>
 | <depends>jboss:service=Naming</depends>
 | </mbean>
 |
JNDIView Output:

Global JNDI Namespace

 |  +- jstRemoteJNDI
 | error while listing context javax.naming.InitialContext@(protected): javax
.naming.CommunicationException [Root exception is java.rmi.RemoteException Source code of java.rmi.RemoteException.html>java.rmi.RemoteException Source code of java.rmi.RemoteException java.rmi.RemoteException Source code of java.rmi.RemoteException.java.html>Source code of <a href=http://www.docjar.com/docs/api/java/rmi/RemoteException.html>java.rmi.RemoteException</a> <a href=http://www.docjar.com/html/api/java/rmi/RemoteException.java.html><img src=/j.gif alt=' border=0>:
Service unavailable.]javax.naming.CommunicationException [Root exception is
java.rmi.RemoteException Source code of java.rmi.RemoteException.html>java.rmi.RemoteException Source code of java.rmi.RemoteException java.rmi.RemoteException Source code of java.rmi.RemoteException.java.html>Source code of <a href=http://www.docjar.com/docs/api/java/rmi/RemoteException.html>java.rmi.RemoteException</a> <a href=http://www.docjar.com/html/api/java/rmi/RemoteException.java.html><img src=/j.gif alt=' border=0>: Service unavailable.]
 |   at org.jnp.interfaces.NamingContext Source code of org.jnp.interfaces.NamingContext(NamingContext.java:797)
 |
 |
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Trial 3 External Context on port 1099

jms-ds.xml

<mbean code="org.jboss.naming.ExternalContext Source code of org.jboss.naming.ExternalContext" name="jboss.jndi:service
=ExternalContext,jndiName=jstRemoteJNDI">
 | <attribute name="JndiName">jstRemoteJNDI</attribute>
 | <attribute name="Properties">
 |   java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
 |   java.naming.factory.url.pkgs=org.jnp.interfaces
 |   java.naming.provider.url=172.xx.xx.xxx:1099
 | </attribute>
 |     <attribute name="InitialContext">javax.naming.InitialContext Source code of javax.naming.InitialContext</attribute>
 |     <attribute name="RemoteAccess">true</attribute>
 | <depends>jboss:service=Naming</depends>
 | </mbean>

JNDIView Output: {Connection refused to actual Remote IP instead of NAT'ed IP

 |   +- jstRemoteJNDI
 | error while listing context javax.naming.InitialContext@(protected): javax
.naming.CommunicationException [Root exception is java.rmi.ConnectException Source code of java.rmi.ConnectException:
Connection refused to host: 60.23.xx.xx; nested exception is:
 |   java.net.ConnectException Source code of java.net.ConnectException: Connection refused: connect

I have referred to the postings below but have not been able to figure out the
problem yet.
http://wiki.jboss.org/wiki/Wiki.jsp?page
=HowDoIConfigureTheJMSResourceAdapterToUseARemoteConnectionFactory
http://wiki.jboss.org/wiki/Wiki.jsp?page
=HowDoIConfigureAnMDBToTalkToARemoteQueue
http://www.jboss.org/wiki/Wiki.jsp?page=JBossNS
http://www.jboss.org/wiki/Wiki.jsp?page=JBossNSFAQ

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic
&p=4065064#4065064

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode
=reply&p=4065064
__ ____ ____ ____ ____ ____ ____ ____ ____ ____
jboss-user mailing list
jboss-user@(protected)
https://lists.jboss.org/mailman/listinfo/jboss-user

©2008 junlu.com - Jax Systems, LLC, U.S.A.