Tuesday, April 21, 2009

Forcing WebLogic to run in debug mode

I was working with a WebLogic installation the other day that I simply could not get to start in debug mode from Eclipse. This story is to share that experience in case anyone else runs into a similar problem. The initial symptom was that Eclipse (i.e. Workshop) would not recognize WebLogic as running in debug mode; it complained of a port not being open (the debug port).

Well, here is what the WebLogic server console was giving me:
WLS Start Mode=Production
.

Starting WLS with line:
C:\bea\JROCKI~1\bin\java -jrockit [missing some parameters] -Xms256m -Xmx512m…
That's never going to start in debug mode, because Production mode precludes debug mode. I needed to get the server to start in Development mode first.

I ended up having to go through my server startup (*.cmd or *.sh) and config (*.xml) files looking for things like this:
set PRODUCTION_MODE=true
...or this:
<setenv name="PRODUCTION_MODE">
<value>true</value>
</setenv>
...and changing them from true to false. I had used a customized installer which probably had set them to true.

That finally did the trick; now when I started the server in debug mode in Eclipse, I got the following in the server console:
WLS Start Mode=Development
.

Starting WLS with line:
C:\bea\JROCKI~1\bin\java -jrockit -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socke
t,address=8453,server=y,suspend=n -Djava.compiler=NONE -Xms256m -Xmx512m…
And the Eclipse debugger can now talk to the server.
Copyright 2011 by William Cain