Self-management is one of the challenges for realizing Ambient Intelligence in pervasive computing. In this paper, we propose and present a semantic web based selfmanagement approach for a pervasive service middleware where dynamic context information is encoded in a set of self-management context ontologies. The proposed approach is justified from the characteristics of pervasive computing and the open world assumption and reasoning potentials of semantic web and its rule language. To enable real-time self-management, application level and network level state reporting is employed in our approach. State changes are triggering execution of self-management rules for adaption, monitoring, diagnosis, and so on. Evaluations of self-diagnosis in terms of extensibility, performance, and scalability show that the semantic web based self-management approach is effective to achieve the selfdiagnosis goals, and lay a solid foundation for further selfmanagement work.