There is an exception in RoHS for solder
No there isn't.
Simple as that.
Humor me then:
If lead containing solder is banned, because of RoHS, why can I go out to every hardware store and buy regular, lead containing solder?
Why can my company deliver products that are RoHS compliant (tested and tried by companies such as SGS and accepted by all major electronics suppliers on the market) but still use lead containing solder to get microcontrollers on PCB's?
Not all solder may contain lead, however, in some cases there is no feasible replacement.
There are actually quite some exemptions on RoHS.http://www.rohs.gov.uk/Docs/All%20Current%20Exemptions%202011.pdf
gives a list of all exemptions currently in effect.
See 7A and 7B for the solder exemptions in detail.