The provision of acceptable service in the presence of failures and attacks is a major issue in the design of next generation Dense Wavelength Division Multiplexing (DWDM) networks. Survivability is provided by the establishment of redundant lightpaths for each connection request to protect the primary lightpaths. This paper presents a genetic algorithm (GA) solver for the routing and wavelength assignment problem with working and spare lightpaths. The proposed approach has been evaluated on both dedicated path protection and shared path protection. Simulation results show that the GA method is efficient and able to design DWDM survivable realworld optical mesh networks.