Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / September 2004

Tip: Looking for answers? Try searching our database.

Debugging

Thread view: 
Peter Bradley - 18 Feb 2004 19:37 GMT
Hi everyone,

I've posted about this before, and had some help, but have unfortunately not
been able to solve the problem.  I have a little more info now, so perhaps
we might have more luck this time.

On my WinXP Professional box at home, I can't get the debugger to start from
within any of my IDEs.  The reason for this is that the IDE tries to use a
socket transport.  Now there is no reason for it to do this, and I can't see
where I can change it.  I get the same error using NetBeans 3.5.1, NetBeans
3.6 Beta, Borland JBuilder, and Eclipse.  I do not get the error if I boot
into my Linux partition on the same box, nor do I get the error on my W2K
Server box at work.

On my last attempt, I did look in the knowledge base which talked about
using a J2sdk path with no spaces in it.  As you can see below, the path has
no spaces.  Also NetBeans 3.5.1 is installed at:

C:\j2sdk_nb\netbeans3.5.1\bin\runidew.exe

Also with no spaces.

I'll concentrate on the info I can glean from NetBeans 3.5.1, but you can
rest assured that it is the same for all the others as well.

When I try to run in the debugger, I get (after a long pause) the following
error message:

Exception while starting debugger:
Cannot start process C:\j2sdk_nb\j2sdk1.4.2\bin\java.
java.io.IOException: VM initialization failed

The command the IDE is trying to execute  - shown in the output window - is
(with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_soc
ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath
"--- classpath goes in here ---" <package_name>.<class_name>

The error message returned in the output window is:

err:: No such file or directory
Error [2] in connect() call!
Socket transport failed to init.
Transport dt_socket failed to initialize, rc = -1.

Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_shm
em,address=jdbconn,server=y,suspend=y -Djava.compiler=NONE -classpath "---
same classpath as above ---" <package_name>.<class_name>

the command executes fine and I am able to attach to this VM in my IDE and
use the debugger.  Which is a workaround of sorts, but less than
satisfactory (in my opinion).

Having tried to run the command and failed, NetBeans sends me to the
configuration dialog for the debugger, where it tells me that the command it
is trying to execute is:

{jdk.home}{/}bin{/}java

The arguments being passed are:

{classic}{assertEnabled}{debuggerOptions} -Djava.compiler=NONE -classpath
{q}{filesystems}{q} {main}

Both {classic} and {assertEnabled} are false.  I can't find any way to
configure the other options.  So the next thing I tried was to replace, in
the configuration dialog, the {debuggerOptions} placeholder (or whatever it
is) with the actual values I know work from the command line, i.e.:

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_shmem,address=jdbconn,server=y,susp
end=y

This causes the IDE to hang.  It won't even refresh the screen.  Dead.

So, that's the history.

If anyone can throw any light on this, or help in any way I'd be most
grateful.

Thanks in advance

Peter
Peter Bradley - 18 Feb 2004 21:24 GMT
Hi All,

I apologise for following up my own message, but I've a little more
information.

I've now succeeded in altering the command used to start the debugger in the
IDE.  Following the instructions in the help files, I've changed it to:

C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=dt
_shmem,server=y,address=jdbconn,suspend=n -Djava.compiler=NONE -classpath
"<the_classpath>" <the_package>.<the_class>

I now get no error when I select to run in the debugger, but the debug
process shows as having a status of "starting" in the debug window.  It
never moves on from there.  The program starts, but not under the control of
the debugger.  When I finish the program an error message appears:

Exception while starting debugger
Cannot start process: C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe.
java.io.IOException: VM initialization failed

The frustrating thing is that it did actually work for me once, but I can't
reproduce it!

Cheers

Peter

> Hi everyone,
>
[quoted text clipped - 30 lines]
> The command the IDE is trying to execute  - shown in the output window - is
> (with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_soc
> ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath
> "--- classpath goes in here ---" <package_name>.<class_name>
[quoted text clipped - 7 lines]
>
> Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_shm
> em,address=jdbconn,server=y,suspend=y -Djava.compiler=NONE -classpath "---
> same classpath as above ---" <package_name>.<class_name>
[quoted text clipped - 32 lines]
>
> Peter
Robert Klemme - 19 Feb 2004 08:21 GMT
You didn't install a firewall in the meantime or had a virus, did you?
Otherwise I don't have an idea currently.  Sorry.

   robert

> Hi All,
>
[quoted text clipped - 3 lines]
> I've now succeeded in altering the command used to start the debugger in the
> IDE.  Following the instructions in the help files, I've changed it to:

C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=
dt

_shmem,server=y,address=jdbconn,suspend=n -Djava.compiler=NONE -classpath
> "<the_classpath>" <the_package>.<the_class>
>
[quoted text clipped - 55 lines]
> is
> > (with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
oc

ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath
> > "--- classpath goes in here ---" <package_name>.<class_name>
> >
[quoted text clipped - 6 lines]
> >
> > Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
hm
> > em,address=jdbconn,server=y,suspend=y -Djava.compiler=NONE -classpath "---
> > same classpath as above ---" <package_name>.<class_name>
[quoted text clipped - 11 lines]
> >
> > The arguments being passed are:

{classic}{assertEnabled}{debuggerOptions} -Djava.compiler=NONE -classpath
> > {q}{filesystems}{q} {main}
> >
[quoted text clipped - 18 lines]
> >
> > Peter
David Rabinowitz - 19 Feb 2004 09:10 GMT
Another idea - is your Path contains your %JAVA_HOME%\bin folder? (do
you have JAVA_HOME?) perhaps he does not where to find the correct DLL.

David

> You didn't install a firewall in the meantime or had a virus, did you?
> Otherwise I don't have an idea currently.  Sorry.
[quoted text clipped - 205 lines]
>>>
>>>Peter
Peter Bradley - 19 Feb 2004 18:44 GMT
Thanks for the replies guys, but no joy.

Defined JAVA_HOME, but no change.

I checked my installation at work (W2K Server), and according to that, the
debugger there -runs the command:

C:\Program
Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_
socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
"<classpath>" <package>.<class>

and this works fine on that installation.  So I tried it on this
installation (changing the hostname of course), but no luck.

All very frustrating.  It has to be something to do with my XP installation,
because it affects every IDE just the same.  Yet jdb runs just fine from the
command line.

So there we are.  I'm still open for ideas, and I'll try anything.  Maybe if
no-one can come up with anything, I'll leave it a month or two and then post
again.  Someone must know the answer.  I've always been an optimist

=8^D

Thanks again.

Cheers

Peter

> Another idea - is your Path contains your %JAVA_HOME%\bin folder? (do
> you have JAVA_HOME?) perhaps he does not where to find the correct DLL.
[quoted text clipped - 16 lines]
> >
> >>IDE.  Following the instructions in the help files, I've changed it to:

C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=
> > dt

_shmem,server=y,address=jdbconn,suspend=n -Djava.compiler=NONE -classpath

> >>"<the_classpath>" <the_package>.<the_class>
> >>
[quoted text clipped - 103 lines]
> >>
> >>>(with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > oc

ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath

> >>>"--- classpath goes in here ---" <package_name>.<class_name>
> >>>
[quoted text clipped - 6 lines]
> >>>
> >>>Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > hm
> >
[quoted text clipped - 23 lines]
> >>>
> >>>The arguments being passed are:

{classic}{assertEnabled}{debuggerOptions} -Djava.compiler=NONE -classpath

> >>>{q}{filesystems}{q} {main}
> >>>
[quoted text clipped - 29 lines]
> >>>
> >>>Peter
Tom N - 24 Feb 2004 03:16 GMT
Did you try disabling the firewall if you have one, as was suggested?

The error message you get is identical to the one I get if I use the
firewall to block access from javaw.exe to a port on my PC (it uses the
ISP-assigned address, not a local address e.g. 127.0.0.1).

> Thanks for the replies guys, but no joy.
>
[quoted text clipped - 4 lines]
>
> C:\Program

Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_
> socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
> "<classpath>" <package>.<class>
[quoted text clipped - 232 lines]
> > >>>
> > >>>Peter
Peter Bradley - 24 Feb 2004 18:32 GMT
Hi Tom,

Well, I'm not too familiar with how you check these things in XP, but I've
looked at services under Administrative Tools, and for Internet Connection
Firewall, it says "Manual", which I believe means it's disabled (or at least
not started).

No doubt you'll let me know if I'm incorrect here.

Cheers

Peter

> Did you try disabling the firewall if you have one, as was suggested?
>
[quoted text clipped - 10 lines]
> >
> > C:\Program

Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_
> > socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
> > "<classpath>" <package>.<class>
[quoted text clipped - 44 lines]
> > > >>IDE.  Following the instructions in the help files, I've changed it
> to:

C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=
> > > > dt

_shmem,server=y,address=jdbconn,suspend=n -Djava.compiler=NONE -classpath

> > > >>"<the_classpath>" <the_package>.<the_class>
> > > >>
[quoted text clipped - 104 lines]
> > > >>
> > > >>>(with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > > > oc

ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath

> > > >>>"--- classpath goes in here ---" <package_name>.<class_name>
> > > >>>
[quoted text clipped - 6 lines]
> > > >>>
> > > >>>Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > > > hm
> > >
[quoted text clipped - 24 lines]
> > > >>>
> > > >>>The arguments being passed are:

{classic}{assertEnabled}{debuggerOptions} -Djava.compiler=NONE -classpath

> > > >>>{q}{filesystems}{q} {main}
> > > >>>
[quoted text clipped - 31 lines]
> > > >>>
> > > >>>Peter
Robert Klemme - 25 Feb 2004 12:41 GMT
> Hi Tom,
>
> Well, I'm not too familiar with how you check these things in XP, but I've
> looked at services under Administrative Tools, and for Internet Connection
> Firewall, it says "Manual", which I believe means it's disabled (or at least
> not started).

Interesting.  My XP knows only "on" and "off" for the firewall.  You sure
you got the right switch?

   robert

> No doubt you'll let me know if I'm incorrect here.
>
[quoted text clipped - 17 lines]
> > >
> > > C:\Program

Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=d
t_
> > > socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
> > > "<classpath>" <package>.<class>
[quoted text clipped - 48 lines]
> > > > >>IDE.  Following the instructions in the help files, I've changed it
> > to:

C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=
> > > > > dt

_shmem,server=y,address=jdbconn,suspend=n -Djava.compiler=NONE -classpath

> > > > >>"<the_classpath>" <the_package>.<the_class>
> > > > >>
[quoted text clipped - 110 lines]
> > > > >>
> > > > >>>(with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > > > > oc

ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath

> > > > >>>"--- classpath goes in here ---" <package_name>.<class_name>
> > > > >>>
[quoted text clipped - 6 lines]
> > > > >>>
> > > > >>>Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > > > > hm
> > > >
[quoted text clipped - 25 lines]
> > > > >>>
> > > > >>>The arguments being passed are:

{classic}{assertEnabled}{debuggerOptions} -Djava.compiler=NONE -classpath

> > > > >>>{q}{filesystems}{q} {main}
> > > > >>>
[quoted text clipped - 32 lines]
> > > > >>>
> > > > >>>Peter
Tom N - 25 Feb 2004 14:46 GMT
> Well, I'm not too familiar with how you check these things in XP, but I've
> looked at services under Administrative Tools, and for Internet Connection
> Firewall, it says "Manual", which I believe means it's disabled (or at least
> not started).

For the Windows XP built-in firewall, I'd look at Control Panel -> Network
Connections, select each LAN card and look at Advanced tab to see if
"Internet Connection Firewall" is ticked.

Whether the service is started is not relevant to whether it is enabled on a
connection.  I think Manual service starting doesn't mean it is disabled -
that's what "Disabled" means surprisingly enough.

However the Windows XP built-in firewall doesn't prevent outgoing
connections - it only controls incoming unsolicited connections.

It sounds like you have another firewall running. e.g ZoneAlarm, Kerios,
Black Ice Defender, Norton Internet Security, or perhaps a virus scanner
that also acts as a firewall - quite a few of them do these days.  e.g.
PC-Cillin.

I have Windows XP built-in firewall running and it has no special config for
java debugging.  I also have Kerios firewall running for outgoing
connections and that is what stops the debugger if I let it.

> > Did you try disabling the firewall if you have one, as was suggested?
> >
[quoted text clipped - 11 lines]
> > >
> > > C:\Program

Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_
> > > socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
> > > "<classpath>" <package>.<class>
[quoted text clipped - 254 lines]
> > > > >>>
> > > > >>>Peter
Peter Bradley - 25 Feb 2004 19:04 GMT
Hi Tom and Robert

I checked each LAN card and my DSL connection.  Internet Connection Firewall
was not ticked on any of these.

I changed the service setting from Manual to Disabled and tried the debugger
again.  No joy.  Same error.

I've now set the firewall "on" by the way.  Must be suicidal running a
Windows box without one, I'm told.

Cheers,

Peter

> > Well, I'm not too familiar with how you check these things in XP, but I've
> > looked at services under Administrative Tools, and for Internet Connection
[quoted text clipped - 37 lines]
> > > >
> > > > C:\Program

Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_
> > > > socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
> > > > "<classpath>" <package>.<class>
[quoted text clipped - 53 lines]
> it
> > > to:

C:\j2sdk_nb\j2sdk1.4.2\bin\java.exe -Xdebug -Xnoagent -Xrunjdwp:transport=
> > > > > > dt

_shmem,server=y,address=jdbconn,suspend=n -Djava.compiler=NONE -classpath

> > > > > >>"<the_classpath>" <the_package>.<the_class>
> > > > > >>
[quoted text clipped - 118 lines]
> > > > > >>
> > > > > >>>(with the bulk of the classpath cut out to save space):

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > > > > > oc

ket,address=cymro-ffenestri:1114,suspend=y -Djava.compiler=NONE -classpath

> > > > > >>>"--- classpath goes in here ---" <package_name>.<class_name>
> > > > > >>>
[quoted text clipped - 6 lines]
> > > > > >>>
> > > > > >>>Now, if I open a command window and do:

C:\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_s
> > > > > > hm
> > > > >
[quoted text clipped - 26 lines]
> > > > > >>>
> > > > > >>>The arguments being passed are:

{classic}{assertEnabled}{debuggerOptions} -Djava.compiler=NONE -classpath

> > > > > >>>{q}{filesystems}{q} {main}
> > > > > >>>
[quoted text clipped - 34 lines]
> > > > > >>>
> > > > > >>>Peter
Peter Bradley - 08 Apr 2004 22:38 GMT
Hi guys and gals,

Just a note to say that this debugger problem has gone away with
NetBeans3.6RC3.  Hope this helps anyone else who's been suffering from the
same problems

Peter

> Hi Tom and Robert
>
[quoted text clipped - 58 lines]
> > > > >
> > > > > C:\Program

Files\j2sdk_nb\j2sdk1.4.2\bin\java -Xdebug -Xnoagent -Xrunjdwp:transport=dt_

socket,address=A10944:1427,suspend=y -Djava.compiler=NONE -classpath
> > > > > "<classpath>" <package>.<class>
> > > > >
[quoted text clipped - 283 lines]
> > > > > > >>>
> > > > > > >>>Peter
rahible - 31 Aug 2004 19:17 GMT
I just ran into this same problem with Netbeans 3.6  I did find out the
cause in my perticular situation.  

Previously, the debugger worked after the initial install of Netbeans 3.6.
Later, I had installed jdk1.4 onto my machine (Win2k) and placed it in
the path for another application (NES 4).  

The netbeans was using the jdk1.5.  When I removed jdk1.4 from the
system's path variable, and restarted Netbeans, the debugger automatically
started working again.

I hope this helps others too since I couldn't find anything in the news
groups.
muhammad - 06 Sep 2004 16:20 GMT
I have the very same problem with Redhat 9.0 and IntelliJIdea. I tried
disabling my firewall with no luck.

--Muhammad

> I just ran into this same problem with Netbeans 3.6  I did find out the
> cause in my perticular situation.  
[quoted text clipped - 9 lines]
> I hope this helps others too since I couldn't find anything in the news
> groups.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.