This is the code I am trying to execute
public WebDriver createPart() { try { driver.findElement(By.id(\"username\")).sendKeys(\"502409373\");
your parentWindowHandler should not be correct, you fetch it at wrong time point.
parentWindowHandler
Try move below code line to the first line in the try block
try
try { String parentWindowHandler = driver.getWindowHandle(); // Store your parent window