Hi david,
Can you please send me the source code of the program that registers a 
NotificationListener with the Timer Mbean of Jboss. The example program 
provided in JBoss doc. doesn't seem to work. Also I need info. regarding how 
to register the Timer Mbean with JBoss (i.e., in JBoss.jcml file)

thanks.
regards,
Keerthi


>From: "David Crecente" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "Lista Jboss" <[EMAIL PROTECTED]>
>Subject: [JBoss-user] handleNotification Timer MBean Problem
>Date: Tue, 12 Jun 2001 12:52:56 +0200
>
>    Hi all,
>    I am running Timer Mbean and JBoss call it each 10 seconds.
>    I handle the notification in Listener class and i want to look up a
>session bean here,
>but i get NamingException and exception.getMessage() return null.
>
>    My Listener class:
>
>package sonix;
>
>import javax.management.*;
>import javax.naming.*;
>import sonix.session.*;
>import javax.rmi.PortableRemoteObject;
>import java.util.Properties;
>
>   public class Listener implements NotificationListener
>   {
>       public void handleNotification(Notification pNotification, Object
>pHandback)
>       {
>         // Here to whatever you want or call a method
>       // in the outer class
>       System.out.println( "You got a Notification: " + pNotification );
>
>       Properties env = new Properties();
>       env.setProperty("java.naming.factory.initial",
>"org.jnp.interfaces.NamingContextFactory");
>       env.setProperty("java.naming.provider.url",  "localhost:1099");
>//    env.setProperty("java.naming.provider.url",  "192.168.27.148:1099");
>       env.setProperty("java.naming.factory.url.pkgs",  
>"org.jboss.naming");
>
>
>         try
>         {
>               InitialContext jndiContext = new InitialContext(env);
>               Object ref  = jndiContext.lookup("sonix/session/ProcessNewAlarmS");
>               ProcessNewAlarmSHome alarmhome =
>(ProcessNewAlarmSHome)PortableRemoteObject.narrow (ref,
>ProcessNewAlarmSHome.class);
>               ProcessNewAlarmS alarm = alarmhome.create();
>               alarm.notifyAlarms();
>       }
>       catch(javax.naming.NamingException e)
>       {
>          System.out.println("Error: " + e.getMessage());
>       }
>       catch(javax.ejb.CreateException e)
>       {
>          System.out.println("Error: " + e.getMessage());
>       }
>       catch(java.rmi.RemoteException e)
>       {
>          System.out.println("Error: " + e.getMessage());
>       }
>       catch(Exception e)
>       {
>          System.out.println("Error: " + e.getMessage());
>       }
>
>       }
>   }
>
>
>    Line Object ref  = 
>jndiContext.lookup("sonix/session/ProcessNewAlarmS");
>throws NamingException
>
>    Can someone help me?
>
>    Thank you in advance.
>
>
>_______________________________________________
>JBoss-user mailing list
>[EMAIL PROTECTED]
>http://lists.sourceforge.net/lists/listinfo/jboss-user

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to