X-Message-Info: JGTYoYF78jEHjJx36Oi8+Z3TmmkSEdPt4iogl2abg+M= Received: from mail.apache.org ([209.237.227.199]) by mc10-f1.hotmail.com with Microsoft SMTPSVC(6.0.3790.211); Thu, 28 Apr 2005 10:35:06 -0700 Received: (qmail 44206 invoked by uid 500); 28 Apr 2005 17:36:12 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 44115 invoked by uid 99); 28 Apr 2005 17:36:09 -0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=HTML_40_50,HTML_MESSAGE,MIME_HTML_ONLY,MSGID_FROM_MTA_HEADER X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of kaaresti@hotmail.com designates 65.54.175.15 as permitted sender) Received: from bay104-f5.bay104.hotmail.com (HELO hotmail.com) (65.54.175.15) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 28 Apr 2005 10:36:08 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 28 Apr 2005 10:34:56 -0700 Message-ID: Received: from 65.54.175.200 by by104fd.bay104.hotmail.msn.com with HTTP; Thu, 28 Apr 2005 17:34:56 GMT X-Originating-IP: [65.54.175.200] X-Originating-Email: [kaaresti@hotmail.com] X-Sender: kaaresti@hotmail.com From: "Katia Aresti Gonzalez" To: user@geronimo.apache.org Bcc: Subject: Geronimo and JMS Date: Thu, 28 Apr 2005 17:34:56 +0000 Mime-Version: 1.0 Content-Type: text/html; charset=iso-8859-1; format=flowed X-OriginalArrivalTime: 28 Apr 2005 17:34:56.0430 (UTC) FILETIME=[9813FCE0:01C54C18] X-Virus-Checked: Checked Return-Path: user-return-407-kaaresti=hotmail.com@geronimo.apache.org
Hi!!
 
Im writing a simple JMS application, and I have a little problem. I have done 2 classes, here is the source code:
 
import javax.jms.*;
import javax.naming.*;
public class EnviaPS{
 public static void main (String args[]){
      
  try {
   InitialContext ctx = new InitialContext();
   TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("java:comp/env/jms/ConnectionFactoryLocalTx");
   TopicConnection connection = tcf.createTopicConnection();
   Topic topic = (Topic)ctx.lookup("java:comp/env/jms/ATopic");
   connection.start();
   TopicSession session = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
   TopicPublisher publisher = session.createPublisher(topic);
   TextMessage message = session.createTextMessage();
   message.setText("Hola mundo!!");
   publisher.publish(message);
   System.out.println("Mensaje enviado: " + message.getText());
   
  
  } catch (NamingException e){
   e.printStackTrace();
  } catch (JMSException e) {
   e.printStackTrace();
  }
 }
}
 
import javax.jms.*;
import javax.naming.*;
public class RecibePS implements MessageListener{
 
 public static void main (String args[]){
  new RecibePS().suscribe();
 }
 
 public void suscribe(){
       
  try {
   
   InitialContext ctx = new InitialContext();
   TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("java:comp/env/jms/ConnectionFactoryLocalTx");
   TopicConnection connection = tcf.createTopicConnection();
   Topic topic = (Topic)ctx.lookup("java:comp/env/jms/ATopic");
   TopicSession session = connection.createTopicSession(false,Session.AUTO_ACKNOWLEDGE);
   TopicSubscriber suscrito = session.createSubscriber(topic);
   suscrito.setMessageListener(this);
   connection.start();
   
  } catch (NamingException e){
   e.printStackTrace();
  } catch (JMSException e) {
   e.printStackTrace();
  }
 }
 
 public void onMessage(Message mensaje){
  // Se recibe un mensaje
  try{
   // Si es un mensaje de texto, lo mostramos
   if (mensaje instanceof TextMessage){
    TextMessage m = (TextMessage)mensaje;
    System.out.println("Mensaje recibido: " + m.getText());
   }
  } catch (JMSException e){
   e.printStackTrace();
  } 
 }
 
}
 
I first undeploy the "org/apache/geronimo/SystemJMS" and deployed again with a new topic calles ATopic. Then, i run the files agains the server using a .bat.
 
set classpath=c:\gero\repository\openejb\jars\openejb-core-2.0-SNAPSHOT.jar;c:\gero\lib\cglib-full-2.0.2.jar;c:\gero\lib\geronimo-kernel-1.0-SNAPSHOT.jar;c:\gero\repository\geronimo\jars\geronimo-security-1.0-SNAPSHOT.jar;c:\gero\repository\geronimo-spec\jars\geronimo-spec-j2ee-jacc-1.0-rc4.jar;c:\gero\repository\geronimo\jars\geronimo-kernel-1.0-SNAPSHOT.jar;D:\cmp\build\classes;C:\j2sdkee1.3.1\lib\j2ee.jar;d:\jms;d:\jms\jstl-1.1.1.jar;d:\jms\standard-1.1.1.jar
java EnviaPS
pause
java RecibePS
pause
 
I get a JNDI Error. Could somebody say me whats going wrong? Do i have to put more jars on the claspath to run the standalone files? what more do i need?
Thank you very much!!!!!!!!
 
Katia


Tu horóscopo diario, semanal y gratuito. Cartas, tarot y predicciones en MSN Horóscopo