My bad, I copied the code from inside a class (fixed above).
Your fix is correct, but in order to create a resource in the front end using the processor, you need to be logged in as a user who has the permission to do so. When you preview from the Manager, you're not logged in to the web context. You'll see all docs, but you won't have many of the necessary permissions in the web context. If you log in as the admin (using the Login snippet), it should work.
BTW, have you looked at NewsPublisher? It will do most of the heavy lifting for you (though you'll still need a front-end login). It will also (by default) forward you to the new resource.
------------------------------------------------------------------------------------------
PLEASE, PLEASE specify the version of MODX you are using.
MODX info for everyone:
http://bobsguides.com/modx.html