e.printStackTrace(); throw new JBossJMSException("Failed to deploy core destination", e);
log.error("Failed to deploy core destination", e); throw new MessagingJMSException("Failed to deploy core destination", e);
   public void deployCoreDestination(boolean isQueue,                                      String destName,                                     MessageStore ms,                                      PersistenceManager pm,                                     int fullSize,                                      int pageSize,                                      int downCacheSize) throws JMSException   {      try      {                  if (log.isTraceEnabled()) { log.trace("creating core destination for " + destName); }                  CoreDestination cd = getCoreDestinationInternal(isQueue, destName);         if (cd != null)         {            throw new JMSException("Destination " + destName + " already deployed");         }                  // Might already be in db         long id;         Long l = getIdForDestination(isQueue, destName);         if (l == null)         {            //Not in db - insert a new mapping row            id = this.getNextId();                        insertMappingRow(id, isQueue ? TYPE_QUEUE : TYPE_TOPIC,                             destName, null, null, null, null);         }         else         {            id = l.longValue();         }                  // TODO I am using LocalQueues for the time being, switch to distributed Queues         if (isQueue)         {            cd = new Queue(id, ms, pm, true, fullSize, pageSize, downCacheSize);                        try            {               // we load the queue with any state it might have in the db               ((Queue)cd).load();            }            catch (Exception e)            {               log.error("Failed to load queue state", e);               JMSException e2 = new JMSException("Failed to load queue state");               e2.setLinkedException(e);               throw e2;            }                        queues.put(destName, cd);         }         else         {            // TODO I am using LocalTopics for the time being, switch to distributed Topics            cd = new Topic(id, fullSize, pageSize, downCacheSize);                        topics.put(destName, cd);                        // TODO: The following piece of code may be better placed either in the Topic itself or in            //       the DurableSubscriptionStore - I'm not sure it really belongs here                        // Load any durable subscriptions for the Topic            List durableSubs = loadDurableSubscriptionsForTopic(destName, ms, pm);                        Iterator iter = durableSubs.iterator();            while (iter.hasNext())            {               CoreDurableSubscription sub = (CoreDurableSubscription)iter.next();               //load the state of the dub               try               {                  sub.load();               }               catch (Exception e)               {                  log.error("Failed to load queue state", e);                  JMSException e2 = new JMSException("Failed to load durable subscription state");                  e2.setLinkedException(e);                  throw e2;               }               //and subscribe it to the Topic               sub.subscribe();            }         }                  // Put in id map too                  JBossDestination jbd ;                  if (isQueue)         {            jbd = new JBossQueue(destName);         }         else         {            jbd =  new JBossTopic(destName);         }                  idMap.put(new Long(id), jbd);         log.debug("core destination " + cd + " (fullSize=" + fullSize + ", pageSize=" +                   pageSize  + ", downCacheSize=" + downCacheSize + ") deployed");      }      catch (Exception e)      {         e.printStackTrace();         throw new JBossJMSException("Failed to deploy core destination", e);              }   }