I am using WebLogic 10.3 with a Java EE application. Can anyone please tell me how to debug this application?
I think the other answers are somewhat wrong. For windows, if you setup an environment variable called debugFlag
to be true or in solaris/unix do the same
debugFlag=true
export debugFlag
DEBUG_PORT=8453
export DEBUG_PORT
, then setDomainEnv.sh
or setDomainEnv.cmd
are going to be called to start WLS by the other scripts. They look for the debugFlag
and DEBUG_PORT
, as long as the "production" flag is not set it will pick up the right parameters from the script for debugging (-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=%DEBUG_PORT%,server=y,suspend=n -Djava.compiler=NONE
).
YOU SHOULD NOT BE HACKING THESE SCRIPTS. It's going to make deployment and maintenance hard, the entire purpose of the setDomainEnv
script is so that the right defaults are used and maintained across the cluster and throughout the entire environment. They are poorly documented I admit.
Note, if you are using the Oracle weblogic maven plugin, the target wls:deploy
or wls:start-server
will then pick up those environment settings when starting because they call the commands under the hood, and those in turn first call setDomainEnv
.
As of right now, if you are using eclipse and have set up a Oracle WebLogicServer, the maven plugin will not attach to it into debug mode when you issue a mvn:deploy
, you can either restart it in debug mode (silly), or create a 'Run ==> Debug ==> DebugConfigurations ==> RemoteJavaApplication' with a connection type of 'standard (socket attach)', a host of 'localhost' (or the remote server) and a port (default for me is '8453'). You can then do Run ==> Debug Configurations ==> Local Server Attach
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With