Jrun, Java Debugger: Getting them to play with each other



Hi;

A company I am working for is using JRun 3 ( they have
plans for moving to JRun 4, but it is going to take a
while ).

I am using a multipurpose IDE called Visual Slickedit 9.0
that comes with a java debugger ( it looks like a front
end to the jdk that comes with the jsdk ).

I am having trouble attaching the debugger to the remote
jvm for a JRun webapp/site.

The directions (below) that come with Visual Slickedit call
for feeding the remote vm some special arguments and
restarting it.

I am going to the "java arguments" field in my web app and
inserting the following string ( adjusting for the port
of the web app):


-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000

Once I do however, I can't get the webapp to restart.

Do I need to prepend "java" to the string above?

If not, what do I need to do to get the java debugger
and the JRun 3 web app talking to each other?

Thanks in advance for any insights or information.

Steve







( from the slickedit help section ):


Attaching to a Remote VM (Java Only)

To attach to a remote VM:

1. Start the remote VM with command arguments similar to the following:

Java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,

suspend=y,address=8000 MainClass Arg1 Arg2

2. Choose Attach to Remote VM\u2026 from the Debug menu.
Steve34Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

petmagdyCommented:
I don't know what u mean by:
>>I am going to the "java arguments" field in my web app and
inserting the following string ...
?

but what i know that u should modify ur JRUN startup batch to add this to the JRun JVM initiator
1. Goto $JRUN_HOME/bin
2. Copy jvm.config to jvm.config.bak
3. Using the editor of your choice, open jvm.config
4. Locate the line starting "java.args"
5. 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)

6. Save the file

restart JRUN

then configure ur IDE to use the debug method as u say:
>>2. Choose Attach to Remote VM\u2026 from the Debug menu.

for more info refer:

http://www.intellij.net/forums/thread.jsp?forum=4&thread=16481&tstart=0&trange=15

configuring the JRUN to support remote debbuging is the same no matters what IDE u use
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Steve34Author Commented:
by "java arguments"  I mean a text field in the JRun administrator website you get with JRun

Within my admin page I have several "servers" set up, each with what jrun calls a web app, an actual site.

Each thing JRun ( 3.0 ) calls a server has a javascrpt tree that will bring up a web form for configuring it.  "java arguments" is such a field.

>>>>>>>>>>>>>>>
but what i know that u should modify ur JRUN startup batch to add this to the JRun JVM initiator
1. Goto $JRUN_HOME/bin
2. Copy jvm.config to jvm.config.bak
>>>>>>>>>>>>>>>>>>>>>>>

I have no such path/file with  Jrun 3.0 installation.

However I did find "java.arg" in JRUN_HOME\servers\MyServer\local.properties

I put your string in, but I got a 'port is in use' error when I put the port  of the "server"  or web app in.   I got it to work using a completely new port number.    Will the debugger go to the right place?

The debugger wouldn't let me set a break point at a variable in my *.jsp that was outside of a function.   Is there a way around this?

For servlest, I guess I would just set my breakpoint in doGet or doPost right?

Almost there, thanks the help

Steve
0
petmagdyCommented:
yes as long as u specify the right configured debbuging port in ur compiler or IDE (not the HTTP port offourse)
0
Steve34Author Commented:
I got it working for a JSP.

How would I debug a jsp site that also uses a servlet that is packed in a jar?

Could I use any copy of the *.java file for the service to run the debugger?
0
petmagdyCommented:
if u have the servlet source, put break points inside ur servlet
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.