-
1. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
kconner Dec 21, 2010 9:11 AM (in response to uestc)The warning comes from the underlying remoting codebase used by messaging and is harmless. It is caused when the messaging client stops without cleanly closing its resources, this is the server letting you know that it has recognised this.
-
2. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
uestc Dec 21, 2010 10:04 AM (in response to kconner)as you said,I think my jar file configuration of the project is OK?
-
3. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
kconner Dec 21, 2010 10:10 AM (in response to uestc)The jar will be fine, you just need to close the connection in your client.
-
4. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
uestc Dec 21, 2010 10:49 AM (in response to kconner)the code is just as belows
public class SendJMSMessage {
QueueConnection conn;
QueueSession session;
Queue que;
public void setupConnection() throws JMSException, NamingException
{
Properties properties1 = new Properties();
properties1.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
properties1.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
InitialContext iniCtx = new InitialContext(properties1);Object tmp = iniCtx.lookup("ConnectionFactory");
QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
conn = qcf.createQueueConnection();
que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_Request_gw");
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
conn.start();
System.out.println("Connection Started");
}
public void stop() throws JMSException
{
conn.stop();
session.close();
conn.close();
}
public void sendAMessage(String msg) throws JMSException {
QueueSender send = session.createSender(que);
ObjectMessage tm = session.createObjectMessage(msg);
send.send(tm);
send.close();
}
public static void main(String args[]) throws Exception
{
SendJMSMessage sm = new SendJMSMessage();
sm.setupConnection();
sm.sendAMessage(args[0]);
sm.stop();
}
}you said I need to close the connection but there are code
sm.stop();
what should I do?
Kevin Conner 编写:
The jar will be fine, you just need to close the connection in your client.
-
5. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
kconner Dec 21, 2010 11:06 AM (in response to uestc)That code looks like it is from the helloworld quickstart and should be fine, assuming it completes normally. If you were to remove the following line then you would also see this issue in that quickstart.
conn.close();
-
6. Re: HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
uestc Dec 21, 2010 11:52 PM (in response to kconner)yeah the code is from the sample quickstart,what I wonder is that why the same code get the different result in the command line and the eclipse IDE?
-
7. HelloWorld example" Unable to send ping" problems withJBoss ESB Server4.9
lenolee Mar 31, 2011 4:06 AM (in response to uestc)I have the same problem,that confused me a long time.And the code conn.close(); exists.
Can anyone give me some help???