An action to annul a marriage, or to declare the nullity of a void marriage, or for divorce or separation may be maintained only when . . . [t]he parties have resided in this state as husband and wife and either party is a resident thereof when the action is commenced and has been a resident for a continuous period of one year immediately preceding.122