I wonder if the Khazar-style scenario would work. Say, widespread contact of Europe with China happens much sooner, maybe in VIIth-IXth centuries or so. Due to the butterflies that bringing China into a sphere of European politics of the time and such would create, say by XIVth or XVth century China is a battleground where Catholic Christians, Orthodox Christians, and Muslims of both Shi'a and Sunni persuasion wage war, with much of China in disarray, and several warring dynasties struggling for power.
In a chaos, one warlord only achieves the goal of reuniting the country. Say, Confucianism is discredited due to the inward-looking stance of Confucian rulers causing ruin for China (far-fetched, but Confucianism has to be dealt with in order to allow another major philosophy/religion to really take hold). Said warlord, distrustful of the Europeans, but not willing to return to Confucianism, converts to Judaism as the means of proclaiming not only political, but also religious independence from both Christianity and Islam. Centuries down the line, China is still officially Jewish, although their particular version of Judaism has probably diverged from the one practiced by Old World Hebrews.
The main problem with the above TL is that China is simply too large and populous to be dominated by Europeans or Arabs in the Middle Ages, before the Europeans had the technological edge to do so. In fact, if anything, China would have been more likely to dominate most European states of the Dark Ages until well into the Renaissanse, because IT had equivalent, if not even superior technology, and had better internal organization. It took industrial revolution for European nations to be able to dominate China.
Now, if, say, the contact leads to China breaking up into a number of smaller (although still rather big by European standards) states that are constantly at war with each other, at least through butterflies and whatnot, then the Chinese would be more concerned about each other than the Europeans originally, allowing the Europeans to gain a foothold in the East, and to achieve sufficient technology to become a major factor in Chinese politics.