This reviews difficulties encountered on an EWR-lax-PVG mileage run. My son and I were on a promotional (cheap) EWR...PVG fare, ticket bought on AA.COM months ago, trip taken about 2 weeks ago. The ticket required an overnight in LAX. To avoid the fairly expensive China visa, we planned to, and did, take advantage of China's policy, that you could visit Shanghai for up to 48 hours, without a visa, if you presented evidence of a flight outside of China w/ 48 hours of arrival. 2 times before departure mentioned to phone agents that we had ongoing flights on a Star Alliance carrier w/in 48 hrs of arrival. Was told all such details would be taken care of at checkin. Tried to check in, on-line, for the trip - was allowed to check in for the 1st leg, EWR-lax, but not the second. Asked at check-in why could we not check in for the entire flight - was told it was because the flight to PVG was more than 24 hours away, which it was. Flew to LAX, spent the night there, then checked in for lax-PVG. Some reluctance, but when we explained our onward flight to Japan w/in 48 hours and presented copies of our itinerary and a digital copy of appropriate web page from Peoples Republic, were allowed to check in. At the Intl F lounge (very nice) we were advised about 30 minutes after arrival that we would not be allowed to board the plane as we had no visa and AA had been fined $3K the day before for letting people fly to China w/out a visa. Explained to the lounge agent, who was courteous throughout, what we were doing, showed her cc's of documentation, etc., but she deferred to the gate agents who were researching the matter and would make the final decision, but as of that moment, we would not be allowed to board, unless we had an immediate, or w/in 24 hour, onward flight. Went into frantic mode - calling AA reservations - could they advise the gate what the rules were, or let us fly to Japan or somewhere to salvage something of the trip. They were cordial but said they could do nothing, it was up to the gate agent. Called UA (we were on an award ticket to Japan) to see if we could get on a one day earlier flight to Fukuoka if we had to - there were no flights available. Spent over an hour on cell phone making calls. We eventually heard from the AAngel in the lounge that our understanding of China's visa laws was correct and we would be allowed to board. My concerns - The LAX folks really should know the China visa requirements. This policy has been around for years. This is just going to get worse as Beijing is likely to go to a "no visa" rule for stays of less than 3 days (proposed for next year - it hasn't gone into effect yet and may never). It's awful to be told after you've flown cross-country, and made multiple other reservations, that you're not going to be allowed on the plane. If we were to be denied boarding, it should have been in EWR, rather than at LAX. I called the phone agents twice in the weeks before this to mention the ongoing trip, ask did they need the UA PNR or any other details, mentioned it at EWR, mentioned it at LAX. Don't know what could have been done differently to avoid this situation. (On UA, a year or two ago, on a MSY-lax-SYD flight I was denied/delayed in boarding at MSY due to concerns about a Visa, which I had barely enuf time to resolve on the phone and make my MSY-lax flight - my point being that visa concerns were hashed out at the start of a flight, rather than in the middle). My point in posting is to let others know that, at LAX at least, some agents don't know the visa rules - if you're planning on taking advantage of the 48 hr free pass to Shanghai, allow lots of extra time to check in and realize that even tho you've checked in, you may have to argue to be allowed to board the plane. Bring excellent documentation of your ongoing flight (which we had), you will need it to show to China immigration officials and to show to gate agents at the check-in counter.