I had the exact same problem.
What version of 8.1.7 do you have? The problem may be that the plsql.jar file, provided in the 18.104.22.168 patchset,
contains an invalid TCPConnection class. The invalid class was fixed in 22.214.171.124. This does not automatically get loaded back into the database when doing an upgrade. You will need to do the following to reload the class
call dbms_java.loadjava(‘-resolve -force plsql/jlib/plsql.jar’);
Then you need to reload the tcp and smtp modules as follows
This needs to be done as SYSDBA on the machine local to the database using the correct 8.1.7 Oracle Home.