Debugging under JBoss and JRun

Does as step-by-step description of how to configure Idea 3.0 for debugging applications running under JBoss and JRun? Something along the lines of the Phasesoft tutorial for Tomcat under Idea 2.6. I search the forums and can find snippets here and there but nothing that spells the whole process out. We're moving from straight Tomcat to JBoss and JRun and I don't want to lose the ability to step through my applications. Thanks

15 comments
Comment actions Permalink

What version of JRun? I don't know anything about JBoss but I can give you
instructions for debugging with JRun.

"Ron Richards" <rwrjr@comcast.net> wrote in message
news:443451.1036622990841.JavaMail.jrun@is.intellij.net...

Does as step-by-step description of how to configure Idea 3.0 for

debugging applications running under JBoss and JRun? Something along the
lines of the Phasesoft tutorial for Tomcat under Idea 2.6. I search the
forums and can find snippets here and there but nothing that spells the
whole process out. We're moving from straight Tomcat to JBoss and JRun and
I don't want to lose the ability to step through my applications. Thanks


0
Comment actions Permalink

We're deploying against JRun4 as one target environment and here's what I
did:

1. Install IDEA
2. Install JRun4
3. Apply JRun4 Service Pack 1
4. Goto $JRUN_HOME/bin
5. Copy jvm.config to jvm.config.bak
6. Using the editor of your choice, open jvm.config
7. Locate the line starting "java.args"
8. Set this line to the following:

java.args=-Xmx128M -Xms128m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp
:transport=dt_socket,server=y,suspend=n,address=5005

(all on one line)
(change settings for -Xmx and -Xms as needed)

9. Save the file
10. Launch IDEA
11 Open your project
12 To the left of the Run Icon in the tool bar is a drop down, select Edit
entries
13 Select the Remote Tab
14 Add a new debug config by clicking on the + symbol
15 Provide a name
16 Transport should be set to Socket
17 Debugger mode should be set to Attach
18 Host should be set to the hostname of the running JRun4 (localhost if
you're running locally)
19Port should be set to 5005
20 Set two checkboxes as desired
21 Say Apply
22 Press OK

To start a debugging session
1. Build project
2. Deploy to JRun4 (we build as an EAR file and deploy to an auto-deploy
directory)
3. Start JRun4 running the appropriate server (i.e. jrun -start default)
4. Wait for JRun4 to start fully
5. From IDEA, set breakpoints as needed
6.Slect the debug session we created above in the dropdown
7.Mash the debug icon.
8. Do something to reach your break point (i.e. if debugging a servlet, open
a web browser, etc.)
9. Debug as normal.
10. Note that pressing STOP in the debugger will shutdown JRun4.

rob.

"Ron Richards" <rwrjr@comcast.net> wrote in message
news:443451.1036622990841.JavaMail.jrun@is.intellij.net...

Does as step-by-step description of how to configure Idea 3.0 for

debugging applications running under JBoss and JRun? Something along the
lines of the Phasesoft tutorial for Tomcat under Idea 2.6. I search the
forums and can find snippets here and there but nothing that spells the
whole process out. We're moving from straight Tomcat to JBoss and JRun and
I don't want to lose the ability to step through my applications. Thanks


0
Comment actions Permalink

What version of JRun?


JRun 4.0 with SP1

0
Comment actions Permalink

Very good instructions. Better than I could have done.

"Robert Hedin" <robert@ndsapps.com> wrote in message
news:aqe17c$q31$1@is.intellij.net...

We're deploying against JRun4 as one target environment and here's what I
did:

>

1. Install IDEA
2. Install JRun4
3. Apply JRun4 Service Pack 1
4. Goto $JRUN_HOME/bin
5. Copy jvm.config to jvm.config.bak
6. Using the editor of your choice, open jvm.config
7. Locate the line starting "java.args"
8. Set this line to the following:

>
>
java.args=-Xmx128M -Xms128m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp

:transport=dt_socket,server=y,suspend=n,address=5005

>

(all on one line)
(change settings for -Xmx and -Xms as needed)

>

9. Save the file
10. Launch IDEA
11 Open your project
12 To the left of the Run Icon in the tool bar is a drop down, select Edit
entries
13 Select the Remote Tab
14 Add a new debug config by clicking on the + symbol
15 Provide a name
16 Transport should be set to Socket
17 Debugger mode should be set to Attach
18 Host should be set to the hostname of the running JRun4 (localhost if
you're running locally)
19Port should be set to 5005
20 Set two checkboxes as desired
21 Say Apply
22 Press OK

>

To start a debugging session
1. Build project
2. Deploy to JRun4 (we build as an EAR file and deploy to an auto-deploy
directory)
3. Start JRun4 running the appropriate server (i.e. jrun -start default)
4. Wait for JRun4 to start fully
5. From IDEA, set breakpoints as needed
6.Slect the debug session we created above in the dropdown
7.Mash the debug icon.
8. Do something to reach your break point (i.e. if debugging a servlet,

open

a web browser, etc.)
9. Debug as normal.
10. Note that pressing STOP in the debugger will shutdown JRun4.

>

rob.

>

"Ron Richards" <rwrjr@comcast.net> wrote in message
news:443451.1036622990841.JavaMail.jrun@is.intellij.net...

Does as step-by-step description of how to configure Idea 3.0 for

debugging applications running under JBoss and JRun? Something along the
lines of the Phasesoft tutorial for Tomcat under Idea 2.6. I search the
forums and can find snippets here and there but nothing that spells the
whole process out. We're moving from straight Tomcat to JBoss and JRun

and

I don't want to lose the ability to step through my applications. Thanks

>
>


0
Comment actions Permalink

10. Note that pressing STOP in the debugger will shutdown JRun4.


Actually it will first ask whether you would like to terminate JRun or to
disconnect from it. Answering "no" will keep JRun running.

--

Best regards,
Eugene Zhuravlev
JetBrains Inc., http://www.intellij.com
"Develop with pleasure!"



"Robert Hedin" <robert@ndsapps.com> wrote in message
news:aqe17c$q31$1@is.intellij.net...

We're deploying against JRun4 as one target environment and here's what I
did:

>

1. Install IDEA
2. Install JRun4
3. Apply JRun4 Service Pack 1
4. Goto $JRUN_HOME/bin
5. Copy jvm.config to jvm.config.bak
6. Using the editor of your choice, open jvm.config
7. Locate the line starting "java.args"
8. Set this line to the following:

>
>
java.args=-Xmx128M -Xms128m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp

:transport=dt_socket,server=y,suspend=n,address=5005

>

(all on one line)
(change settings for -Xmx and -Xms as needed)

>

9. Save the file
10. Launch IDEA
11 Open your project
12 To the left of the Run Icon in the tool bar is a drop down, select Edit
entries
13 Select the Remote Tab
14 Add a new debug config by clicking on the + symbol
15 Provide a name
16 Transport should be set to Socket
17 Debugger mode should be set to Attach
18 Host should be set to the hostname of the running JRun4 (localhost if
you're running locally)
19Port should be set to 5005
20 Set two checkboxes as desired
21 Say Apply
22 Press OK

>

To start a debugging session
1. Build project
2. Deploy to JRun4 (we build as an EAR file and deploy to an auto-deploy
directory)
3. Start JRun4 running the appropriate server (i.e. jrun -start default)
4. Wait for JRun4 to start fully
5. From IDEA, set breakpoints as needed
6.Slect the debug session we created above in the dropdown
7.Mash the debug icon.
8. Do something to reach your break point (i.e. if debugging a servlet,

open

a web browser, etc.)
9. Debug as normal.
10. Note that pressing STOP in the debugger will shutdown JRun4.

>

rob.

>

"Ron Richards" <rwrjr@comcast.net> wrote in message
news:443451.1036622990841.JavaMail.jrun@is.intellij.net...

Does as step-by-step description of how to configure Idea 3.0 for

debugging applications running under JBoss and JRun? Something along the
lines of the Phasesoft tutorial for Tomcat under Idea 2.6. I search the
forums and can find snippets here and there but nothing that spells the
whole process out. We're moving from straight Tomcat to JBoss and JRun

and

I don't want to lose the ability to step through my applications. Thanks

>
>


0
Comment actions Permalink

Thanks Robert and Eugene. Works perfectly. I like being able to run outside the debugger and attaching only when I need to step through the code. I'm loving IDEA more every day I use it.

Ron

10. Note that pressing STOP in the debugger will

shutdown JRun4.

Actually it will first ask whether you would like to
terminate JRun or to
disconnect from it. Answering "no" will keep JRun
running.

--

Best regards,
Eugene Zhuravlev

0
Comment actions Permalink

Great instructions and easy to follow - but for some reason it just goes through my breakpoints without stopping.

I am running JRun4 SP1 and IDEA successfully attaches to the port; when I stop the debugging session, it does shut down JRun. So I know that it is communicationing with the server via port 5005.

Unfortunately it doesn't stop at the break point. And the weird thing is that after it goes past the selected breakpoint, the breakpoint is displayed with a green X (non-reachable) and then every break point I try to set after that (anywhere in the middle ware - not jsps) is "non reachable" with that green "x".

I have all the defaults set like suspend VM and generate debug info.

My setup is configured with jars and a web directory (so that I don't have to rebuild a war or ear every time a jsp is changed). I don't know if this is an issue, i.e. not using an ear file but it doesn't seem like it would be.

Any help/insight is greatly appreciated! thanks :o)

~Chiara

0
Comment actions Permalink

That's strange-- break points work for me with the same config.

my machine died and am (still) trying to get everything set back up, but
I'll see what I can figure out tonight.

rob.

"Chiara Gelinas" <jiveadmin@intellij.net> wrote in message
news:294321.1037910355783.JavaMail.jrun@is.intellij.net...

Great instructions and easy to follow - but for some reason it just goes

through my breakpoints without stopping.
>

I am running JRun4 SP1 and IDEA successfully attaches to the port; when I

stop the debugging session, it does shut down JRun. So I know that it is
communicationing with the server via port 5005.
>

Unfortunately it doesn't stop at the break point. And the weird thing is

that after it goes past the selected breakpoint, the breakpoint is displayed
with a green X (non-reachable) and then every break point I try to set after
that (anywhere in the middle ware - not jsps) is "non reachable" with that
green "x".
>

I have all the defaults set like suspend VM and generate debug info.

>

My setup is configured with jars and a web directory (so that I don't have

to rebuild a war or ear every time a jsp is changed). I don't know if this
is an issue, i.e. not using an ear file but it doesn't seem like it would
be.
>

Any help/insight is greatly appreciated! thanks :o)

>

~Chiara

>
>


0
Comment actions Permalink

I tried using Weblogic 6.1 as well by modifying the startWebLogic.cmd file and again, IDEA attaches to the port opened by the server, but just zips by the breakpoints.

So - it looks like it's not really a server-related thing (unless both servers have the same error/bug - but that seems a little unlikely) and something with the IDE. Maybe my settings are messed up or something? maybe the way the jars are built?

~Chiara

0
Comment actions Permalink

Hi Chiara,

Unfortunately it doesn't stop at the break point. And the weird thing is

that after it goes past the selected breakpoint, the breakpoint is displayed
with a

green X (non-reachable) and then every break point I try to set after that

(anywhere in the middle ware - not jsps) is "non reachable" with that green
"x".

Crossed breakpoints does not mean that they are "unreacheable", it means
that the breakpoint is "invalid", i.e. there's no executable code at the
breakpoint's line. Please make sure that sources you edit and classes you
actually run are in sync.

--

Best regards,
Eugene Zhuravlev
JetBrains, Inc, http://www.intellij.com
"Develop with pleasure!"


0
Comment actions Permalink

I'm not entirely sure what you mean by "in sync". We use an ant script to compile code and the create jars (which I then copy into the server's hot deploy directory of jrun).

I was actually wondering about whether or not the ant script my team is using could be the issue. We have like I think 10 or 12 jars (I can't remember exactly) but each jar target actually takes the classes needed from the output classes directory (which is the same as IDEA's in my case), copies them into a temp directory - jars it up from the temp, then dumps the jar into a bin directory, and finally deletes the temp directory (which had all the compiled classes).

Might it not work because of the copying of the compiled classes to another directory (temp), jar-ing it from there, and then basically deleting the classes?

I read somewhere that the classes have to be the "same", and it actually crossed my mind that same also meant same location... but copying the jars to the jrun dir should be ok, right?

Thanks so much for your help! greatly appreciated :)

~Chiara

0
Comment actions Permalink

Make sure that the javac task in your ant build file has the attribute debug
set to 'Yes'.

"Chiara Gelinas" <jiveadmin@intellij.net> wrote in message
news:4960373.1037991911707.JavaMail.jrun@is.intellij.net...

I'm not entirely sure what you mean by "in sync". We use an ant script to

compile code and the create jars (which I then copy into the server's hot
deploy directory of jrun).
>

I was actually wondering about whether or not the ant script my team is

using could be the issue. We have like I think 10 or 12 jars (I can't
remember exactly) but each jar target actually takes the classes needed from
the output classes directory (which is the same as IDEA's in my case),
copies them into a temp directory - jars it up from the temp, then dumps the
jar into a bin directory, and finally deletes the temp directory (which
had all the compiled classes).
>

Might it not work because of the copying of the compiled classes to

another directory (temp), jar-ing it from there, and then basically deleting
the classes?
>

I read somewhere that the classes have to be the "same", and it actually

crossed my mind that same also meant same location... but copying the jars
to the jrun dir should be ok, right?
>

Thanks so much for your help! greatly appreciated :)

>

~Chiara

>


0
Comment actions Permalink

That was it! Had to be something silly like "turn debug on" except it was the build.xml that was the culprit (I kept reading posts about generate debug info selection with IDEA compiler which I had done, but I forgot about ant's javac task).

Thanks again - debugging is working fabulously - just as good as JBuilder (faster too). not to mention about 2600 bucks cheaper

~Chiara

0
Comment actions Permalink

We followed your detailed instructions here and they worked great, but also found another way: You can set up jrun as a local application and it will run/debug from within IDEA. I read that some people like being able to attach the debuggin session at will, but I prefer to run locally because that way I can press one button to build (using an ant target), start up, and debug. Also, debugging is a lot faster this way (no delay at all when stepping from line to line). Of course, you'll need to have JRun running in the same machine.

Here's what I did:

- Created a class within my source dir with a one-line main() which calls JRun, like this:

public class jrunWrapper {
public static void main(String[] args) {
try {
jrunx.kernel.JRun.main(args);
} catch (Exception e) {
e.printStackTrace();
}
}
}

- Setup a Run/Debug configuration under Application (not Remote) as follows:
-Main class: jrunWrapper (or whatever you called your class)
-VM Params:
-Prog Params: -start
-Working dir:

To use it, just select this configuration in the dropdown and press the debug button. It will start JRun and be ready for debugging. Optionally, right-click on your main ant build target and select 'Execute On|Before Run/Debug' to build automatically.

Note that startup takes longer when you press debug vs. run, but in my case it is worth it because stepping is so much faster. regards,

-mauricio

0
Comment actions Permalink

Brad you are a life-saver. I've been pulling my hair out trying to debug a JBoss 4/Tomcat server and now I've got a way. Thanks! :)

0

Please sign in to leave a comment.