I am having problems connecting Processing to an Arduino

The “null” lines occur mostly every “Hello world” but not always.

Welcome to serial communication. You would think that neat little packets of data are sequentially sent, but in reality there is a lot of slicing and dicing, and it falls upon us to unscramble the soup. I have also caught it sending invisible characters which are a lot of fun to find and eliminate.