There are quite a few things about samurai history that I find puzzling. On the one hand, they liked their bows very much, but at the same time refrained from using shields - the natural counter to archers, at least until plate armor. Of course, as long as the other side is playing by the same rules and does not use shields, it is still a "fair fight".
Gunpowder was known in Japan since they've met with the colonial powers. They still banned it and continued to fight with their traditional weapons. Again, since they were only fighting among themselves, it worked for them. Same as with the shields, it seems that Samurai were not so much interested in gaining every advantage possible in the battle field as much as European powers did. Instead they wanted to be the best warriors under their own terms. In Europe, a nation that did not keep up with the latest battle techniques and arms, was run over.
Samurai became more myth than history. They were only adapted to fight other samurai and their ventures in the mainland Asia were not that impressive. The fact that traditional fighting techniques are still practiced in Japan while western fighting techniques faded into history (save a few vaguely written manuals that survived in ancient tomes) is not a testimony of their effectiveness - it just a testimony of how quick the west was to dump the old in favor of the new to gain every possible advantage.