Beginner question. How to connect to a remote openjms server.

"Gaze, Peter J" <[email protected]> Thu, 12 Jun 2008 11:25:31 +1000
Newsgroups gmane.comp.java.openjms.user
Message-ID <8469A3046777F14C9FA73601067616DD479C1880B7@WSMSG3101V.srv.dir.telstra.com>
--===============1836096399==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_8469A3046777F14C9FA73601067616DD479C1880B7WSMSG3101Vsrv_"

--_000_8469A3046777F14C9FA73601067616DD479C1880B7WSMSG3101Vsrv_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Should be pretty simple question.
I have openjms running on a remote server and am trying to connect to it as=
 a client.
The remote server is at 192.168.1.100:3035

Here is the relevant connecting code..

...
            System.out.println("about to create initialcontext");
            // create the JNDI initial context.
            Properties prop=3Dnew Properties();
            try
            {
               prop.load(new FileInputStream("jndi.properties"));
            }
            catch (Exception e)
            {
               e.printStackTrace();
            }
            context =3D new InitialContext(prop);

            // look up the ConnectionFactory
            System.out.println("about to lookup factoryname");
            factory =3D (ConnectionFactory) context.lookup(factoryName);

            // look up the Destination
            System.out.println("about to lookup destination name:"+destName=
);
            dest =3D (Destination) context.lookup(destName);

            // create the connection
            System.out.println("about to create connection to jms");
            connection =3D factory.createConnection();

--- the jndi.properties file is below...
#
# JNDI configuration file used by the OpenJMS examples
#
#
java.naming.factory.initial=3Dorg.exolab.jms.jndi.InitialContextFactory
java.naming.provider.url=3Dtcp://192.168.1.100:3035

--- here is the error..  It appears to be happening on the "context=3Dnew I=
nitialContext(prop)" line...  looks like its
Trying to connect using localhost instead of the ip address I have configur=
ed.

about to create initialcontext
javax.naming.ServiceUnavailableException: Failed to connect to 127.0.0.1:30=
35 [Root exception is org.exolab.jms.net.c
ector.ConnectException: Failed to connect to 127.0.0.1:3035]
        at org.exolab.jms.jndi.InitialContextFactory.getInitialContext(Init=
ialContextFactory.java:177)
        at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
        at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
        at javax.naming.InitialContext.init(Unknown Source)
        at javax.naming.InitialContext.<init>(Unknown Source)
        at Sender.main(Sender.java:111)
Caused by: org.exolab.jms.net.connector.ConnectException: Failed to connect=
 to 127.0.0.1:3035
        at org.exolab.jms.net.socket.SocketManagedConnection.createSocketPr=
otected(SocketManagedConnection.java:268)
        at org.exolab.jms.net.socket.SocketManagedConnection.createSocket(S=
ocketManagedConnection.java:182)
        at org.exolab.jms.net.socket.SocketManagedConnection.<init>(SocketM=
anagedConnection.java:114)
        at org.exolab.jms.net.tcp.TCPManagedConnection.<init>(TCPManagedCon=
nection.java:75)
        at org.exolab.jms.net.tcp.TCPManagedConnectionFactory.createManaged=
Connection(TCPManagedConnectionFactory.jav
8)
        at org.exolab.jms.net.connector.DefaultConnectionPool.createManaged=
Connection(DefaultConnectionPool.java:233)
        at org.exolab.jms.net.connector.AbstractConnectionManager.allocateC=
onnection(AbstractConnectionManager.java:1

        at org.exolab.jms.net.connector.AbstractConnectionFactory.getConnec=
tion(AbstractConnectionFactory.java:167)
        at org.exolab.jms.net.connector.AbstractConnectionManager.getConnec=
tion(AbstractConnectionManager.java:208)
        at org.exolab.jms.net.connector.AbstractConnectionManager.getConnec=
tion(AbstractConnectionManager.java:187)
        at org.exolab.jms.net.orb.UnicastDelegate.getConnection(UnicastDele=
gate.java:189)
        at org.exolab.jms.net.orb.UnicastDelegate.invoke(UnicastDelegate.ja=
va:153)
        at org.exolab.jms.net.proxy.Proxy.invoke(Proxy.java:102)
        at org.exolab.jms.server.net.RemoteNamingProvider__Proxy.getNamePar=
ser(RemoteNamingProvider__Proxy.java:71)
        at org.exolab.jms.jndi.InitialContextFactory.getInitialContext(Init=
ialContextFactory.java:173)

Any help is much appreciated.
Thanks
:)




--_000_8469A3046777F14C9FA73601067616DD479C1880B7WSMSG3101Vsrv_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Exchange Server">
<!-- converted from rtf -->
<style>.EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800=
000 2px solid; }</style>
</head>
<body>
<font face=3D"Arial, sans-serif" size=3D"2">
<div>Should be pretty simple question.</div>
<div>I have openjms running on a remote server and am trying to connect to =
it as a client.&nbsp; </div>
<div>The remote server is at 192.168.1.100:3035</div>
<div>&nbsp;</div>
<div>Here is the relevant connecting code..</div>
<div>&nbsp;</div>
<div>&#8230;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sys=
tem.out.println(&quot;about to create initialcontext&quot;);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // =
create the JNDI initial context.</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Pro=
perties prop=3Dnew Properties();</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try=
</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</=
div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; prop.load(new FileInputStream(&quot;jndi.properties&quot;));=
</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</=
div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cat=
ch (Exception e)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</=
div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp; e.printStackTrace();</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</=
div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con=
text =3D new InitialContext(prop);</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // =
look up the ConnectionFactory</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sys=
tem.out.println(&quot;about to lookup factoryname&quot;);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fac=
tory =3D (ConnectionFactory) context.lookup(factoryName);</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // =
look up the Destination</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sys=
tem.out.println(&quot;about to lookup destination name:&quot;&#43;destName)=
;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; des=
t =3D (Destination) context.lookup(destName);</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // =
create the connection</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sys=
tem.out.println(&quot;about to create connection to jms&quot;);</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con=
nection =3D factory.createConnection();</div>
<div>&nbsp;</div>
<div>--- the jndi.properties file is below&#8230;</div>
<div>#</div>
<div># JNDI configuration file used by the OpenJMS examples</div>
<div>#</div>
<div># </div>
<div>java.naming.factory.initial=3Dorg.exolab.jms.jndi.InitialContextFactor=
y</div>
<div>java.naming.provider.url=3Dtcp://192.168.1.100:3035</div>
<div>&nbsp;</div>
<div>--- here is the error..&nbsp; It appears to be happening on the &quot;=
context=3Dnew InitialContext(prop)&quot; line&#8230;&nbsp; looks like its <=
/div>
<div>Trying to connect using localhost instead of the ip address I have con=
figured.&nbsp; </div>
<div>&nbsp;</div>
<div>about to create initialcontext</div>
<div>javax.naming.ServiceUnavailableException: Failed to connect to 127.0.0=
.1:3035 [Root exception is org.exolab.jms.net.c</div>
<div>ector.ConnectException: Failed to connect to 127.0.0.1:3035]</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.jndi.Init=
ialContextFactory.getInitialContext(InitialContextFactory.java:177)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.naming.spi.NamingM=
anager.getInitialContext(Unknown Source)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.naming.InitialCont=
ext.getDefaultInitCtx(Unknown Source)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.naming.InitialCont=
ext.init(Unknown Source)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at javax.naming.InitialCont=
ext.&lt;init&gt;(Unknown Source)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at Sender.main(Sender.java:=
111)</div>
<div>Caused by: org.exolab.jms.net.connector.ConnectException: Failed to co=
nnect to 127.0.0.1:3035</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.socke=
t.SocketManagedConnection.createSocketProtected(SocketManagedConnection.jav=
a:268)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.socke=
t.SocketManagedConnection.createSocket(SocketManagedConnection.java:182)</d=
iv>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.socke=
t.SocketManagedConnection.&lt;init&gt;(SocketManagedConnection.java:114)</d=
iv>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.tcp.T=
CPManagedConnection.&lt;init&gt;(TCPManagedConnection.java:75)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.tcp.T=
CPManagedConnectionFactory.createManagedConnection(TCPManagedConnectionFact=
ory.jav</div>
<div>8)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.conne=
ctor.DefaultConnectionPool.createManagedConnection(DefaultConnectionPool.ja=
va:233)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.conne=
ctor.AbstractConnectionManager.allocateConnection(AbstractConnectionManager=
.java:1</div>
<div>&nbsp;</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.conne=
ctor.AbstractConnectionFactory.getConnection(AbstractConnectionFactory.java=
:167)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.conne=
ctor.AbstractConnectionManager.getConnection(AbstractConnectionManager.java=
:208)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.conne=
ctor.AbstractConnectionManager.getConnection(AbstractConnectionManager.java=
:187)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.orb.U=
nicastDelegate.getConnection(UnicastDelegate.java:189)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.orb.U=
nicastDelegate.invoke(UnicastDelegate.java:153)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.net.proxy=
.Proxy.invoke(Proxy.java:102)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.server.ne=
t.RemoteNamingProvider__Proxy.getNameParser(RemoteNamingProvider__Proxy.jav=
a:71)</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at org.exolab.jms.jndi.Init=
ialContextFactory.getInitialContext(InitialContextFactory.java:173)</div>
<div>&nbsp;</div>
<div>Any help is much appreciated.</div>
<div>Thanks</div>
<div>:)</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</font>
</body>
</html>

--_000_8469A3046777F14C9FA73601067616DD479C1880B7WSMSG3101Vsrv_--


--===============1836096399==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
--===============1836096399==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openjms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openjms-user

--===============1836096399==--