Throughout his life he was known as Judge Hanley - Jim or The Major.
James was born in Winona Minnesota on Jauary 6, 1877. His father Michael was from Ireland and his mother Eliza Cater was from England. He had one brother Jasper and two sisters. He graduating from High School in Kasson Minnesota at age 16. Despite the lack of his father's approval, he attended Carleton College in Northfield Minnesota and studied law. He left college when he was 18 to go to Waseca Minnesota where he worked as a city clerk while studying law under Peter McGovern.
While he was ready to take the bar examination when he was 21, he instead enlisted instead at the outbreak of the Spanish-American War in 1898. Hanley served as a private in the 12th Minnesota Volunteers. After being discharged in 1899, he took and passed the bar still at the age of 21. Returing to Waseca, he established his law practice while also serving as deputy state oil inspector, city auditor, the local Board of Health and secretary to the Waseca Agricultural Society.
In 1902 while employed as an oil investigator and report, Mr. Hanley went to North Dakota on a business trip. He stopped over in Mandan and met a local attorney, Henry G. Voss. After multiple subsequent conversations, James was persuaded to relocate permenantly to Mandan and form a law partnership with Mr. Voss. But he did not want to leave behind his "best-girl", Irma Lewis. But satisfying the desire would not be simple.
The families were far apart financially and socially. James' father ran a stable while Irma's father was a distinguished attorney. Her family adamantely opposed their match the couple eloped. When her brother-in-law heard of the plan, he grabbed his gun and when looking for them but to no avail. They were married in Minneapolis on March 3, 1903. They settled in Mandan and had four children, James Jr., Josephine (McCormick), Irma Jane (Lium) and Lewista (Paris). Hanley was so sure his youngest child was going to be a son, he preselected the name "Lewis." When faced with the disappointment, he adapted in his typical forthright manner - just added the "ta" to her name.
On arriving in Mandan, he "turned Republican" reportedly since it was the only active part in North Dakota. He was elected States Attorney for Morton County in both 1908 and 1910. He was elected to the House of Representative in 1908 and 1910, and served as Speaker of the House during the 1911 legislative session. The next year he sucessfully ran for the North Dakota Senate.
In 1915 he was appointed Judge of the Twelfth Judicial District, by Governor Louis B. Hanna, he served in that capacity until 1919, when the judicial districts were revised he became Judge of the Sixth Judicial District from 1919 until 1920.
Mr. Voss died in 1907 and Hanley continued his solo law practice until 1909. John Sullivan joined the practice now known as Hanley & Sullivan Law Offices. The two also partnered in at least three ranches, two farms and joined in a host of trouble. Depression prices, inefficient tenants and back luck shattered his dream to retire as a gentleman farmer. He was instrumental, however, with other Mandan businessmen, in obtaining funding for the Northern Great Plains Agricultural Research Station southwest of Mandan.
In 1906, he was instrumental in organization Company F-North Dakota National Guard to replace the local militia. He was commissioned as a captain but in 1915 he was promoted to major. As a private in the short duration Spanish-American War, he never left the county. When the Mexican border trouble arose in 1916 and now as a major, he again hoped he would see action. He took the 3rd Battalion 1st North Dakota Infantry to the border but never received orders to cross into Mexico after Pancho Villa. He subsequently resigned to return to his duties as judge. However his desire to see action was satisfied in World War I in France with the American Expeditionary Force as commander of the 148th Machine-Gun Battalion. He and his men joined in battles at St. Mihiel, St. Die, and Lucey (Lorraine).
After the war, he returned to Mandan to resume his private law practice. He was also a delegate to the caucus held in Paris to form the American Legion. He subsequently attended the working group meetings in St. Louis and the chartering convention in Minneapolis for the national organization in 1919. He was instrumental in forming the Mandan Legion Gilbert S. Furness Post No. 40 and served as temporary chairman. In 1921, he was honored by being nominated for National Commander by his state's delegation.
In 1926, Hanley lost a bid to run for governor as the GOP's candidate. He switched back to the Democratic Party and ran in 1946 for the US House of Representatives. He was defeated for the position by Charles Roberson.
Outside of politics, Hanley was the first president of the Mandan Rotary Club in 1921-1922 and secretary of the Missouri Slope Fair Association in 1921-1922. In addition, he belonged to the Elks, the Knights of Pythias, the American Legion, VFW and Presbyterian Church. His first wife died in 1929 and remarried in 1943 to Mona Smith.
Judge Hanley died on January 31, 1947 in Mandan at the age of 70. He and his first wife Irma are buried beside each other in Union Cemetery, Mandan, ND. His second wife is also buried in Union Cemetery ,beside her first husband, Dr. L. G. Smith.