Warner was born in Middlebury, Vermont, the son of Joseph and Jane Anne Warner. He graduated from Kimball Union Academy in Meriden, New Hampshire in 1854, and attended Middlebury College for two years, until he was accepted as a cadet in the United States Military Academy on July 1, 1855. He graduated from West Point on July 1, 1860, standing 40th in a class of 41. brevet 2nd Lieutenant Warner was assigned to the 10th U.S. Infantry, and, on February 28, 1861, was promoted to 2nd Lieutenant and transferred to the 8th U.S. Infantry. He was then promoted to 1st LieutenantMay 31, 1861, and assigned to Fort Wise, Colorado Territory. Lieutenant Warner probably received a first-rate education in North-South politics while stationed at Fort Wise. Among the officers there at the start of the war were Maj. John Sedgwick, future commander of the Sixth Corps; William S. Walker, a Pennsylvanian who went with the Confederacy, probably because of his marriage to a Floridian; Richard Riddick, who would fall leading his 34th North Carolina at Gaines' Mill and William D. DeSaussure, who died at Gettysburg leading his 15th South Carolina; Edward Newby, of Virginia and James McIntyre, of Tennessee, both of whom would stay with the Union; and the redoubtable James Ewell Brown "J.E.B." Stuart, who would become the bane of many a Union cavalry trooper.
Civil War
The State of Vermont asked for Warner's services to lead a volunteer regiment, which was agreed to, and he was appointed colonel on September 1, 1862, and assigned to command the 11th Vermont Infantry. His regiment was assigned to the northern defenses of Washington, D.C., from September 1862 until May 1864, when Lt. Gen. Ulysses S. Grant called for more troops to support his Overland Campaign. The 11th Vermont joined the Vermont Brigade after the Battle of the Wilderness, and first saw action at the Battle of Spotsylvania Court House. In his first engagement, on May 18, 1864, Warner was severely wounded, but refused to leave the field until the end of the day. He was sent home on furlough to recover. He returned from convalescence leave on July 8, 1864, and was assigned to command the 1st brigade, Hardin's division, XXII Corps, in the defenses of Washington. He returned to his regiment later that month, but was reassigned to command the 1st Brigade, 2nd Division, VI Corps in September 1864. He commanded that brigade until it was disbanded in May 1865. On January 31, 1865, President Abraham Lincoln nominated Warner for appointment to the grade of brevet brigadier general, Volunteers, to rank from April 1, 1864, "for gallant and meritorious service" at the battle of Spotsylvania Court House, and at the battles of Winchester, Fisher's Hill and Cedar Creek and the United States Senate confirmed the appointment on February 14, 1865. Warner was promoted him to captain, 8th U.S. Infantry, in the Regular Army on October 8, 1864. He also received brevets as major, lieutenant colonel and colonel, U.S. Army, to rank from March 13, 1865, "for gallant and meritorious service during the war." Warner was appointed brigadier general, volunteers, on May 8, 1865, to rank from May 8, 1865, although his nomination to this grade was sent to the U.S. Senate only on January 13, 1866 and was confirmed by the Senate on February 23, 1866. On July 17, 1866, President Andrew Johnson nominated Warner for appointment to the grade of brevet brigadier general, U.S. Army, to rank from April 9, 1865, "for gallant and meritorious services in the field during the war" and the U.S. Senate confirmed the appointment on July 23, 1866. He mustered out of voluntary service on January 1, 1866, and resigned his regular army commission on February 13.
Postwar activities
After the war, Warner moved to Albany, New York, where he engaged in paper manufacturing as president of the Albany Card and Paper Company. On December 19, 1889, he was appointed postmaster of Albany by President Benjamin Harrison's administration. Warner died March 16, 1897, in New York City, and his remains were returned to Middlebury, Vermont, for interment. James Warner married Matilda Elizabeth Allen, daughter of George Allen and Sophia Sargent, in early June 1863, while he was stationed in the northern defenses of Washington.