Prior art doesn't mean it was obvious, but it does mean the patent was invalid. It doesn't matter, for patents, whether you knew about the previous creation of the thing in question, your creation of it still can't be patented (and if the previous one was, you are still infringing - although you may not be "knowingly infringing", which can affect the penalties but not whether you infringe in the first place).