Ariyan and Kevin Lin have asked about the problem of extending vector bundles defined on an open subvariety across the rest of the variety. There can be subtle commutative algebra obstructions, as in Sasha's answer to Kevin's question.

In another answer to Kevin's question, Donu Arapura pointed out that a coarser cohomological obstruction is almost irrelevant. If X is a complex variety and U is an open subvariety, then in order for a vector bundle E on U to extend its Chern classes must be in the image of the map $H^\ast(X) \to H^\ast(U)$. In case X is smooth Donu sketches an argument, using Deligne's theory of weights, that this is always true if we take rational coefficients.

There is no formalism of weights in cohomology with integer coefficients. In a comment to Donu's answer I proposed an example of a line bundle on U with torsion Chern class that was not in the image of $H^2(X;Z) \to H^2(U;Z)$. But this example is completely wrong. In an e-mail, Donu gave me a short argument that avoids weights and applies to integer Chern classes. In a smooth U a Chern class $c_i(E)$ can always be represented by a codimension i cycle, and to extend it to X we can take its closure.

Are there any topological obstructions to extending algebraic vector bundles? That is, do there exist X, U, E, with X and U smooth, so that E does not even extend to a non-algebraic complex vector bundle on X?