locked
Unable to switch between two mailbox RRS feed

  • Question

  • Hi Team,

    I am trying to read the items from the INBOX folder from mailboxes associated with me.

    I have two mailbox with me as:

    1.  mine@domain.com  - Mine mailbox

    2. sharedmailbox@domain.com - shared mailbox

    Both mailboxes are added in Outlook365 desktop client app and able to access both mailboxes.

    For further, trying to read those mailboxes using below EWS Java API dependency:

    <dependency>
    	<groupId>com.microsoft.ews-java-api</groupId>
    	<artifactId>ews-java-api</artifactId>
    	<version>2.0</version>
    </dependency>


    It is work with mine mailbox and able to read the folders and items. However, trying to switch to shared mailbox as below:

    String sharedMailbox = "sharedmailbox@domain.com";
    Mailbox mailbox = new Mailbox(sharedMailbox);
    FolderId folderId = new FolderId(WellKnownFolderName.Inbox, mailbox);
    Folder folder = Folder.bind(service, folderId);
    ItemView view = new ItemView(10);
    FindItemsResults<Item> fiitems = service.findItems(folderId, view);

    but it give below exception:
    microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: The mailbox database is temporarily unavailable.
    at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278)
    at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267)
    at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:165)
    at microsoft.exchange.webservices.data.core.ExchangeService.findItems(ExchangeService.java:985)
    at microsoft.exchange.webservices.data.core.ExchangeService.findItems(ExchangeService.java:1049)


    I am suffering since few days but did not find any work around stuff.

    Can you please suggest switching between two mailboxes?

    Your help appreciable.

    Thank you.


    • Edited by Suraj Savaratkar Friday, April 17, 2020 1:08 PM updated inputs and its error logs
    Friday, April 17, 2020 12:26 PM

All replies

  • Sounds like it bad routing information for the Mailbox in question (do you have hybrid?) . I would suggest you added the X-AnchorMailbox header and set that to the Mailbox your trying to access which should help if its a routing error eg

    service.HttpHeaders.Add("X-AnchorMailbox",sharedMailbox);

    Cheers
    Glen


    Sunday, April 19, 2020 10:54 PM
  • Thank you Glen Scales! The issue was resolve.
    Wednesday, April 29, 2020 9:47 AM
  • If you are using a mail client to retrieve your E-Mails, check your setting for each E-Mail address. You can Manage your Email using the office 365 archive mailbox. Simply login and follow the steps below. Log on to app. Select My plans & features. Hit the “plus” drop down button next to your Internet service. Select Manage my network & email.
    Wednesday, April 29, 2020 10:24 AM