First, look at Paul in a larger perspective. Paul's huge missological function is to preach the gospel as justification to the Gentile world. The biblical narrative explains how Paul encountered Jesus and was commissioned to preach the gospel to the Gentile world. As Paul wrote to churches who were both Jewish and Gentile, all thirteen letters stress significant emphasis on the theological nature of the gospel and it's application. Paul addressed churches [in their respected contexts] about the person and work of Christ, and how Jews and Gentiles are united under the Lordship of Jesus. Hence, Paul wrote about justification to biblically explain the soteriological function of the gospel to those who believed in Christ (i.e. they no longer need to do works, but trust in the work of Christ). Pauline justification focuses on the forensic-judicial nature of justification. Therefore, Paul's emphasis on justification is correctly viewed as extraordinary righteousness in light of the larger context of Paul's purpose in comparison to James.
Second, look at James in a smaller perspective. James is writing one letter "to the twelve tribes in the Dispersion," who are definitely Jewish Christians in need of Christ-centered instruction. James uses vivid contrasts and a rich source of the Jesus tradition in order to reveal to his audience how they are suppose to live in community as the people of God. Thus, James mentions how faith without works cannot satisfy the demands of the gospel because "faith" as intellectual assent cannot produce righteousness. For this reason, James mentions multiple kinds of "works" throughout his letter that inherently speak of biblical fruitfulness and application that produce righteousness. As Schreiner mentions, "James is focused on righteousness expressed by vitrue of the works performed." Therefore, James' emphasis on justification is correctly viewed as ordinary righteousness in light of the smaller context of James' purpose in comparison to Paul.
Concluding that Paul and James do not contradict each other, let me list several reason why they compliment one another: (1) They both mention it is by faith alone one can be made right before God; (2) They both mention it is by faith alone and not works one can be made right before God; (3) They both mention justification is a work of God; (4) They both agree one's relation to God is based on faith and the results of that faith should be evident. This was absolutely an issue for the Jews who wanted to do works to earn a right relationship with God, and for Gentiles who emphasized intellectual assent without works.
Paul and James address a two-sided coin regarding an understanding of Christianity that came out of Judaism, "Not by works but by faith; not just faith, but a faith that shows good works." Paul, James, and justification are summed up wisely by Schreiner, "James responds to antinomianism, whereas Paul reacts to legalism."