问题
Hello I saw some 11g tutorials with a Google search:
http://saltnlight5.blogspot.com/2014/04/how-to-setup-remote-debug-with-weblogic.html
http://java.dzone.com/articles/how-setup-remote-debug
They both specify adding something like: JAVA_OPTIONS="$JAVA_OPTIONS -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"
Two questions I have is:
One, at my work we have domains/domainName/bin/setDomainEnv.sh and in the same "domainName" directory another folder called servers, with a bunch of our servers on it. I am not an expert in infrastructure but I am looking for a way to remotely debug an application on Weblogic through Eclipse that is located on one of the servers. What is the best way to sync up the one server and its application with Eclipse rather than effecting all of the severs (unless I am misunderstanding).
Second, is there not a way to set this up through the Weblogic Administration Console? I tried looking around for anything intuitive, but nothing stood out.
回答1:
If you are starting your servers with NodeManager, you should be able to add the arguments to "Arguments" in the Weblogic Admin Console under:
Environment -> Servers -> Your Server -> Configuration (tab) -> Server Start (sub-tab)
回答2:
setDomainEnv
- set debugFlag="true"
and every server you start will listen on the port specified, allowing remote debug connections.
Inside of Eclipse, select, Run > Debug Configuration
and then select Remote Java Application
Choose the host your server runs on with the port from setDomainEnv
- This will affect all servers, so if you have two running on the same host you will have a port conflict. You can do something simple like putting an
if
statement intosetDomainEnv
so the debug is only turned on for a specificSERVER_NAME
<domain>/servers
- this is the folder where weblogic caches security information, application information, startup params, etc for each server. You shouldn't be manipulating this directly on the file system
Another thing that may be of interest to you it the Oracle Enterprise Pack for Eclipse (OEPE). It allows you to start/stop servers directly from Eclipse as well as additional debug support.
Sample from my setDomainEnv.sh
:
debugFlag="true"
export debugFlag
JAVA_DEBUG=""
export JAVA_DEBUG
if [ "${debugFlag}" = "true" ] ; then
JAVA_DEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n -Djava.compiler=NONE"
export JAVA_DEBUG
JAVA_OPTIONS="${JAVA_OPTIONS} ${enableHotswapFlag} -ea -da:com.bea... -da:javelin... -da:weblogic... -ea:com.bea.wli... -ea:com.bea.broker... -ea:com.bea.sbconsole..."
export JAVA_OPTIONS
fi
来源:https://stackoverflow.com/questions/28163130/weblogic-10-3-3-0-application-debugging-with-eclipse