There are couple of thread regarding same error but they are not active ,I think last they were active was around 1 yr back so I am opening the new thread .
Though it seems to be a very old post, I am sharing the solution which worked for me.
Basically it requires two settings for TestNG Run 'Class' and 'Suite'
To set the TestNG Run 'Class'
Step1: Goto Project => Run As => Run Configurations => 'Test' tab
Step2: Check option 'Class'. It should be the set with desired '.java' file.
e.g. 'functionalTestCases.java' is on package 'testCases' then 'Class' will be set as 'testCases.functionalTestCases.java'
Step3: Verify the 'Name' field.
e.g It can be 'functionalTC'
Step4: Save the changes using 'Apply' button
To set the TestNG Run 'Suite'
Step1: Goto Project => Run As => Run Configurations => 'Test' tab
Step2: Check option 'Suite'. It should be the set with desired 'testng.xml' file path.
Step3: Verify the 'Name' field.
e.g It can be 'projectname_testng.xml'
Step4: Save the changes using 'Apply' button
After these setting are saved properly, then Run the project with 'projectname_testng.xml'
Also, I am using TestNG annotation as '@BeforeClass' for the method (which refers and checks the 'parameter' passed from 'testng.xml') in 'testCases.functionalTestCases.java'
It seems that TestNG created the testng.xml programatically because it can't find your testng.xml or you ran your project as a TestNG Test instead of your testng.xml file.
If you want to run only your suite xml file, you need to select your suite file and select Run As-> TestNG Suite.
However, if you want to select a particular test and use the non test part of your suite file i.e. the suite/listeners/parameters section, then you can set this file as a template xml by going to Project Properties->TestNG -> Template XML File (give absolute path of your testng xml here)
This is probably due to running as @Test. You need to run it at Suite Level