Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2004-11-29
5
Medium Priority
?
419 Views
Last Modified: 2012-08-13


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.
0
Comment
Question by:Steve34
  • 3
  • 2
5 Comments
 
LVL 13

Accepted Solution

by:
petmagdy earned 1500 total points
ID: 12699221
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
 

Author Comment

by:Steve34
ID: 12768779
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
 
LVL 13

Assisted Solution

by:petmagdy
petmagdy earned 1500 total points
ID: 12769840
yes as long as u specify the right configured debbuging port in ur compiler or IDE (not the HTTP port offourse)
0
 

Author Comment

by:Steve34
ID: 12826667
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
 
LVL 13

Expert Comment

by:petmagdy
ID: 12827569
if u have the servlet source, put break points inside ur servlet
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month15 days, 11 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question