You'd use the
Java remote debugging facility, just as
Tomcat, WebLogic,
JBoss, and other servers do.
I'd check the Oracle website to see if they have any instructions. They may also have an Eclipse plug-in to make it less troublesome to launch and run a debugging version of OC4J.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.