Hi,

here is my problem:

I have a sample stateless session bean.
I want to use this session like a notifier module.
I want to create a topic, and all the other stuff.
But went I  create an instance, the soft throws a naming exception.

Do I must put something in the xml files, and what ?
Thanks !

Gilles.



My peace of code is like this :

 public class InternalFunctionSessionBean implements SessionBean
{
  private SessionContext ctx;

  private Topic topic = null ;
  private TopicConnection tc = null ;
  private TopicSession ts = null ;
  private TopicPublisher tp = null ;

  public void ejbCreate() throws CreateException
  {
     lookupJmsTopic () ;
  }

..........................

  private boolean lookupJmsTopic ()
  {
    try
    {
        InitialContext ctx = new InitialContext () ;
        TopicConnectionFactory tcf = (TopicConnectionFactory)
ctx.lookup("TopicConnectionFactory");
        topic = (Topic) ctx.lookup("FunctionTopic");  // <== here is the bug !!!

        tc = tcf.createTopicConnection () ;
        ts = tc.createTopicSession ( false, Session.AUTO_ACKNOWLEDGE ) ;
       tp = ts.createPublisher ( topic ) ;
    }
    catch ( Exception nEx ) { nEx.printStackTrace () ; return false ; }
    return true ;
  }



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

Reply via email to