Basically, ignorance of the law is hardly ever accepted as a defence, probably because it really is the perfect defense - how do you prove or disprove someone's awareness of legal statures? As such, there is a presumption of non-ignorance for every citizen.
There's actually only a handful of examples of where it has been successfully used as a valid defense. I think there was a case in The Nederlands (can't remember the details, or even the crime) where an offender had been in some remote area of the country and was completely unreachable for the period of time when a change in legislation had occurred. If I recall correctly, he committed an offence after the change in legislation, but before he was contactable... and assisted by a lawyer with balls the size of watermelons, he got away with it. Importantly though, the verdict of not-guilty was only found due to the absolute impossibility of non-ignorance (put simply, it was proved that there was no way the man could have known about the change in law).
However, in Australia (Palmer v Ostrowski [2002] WASCA 39), a fisherman made enquiries with the fishery authority in regards to where he may fish for lobsters. The fishery authority gave him the wrong advice and, as a result, the fisherman fished in the prohibited area. It was held that the fisherman was still guilty, despite the fact that he had actually checked with the relevent authority who enforced of that area of law. Amazing, eh?
The point being that in the eyes of the law, it is never impossible to know the law. With enough time and effort, you can plausibly discover the legal grounding of any action, with very few exceptions. However, if you or your advisor (lawyer) is incorrect in their decision, you're still guilty - whether you be ignorant, misadvised, miseducated or otherwise. As far as I understand, the only time when a mistake of the law would be accepted as a possible defence, is when you obtain your knowledge of that particular area of law from the Courts. There was only one case that I know of had this situation, and that case was from the 1600's. Can't remember the details, but I think the accused was grossly misinformed of the law by a lower court judge.
Other than any of the above remote possibilities, I believe you are expected to know what is legal and what is illegal. The fact that the law adheres to this doctrine, almost ensures there will be some "luckless victims" (using the judicial terms) who will fall between the cracks. However, if this doctrine was to be ignored, I'd imagine there would be mayhem in the judicial system. As I said earlier, if a plea of ignorance was valid (and if the onus was on the prosecution to prove awareness), it would simply become the magic bullet of a great number of cases.
It's probably for a similar reason that the doctrine of mens rea isn't necessarily required as a condition for guilt... although I'm sure our resident legal expert could shed some clarity on these legal contradictions.