John Weller was born on February 22, 1812, in Montgomery, Hamilton County, Ohio. He attended Miami University, Oxford, Ohio from 1825 to 1829, but never graduated. He studied law, was admitted to the bar in 1832, and opened a private practice in Ohio. During the Mexican War, Weller served as a lieutenant colonel for the United States Volunteers.
Weller entered politics as the prosecuting attorney of Butler County, serving from 1833 to 1836. He served as a member of the U.S. House of Representatives from 1839 to 1845, and ran unsuccessfully for governor of Ohio in 1848. Weller served for one year as U.S. Commissioner of International Boundaries, but after a scandal he was removed from the commission. He moved to San Francisco in 1850 and was elected to the United States Senate in 1852, where he served until 1857. On September 2, 1857, he was elected Governor of California, and on January 8, 1858, was sworn into office. During his tenure, he advocated making California an independent republic if the North and South separated over slavery. He personally led a raid on San Quentin Prison, taking the prison back from a commercial contractor.
Weller left office on January 9, 1860, and was appointed the United States Minister to Mexico, serving until he was recalled in 1861. He was a delegate to the Democratic National Convention in 1864. In 1867, he moved to New Orleans where he continued to practice law. Governor John B. Weller died on August 17, 1875, and is buried at St. John's Cemetery, New Orleans, Louisiana.