Results 1 to 2 of 2

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

  1. #1
    NicolasC92 is offline New Member
    Join Date
    Aug 2009
    Posts
    4
    Rep Power
    6

    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 :

    Code:
    // 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 :

    Code:
    com.zimbra.common.service.ServiceException: system failure: Database connection pool not initialized. 
    [...] Code:service.FAILURE 
        at com.zimbra.common.service.ServiceException.FAILURE(ServiceException.java:247) 
        at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:297) 
        at com.zimbra.cs.db.DbPool.getConnection(DbPool.java:292)
    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 :
    Code:
    DbPool.startup();
    and I have no more errors.

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

    With this line, I get the following error in firefox :
    Code:
    HTTP ERROR 500 Problem accessing /service/zimlet/com_myZimlet/test.jsp. Reason: org/apache/lucene/store/Directory
    In mailbox.log I have :
    Code:
    java.lang.NoClassDefFoundError: org/apache/lucene/store/Directory
    	at com.zimbra.cs.index.LuceneFactory.create(LuceneFactory.java:26)
    	at com.zimbra.cs.index.LuceneFactory.create(LuceneFactory.java:22)
    	at com.zimbra.cs.index.MailboxIndex.<init>(MailboxIndex.java:312)
    	at com.zimbra.cs.mailbox.IndexHelper.instantiateMailboxIndex(IndexHelper.java:103)
    [...]  Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Directory 
    [...] ... 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 org.apache.lucene.store.Directory. 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.

    Nico

  2. #2
    FARID_PH is offline Starter Member
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    4

    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 ???

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •