  We performed a series of hydrodynamical calculations of an ultra-relativistic
jet propagating through a massive star and the circumstellar matter to
investigate the interaction between the ejecta and the circumstellar matter. We
succeed in distinguishing two qualitatively different cases in which the ejecta
are shocked and adiabatically cool. To examine whether the cocoon expanding at
subrelativistic speeds emits any observable signal, we calculate expected
photospheric emission from the cocoon. It is found that the emission can
explain early thermal X-ray emission recently found in some long gamma-ray
bursts. The result implies that the difference of the circumstellar environment
of long gamma-ray bursts can be probed by observing their early thermal X-ray
emission.
