authTopic = (Topic) initialContext.lookup("topic/topicAuth");
authTopic = (Topic) initialContext.lookup(BeanConfig.PrefixTopicName+"topicAuth");
  public String getBiddingForm(int itemId, String username, String password) throws RemoteException   {    int userId = -1;    String html = "";    // Authenticate the user who want to bid      if ((username != null && !username.equals("")) || (password != null && !password.equals("")))      {        TopicConnection authConnection;        TopicSession authSession;        Topic authTopic;        try         {          // create a connection          authConnection = connectionFactory.createTopicConnection();          // lookup the destination          authTopic = (Topic) initialContext.lookup("topic/topicAuth");          // create a session          authSession  = authConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); // no transaction and auto ack        }         catch (Exception e)        {          throw new EJBException("Cannot connect to message bean MDB_Auth : " +e+"<br>");        }        try         {          // create a requestor to receive the reply          TopicRequestor requestor = new TopicRequestor(authSession, authTopic);          // create a message          MapMessage m = authSession.createMapMessage();          // set parameters          m.setStringProperty("nickname", username);          m.setStringProperty("password", password);          m.setJMSCorrelationID("auth");          // send the message and receive the reply          authConnection.start(); // allows message to be delivered (default is connection stopped)          MapMessage authReply = (MapMessage)requestor.request(m);          authConnection.stop();          // read the reply          userId = authReply.getInt("userId");          // close connection and session          requestor.close(); // also close the session          authConnection.close();        }         catch (Exception e)        {          throw new EJBException("user authentication failed: " +e+"<br>");        }        if (userId == -1)        {           html = "You don't have an account on RUBiS!<br>You have to register first.<br>";           return html;        }      }        TopicConnection itemConnection;        TopicSession itemSession;        Topic itemTopic;        try         {          // create a connection          itemConnection = connectionFactory.createTopicConnection();          // lookup the destination          itemTopic = (Topic) initialContext.lookup("topic/topicViewItem");          // create a session          itemSession  = itemConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); // no transaction and auto ack        }         catch (Exception e)        {          throw new EJBException("Cannot connect to message bean MDB_ViewItem : " +e+"<br>");        }        try         {          // create a requestor to receive the reply          TopicRequestor requestor = new TopicRequestor(itemSession, itemTopic);          // create a message          MapMessage m = itemSession.createMapMessage();          // set parameters          m.setInt("itemId", itemId);          m.setInt("userId", userId);          m.setJMSCorrelationID("viewItem");          // send the message and receive the reply          itemConnection.start(); // allows message to be delivered (default is connection stopped)          TextMessage itemReply = (TextMessage)requestor.request(m);          itemConnection.stop();          // read the reply          html = itemReply.getText();          // close connection and session          requestor.close(); // also close the session          itemConnection.close();        }         catch (Exception e)        {          throw new EJBException("Exception getting the item information: " +e+"<br>");        }        return html;  }