Hi Marco,
Port 40000 was the default in one of the 9.0 PL (11 I think, but not sure) for the License Service.
You should check the misc. Conf directories (don't forget the specific files for B1if) of your installation and verify that this TCP port is referenced nowhere...
Regards,
Eric