Sorry to say, but open source does not make commercial usage legal by default. The use of GPL code in Openfire (Apache license) is pretty difficult. The only legal way to do this is to put the GPL parts in plugins that can live without Openfire.
GPL tends to impose it’s license term to other projects which would force a commercial code element to become public if it is put to Openfire. Currently a commercial internal development can stay an internal code because of the Apache licence. The former GPL licensing would have forced the code to become public. Obviously this publication of intelectual property is not necessarily in the interest of a commercial company.