A search for narrow resonances with a mass of at least 1 TeV in the dijet mass spectrum is performed using pp collisions at sqrt(s)=7 TeV corresponding to an integrated luminosity of 1 inverse femtobarn, collected by the CMS experiment at the LHC. No resonances are observed. Upper limits at the 95% confidence level are presented on the product of the resonance cross section, branching fraction into dijets, and acceptance, separately for decays into quark-quark, quark-gluon, and gluon-gluon pairs. The data exclude new particles predicted in the following models at the 95% confidence level: string resonances with mass less than 4.00 TeV, E6 diquarks with mass less than 3.52 TeV, excited quarks with mass less than 2.49 TeV, axigluons and color...