LOS ANGELES  A federal judge on Thursday sentenced the owner of a marijuana dispensary to a year in prison, a sign that providers of medical marijuana still face the possibility of jail time despite the Obama administration’s promise not to prosecute them if they comply with state law.

In imposing his sentence on Charles C. Lynch, who ran a dispensary in the surfing hamlet of Morro, Judge George H. Wu said the changed federal policy did not directly affect his ruling. But the judge talked at length about what he said were Mr. Lynch’s many efforts to follow California’s laws on marijuana dispensaries and the difficulty the judge had finding a loophole to avoid sending him to prison.

“I find I cannot get around the one-year sentence,” Judge Wu said of federal sentencing laws.

The judge said he had reduced the sentence from a mandatory five years because Mr. Lynch had no criminal record or history of violence, and did not fit the strict definition of a “leader” of a criminal enterprise.

Mr. Lynch, 47, was convicted last summer on five federal counts in connection with the running of his dispensary and the selling of medical marijuana to customers under 21.