log.error("Failed to load queue state", e);
   void addCoreDestination(Destination jmsDestination) throws JMSException   {      JBossDestination d = (JBossDestination)jmsDestination;      String name = d.getName();      boolean isQueue = d.isQueue();      CoreDestination cd = getCoreDestination(isQueue, name);      if (cd != null)      {         throw new JMSException("Destination " + jmsDestination + " already exists");      }      ServerPeer sp = destinationManager.getServerPeer();      // TODO I am using LocalQueues for the time being, switch to distributed Queues      if (isQueue)      {         cd = new Queue(name, sp.getMessageStore(), sp.getPersistenceManager());                  try         {            // we load the queue with any state it might have in the db            ((Queue)cd).load();         }         catch (Exception e)         {            JMSException e2 = new JMSException("Failed to load queue state");            e2.setLinkedException(e);            throw e2;         }                  queueMap.put(name, cd);      }      else      {         // TODO I am using LocalTopics for the time being, switch to distributed Topics         cd = new Topic(name, sp.getMessageStore());                  topicMap.put(name, cd);                  //TODO         //The following piece of code may be better placed either in the Topic itself         //or in the StateManager - I'm not sure it really belongs here                  //Load any durable subscriptions for the Topic         Set durableSubs = sp.getStateManager().loadDurableSubscriptionsForTopic(name);         Iterator iter = durableSubs.iterator();         while (iter.hasNext())         {            DurableSubscription sub = (DurableSubscription)iter.next();            //load the state of the dub            try            {               sub.load();            }            catch (Exception e)            {               JMSException e2 = new JMSException("Failed to load durable subscription state");               e2.setLinkedException(e);               throw e2;            }            //and subscribe it to the Topic            sub.subscribe();         }      }   }