In this article we address some system characteristics and challenging issues in developing Context-aware Middleware for Ubiquitous Computing. The functionalities of a Context-aware Middleware includes gathering context data from hardware/software sensors, reasoning and inferring high-level context data, and disseminating/delivering appropriate context data to interested applications/services. The Middleware should facilitate the query, aggregation, and discovery for the contexts, as well as facilities to specify their privacy policy. Following a formal context model using ontology would enable syntactic and semantic interoperability, and knowledge sharing between different domains. Moddleware should also provide different kinds of context classification mechanical as pluggable modules, including rules written in different types of logic (first order logic, description logic, temporal/spatial logic, fuzzy logic, etc.) as well as machine-learning mechanical (supervised and unsupervised classifiers). Different mechanisms have different power, expressiveness and decidability properties, and system developers can choose the appropriate mechanism that best meets the reasoning requirements of each context. And finally, to promote the context-trigger actions in application level, it is important to provide a uniform and platform-independent interface for applications to express their need for different context data without knowing how that data is acquired. The action could involve adapting to the new environment, notifying the user, communicating with another device to exchange information, or performing any other task.