Results 1 to 2 of 2

Thread: How to retrieve the mailbox object with MailboxManager in Zimbra 6 ?

  1. #1
    Join Date
    Aug 2009
    Rep Power

    Unhappy How to retrieve the mailbox object with MailboxManager in Zimbra 6 ?

    Hello all,

    In my zimlet, I am trying to instantiate the mailbox with the current account but I have few errors.

    I would like to get the following source code to work :

    // import com.zimbra.cs.mailbox.MailboxManager ....
    MailboxManager mgr = MailboxManager.getInstance();
    Mailbox mbox = mgr.getMailboxByAccountId(account.getId());
    1) MailboxManager mgr = MailboxManager.getInstance();

    With this line, I have the errror in log/mailbox.log :

    com.zimbra.common.service.ServiceException: system failure: Database connection pool not initialized. 
    [...] Code:service.FAILURE 
        at com.zimbra.common.service.ServiceException.FAILURE( 
        at com.zimbra.cs.db.DbPool.getConnection( 
        at com.zimbra.cs.db.DbPool.getConnection(
    After comparing the zimbra v.6 source code with the zimbra v5 source code I have noticed several things :
    • the DbPool class doesn't have the startup() method.
    • the Account class inherits attributes and methods from the com.zimbra.cs.account.ZAttrAccount class which doesn't exist in Zimbra v5.

    So I have added this line :
    and I have no more errors.

    2) Mailbox mbox = mgr.getMailboxByAccountId(account.getId());

    With this line, I get the following error in firefox :
    HTTP ERROR 500 Problem accessing /service/zimlet/com_myZimlet/test.jsp. Reason: org/apache/lucene/store/Directory
    In mailbox.log I have :
    java.lang.NoClassDefFoundError: org/apache/lucene/store/Directory
    	at com.zimbra.cs.index.LuceneFactory.create(
    	at com.zimbra.cs.index.LuceneFactory.create(
    	at com.zimbra.cs.index.MailboxIndex.<init>(
    	at com.zimbra.cs.mailbox.IndexHelper.instantiateMailboxIndex(
    [...]  Caused by: java.lang.ClassNotFoundException: 
    [...] ... 55 more
    If I use the method getMailboxByAccount(account) or another getMailbox method the error will be the same.

    So I guess that means the problem comes from the Directory class in In zimbra v6 it corresponds to the .jar used which is /jetty-6.1.5/webapps/service/WEB-INF/lib/lucene-core-2.4.1.jar (in zimbra v5 it is lucene-core-2.3.2.jar). I really don't know how to solve this issue

    When I use the methods getAccountIds(), getAllLoadedMailboxes(), getMailboxIds() or isMailboxLoadedAndAvailable(long mailboxId) it works fine (however there is no mailboxes loaded).

    And I have checked the values of the account object (account.getId() and others attributes) to be sure that the problem wasn't due to the account but everything is normal.

    Thank you in advance for your help.

    My current version of Zimbra is 6.0.3_GA_1915.RHEL5.FOSS 18 Nov 09.


  2. #2
    Join Date
    Oct 2010
    Rep Power

    Default MailboxManager Class

    Hi NicolasC92

    i have a same problem with you about get Mailbox from MailBoxManager Class ...!

    i get error "Database connection pool not initialized." in my application...and when i added DBpool.startup() in my code program start , and finish without any error message and without any reaction .

    can you help me ????
    can you said me how i can solve my problem ???

Similar Threads

  1. slapd message error
    By smoke in forum Administrators
    Replies: 7
    Last Post: 04-27-2008, 03:23 PM
  2. Zimbra spam system
    By rajahd in forum Administrators
    Replies: 9
    Last Post: 04-16-2008, 07:25 PM
  3. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts