<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JNDI Remote Queue over web service
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/haithamnor">Haitham Safi</a> in <i>JNDI and Naming</i> - <a href="https://community.jboss.org/message/805801#805801">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi everybody,,,</p><p>iI create a web service to send a message, for local queue on local PC (127.0.0.1) it is correcte  but  for remote queue (192.168.20.35) as same queue name on remote PC return <span style="color: #993300;"><strong>< D queue not bound></strong></span> <span style="text-decoration: underline;"><strong>Error </strong></span>:</p><p>i used jboss 4.2.3 + axis2 + with eclipse</p><p>Same configuration for queue and username,password on local and remote machines.</p><p>------------------------------------------------------------------------</p><p>package edu;</p><p>import java.io.IOException;<br/>import java.net.URISyntaxException;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>import java.util.Properties;</p><p>import javax.jms.Connection;<br/>import javax.jms.ConnectionFactory;<br/>import javax.jms.JMSException;<br/>import javax.jms.MessageProducer;<br/>import javax.jms.Session;<br/>import javax.jms.TextMessage;<br/>import javax.naming.Context;<br/>import javax.naming.InitialContext;<br/>import javax.naming.NamingException;<br/>import javax.servlet.ServletException;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>public class MessageWS<br/>{<br/>String body = "";<br/>   <br/>public String Send_Messages(String msg) throws ServletException, IOException, URISyntaxException {<br/>try<br/>    {<br/>  <br/>     Context init =MessageWS.getInitialContext();<br/>     javax.jms.Queue destination =        (javax.jms.Queue) init.lookup("queue/D");</p><p>          ConnectionFactory connectionFactory =   (ConnectionFactory) init.lookup("ConnectionFactory");<br/>          Connection connection = connectionFactory.createConnection("jone","pas123");//<br/>          Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);<br/>        </p><p>          MessageProducer producer = session.createProducer(destination);<br/>          Date date =new Date();<br/>          <br/>          TextMessage message = session.createTextMessage();<br/>          message.setText(msg);<br/>        <br/>          connection.start();<br/>        <br/>          producer.send(message);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>          body = message.getText();<br/>         <br/>          <br/>          session.close();<br/>          connection.close();</p><p>      } <br/>    catch (Exception e)<br/>      {<br/>          return(e.toString());<br/>      }</p><p>return body    ;</p><p>}</p><p>public static Context getInitialContext () throws JMSException,NamingException<br/>{<br/>  Properties prop = new Properties();<br/>     prop.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");<br/>  prop.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");<br/>  prop.setProperty("java.naming.provider.url", "192.168.20.35:1099);</p><p>  Context context = new InitialContext(prop);<br/>  <br/>  return context;<br/>}<br/>}</p><p>     i execute the code in side JAVA Application it was workini correct, but Through web service i got an error </p><p>So any idea or help?<span> :( </span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/805801#805801">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JNDI and Naming at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>