Posted by: peteinman | December 8, 2009

IntelliJ – Debugging with WebLogic 8.1

Here’s how to set up the debugger with IntelliJ so that you can debug applications whilst they are running inside the app server.

In this case, I’m looking at WebLogic 8.1, but WebLogic 11g works in the same way.

1) JVM Debug Port

The first thing you need is a debug port configured no the JVM you’re going to attach a debugger to.

IntelliJ further down will give details of the JVM configuration options you need, but these are also here

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005

They should be added to the JVM arguments used when starting the server.

2) Configure IntelliJ

The next thing which needs to be done is to tell IntelliJ what application server you’re using and what port to connect to.

From the IDE, select Run|Edit Configurations

image

Then click the image sign at the top of the screen

image

Select the “Remote” option

image 

In this screen, name the configuration something like WebLogic81 for example

image

and leave everything else as default options. This assumes a debug port of 5005.

3) Debugging

With the project loaded into the IntelliJ IDE, click in the “margin” to add a breakpoint as shown below

image

Now, click on the debug symbol to the right of the run configuration on the toolbar

image

The run dialog should be displayed, click the debug button and then run the application. You should have a window at the bottom of the IDE which shows

image

As soon as your code hits the breakpoint, the debugger will be invoked and you will have access to the normal debugging facilities.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: