What were the causes of the Opium War?

Both the First Opium War and the Second Opium War were fought between Britain and China. The disputes arose over diplomatic relations, trade, and the legal status of foreign nationals.