Bitcoin connects to TOR on ip 9050. TOR connects 9050 to its network using higher ports. see:-
tcp 0 0 localhost:9050 localhost:47342 ESTABLISHED
tcp 0 0 localhost:46330 localhost:9050 ESTABLISHED
tcp 0 0 localhost:47342 localhost:9050 ESTABLISHED
tcp 0 0 localhost:9050 localhost:46330 ESTABLISHED
tcp 0 0 localhost:9050 localhost:38319 ESTABLISHED
tcp 0 0 localhost:38319 localhost:9050 ESTABLISHED
9050 - 47342 ; 47342 - 9050
Thus its not the 9050 that you should be looking for, it should be higher ports. Firewall will block 9050 but not the higher port.
Current netstat (This is ofcourse not the complete list). I really dont know if these ports can be scanned.
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 localhost:49210 localhost:9050 ESTABLISHED
tcp 0 0 localhost:9050 localhost:49210 ESTABLISHED
tcp 0 0 localhost:50715 localhost:9050 ESTABLISHED
tcp 0 0 localhost:9050 localhost:50715 ESTABLISHED
tcp 0 0 localhost:9050 localhost:38319 ESTABLISHED
tcp 0 0 localhost:38319 localhost:9050 ESTABLISHED
There could furthermore be other special actions be taken like the application server is behind a firewall and directly connected with one special tor entry node that was extra setup for this purpose and their application server just communicates with this one special tor entry node and their firewall blocks all other external accesses that do not come from their tor entry node.
This would work for us but we intend to get a new IP every so many hours/days. If there was one partcular TOR node that we connect to, it would become little easier to trace. Regarding the java app, it doesnt use TOR as the bandwidth requirement is huge. Consider checking email and replying in less than a second forever. It wont be beneficial to burden the TOR network with useless bandwidth when only google will be able to see the IP.