Hello guys, 

I am a newbie with JBoss but I manage to create a Topic and a client app
that will receive it, when I create the message for the topic my client app
works with no problem, now I created an applet that will received the
message by means of a separate class - thread , I am subscribing to the
topic (I have put traces ) but when I generate the message my applet
onMessage listener does not seems to receive the message..
if I have both my applet and the app runing at the same time only my app
works, 

I am using JBoss303 on a Win2000 machine, both appserver and applet are
local

thanks 

public class JmsClient_1 implements javax.jms.MessageListener {
.
.
.


Properties jndiProps = new Properties() ;
jndiProps.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory" ) ;
jndiProps.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces" ) ;
jndiProps.setProperty("java.naming.provider.url", "localhost:1099" ) ;

Context jndiContext = new InitialContext(jndiProps);

System.out.println(" the jndiContext is .."+ jndiContext.toString());

TopicConnectionFactory factory =
(TopicConnectionFactory)jndiContext.lookup("UILConnectionFactory");


System.out.println(" the factory is .."+ factory);

Topic topic = (Topic) jndiContext.lookup("topic/titan-TicketTopic");

System.out.println(" the topic is .."+ topic);

TopicConnection connect = factory.createTopicConnection();

System.out.println(" the CONNECT is .."+ connect);

TopicSession session =
connect.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

TopicSubscriber subscriber = session.createSubscriber(topic);

System.out.println(" the Subscriber is .."+ subscriber);

subscriber.setMessageListener(this);

System.out.println("Listening for messages on topic/titan-TicketTopic...");
connect.start();

.
.
}

public void onMessage(Message message) {
try {
TextMessage textMsg = (TextMessage)message;
String text = textMsg.getText();
String msgCorID = message.getJMSType() ;

System.out.println("\n RESERVATION RECEIVED:\n"+text +"\n CorrID : " +
msgCorID + "\n");

// thechatclient.SendMessage("Person1", "ChatMessage", "ellotext");

} catch(JMSException jmsE) {
jmsE.printStackTrace();
}
} 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to