A Puzzle by Lewis Carroll

John gave his brother James a box:
About it there were many locks.
James woke and said it gave him pain;
So gave it back to John again.
The box was not with lid supplied
Yet caused two lids to open wide:
And all these locks had never a key
What kind of box, then, could it be?