Did you run through the steps in the first article you mentioned for resolving any config issues? Did you check for any typos in your script? What version of ThingWorx are you running? Did you validate that the PTC support account you are using for licensing is valid?
Have you checked the logs at /ThingworxStorage/logs or <tomcat_home>/logs for possible causes?