Netbeans 6.1 Debugger stopped working with error com.sun.jdi.InternalException: Unexpected JDWP Error: 502 - exception

I have been using Netbeans 6.1 for a long time and my debugger has always been flawless. Somehow recently (within the last two weeks or so) my debugger stops at breakpoints but it either freezes most of the time or i can't find out the value of any variable, my local variables wont expand and my watches will sometimes show all nulls even for this.hashCode() or not even update at all and freeze.
When this happens i see the following netbeans exceptions
com.sun.jdi.InternalException: Unexpected JDWP Error: 502
at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:379)
at org.netbeans.modules.debugger.jpda.expr.TreeEvaluator.invokeVirtual(TreeEvaluator.java:164)
at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:844)
at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.invokeMethod(AbstractObjectVariable.java:417)
at org.netbeans.modules.debugger.jpda.ui.models.JavaVariablesFilter.getChildren(JavaVariablesFilter.java:133)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesTreeModelFilter.getChildren(VariablesTreeModelFilter.java:193)
at org.netbeans.spi.viewmodel.Models$CompoundTreeModel.getChildren(Models.java:628)
at org.netbeans.spi.viewmodel.Models$CompoundModel.getChildren(Models.java:2819)
at org.netbeans.modules.viewmodel.TreeModelNode$TreeModelChildren.evaluateLazily(TreeModelNode.java:701)
at org.netbeans.modules.viewmodel.TreeModelNode$LazyEvaluator.run(TreeModelNode.java:1124)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
com.sun.jdi.InternalException: Unexpected JDWP Error: 502
at com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:47)
at com.sun.tools.jdi.ObjectReferenceImpl.invokeMethod(ObjectReferenceImpl.java:379)
at org.netbeans.modules.debugger.jpda.expr.TreeEvaluator.invokeVirtual(TreeEvaluator.java:164)
at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.invokeMethod(JPDADebuggerImpl.java:844)
at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:315)
at org.netbeans.modules.debugger.jpda.models.AbstractObjectVariable.getToStringValue(AbstractObjectVariable.java:285)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel.getLimitedToString(VariablesNodeModel.java:316)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel.getShortDescriptionSynch(VariablesNodeModel.java:275)
at org.netbeans.modules.debugger.jpda.ui.models.VariablesNodeModel$1.run(VariablesNodeModel.java:233)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
Does anybody know how to fix or workaround this problem? I have googled this exception but can't find anything of value. The only thing i found is about running two different JVMs, one to debug and one to run the application (but this is not the case for me, both JVMs are the exact same version "1.4.2_03"). I am running into this issue at work so upgrading Java or my IDE is not an option, though it this was fixed in a newer version of the IDE i would still like to know that but most importantly I really need a fix or workaround for this. I have also not changed any settings in my project or NetBeans that i am aware of from the time my debugger was working to now.
Thanks
Append: I also got the following message
A com.sun.jdi.InternalException exception has occurred.
Please report this at http://www.netbeans.org/community/issues.html,
including a copy of your messages.log file as an attachment.
The messages.log file is located in your C:\Documents and Settings\default.netbeans\6.1\var\log folder.
And i have a copy of messages.log if anyone wants me to post it.
I also tried debugging with a different project that i haven't used in a while and it still failed in the same way.
I could really use some help on this one.

It's probably issue # 136461. If the software update(s) for 6.1 do not fix it, then you're probably out of luck. NB 6.1 is over 2 years old at this point.
I understand the desire to keep all developers on the same IDE release. A change to a .form file or a nbproject file can spoil an unwary developer's day.
However, can you install a personal copy of 6.9 and just use it for debugging? Keep the 6.1 around to verify everything before committing.

Related

Build Failed before adding code. How is this possible?

I don't understand why I am getting a "run build" and "build failed" error when I have not added or deleted any code.
I tried the "invalidate cache/restart" as well as "rebuild project" but the error still occurs.
The first is below:
Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
androidx.test.espresso:espresso-core:3.2.0.9
The second error is
Unable to resolve dependency for
':app#debugAndroidTest/compileClasspath': Could not resolve
androidx.test:monitor:1.2.0
.
These errors are occurring in the initial build as I am attempting to do my 1st class assignment. My accountability partner and I attempted to figure it out but he has a Mac (Maybe that's why he couldn't reproduce the errors) I cleared the cache, restarted the build several times. Updated Gradle. Doubled checked settings. etc.
I am at a loss for a resolution.
The problem was traced back to my machine not having enough RAM.
Meh, I'm a coding newbie this is all apart of the learning process as well as changing career fields.

PHPStorm - show all errors on inspection

PHPStorm newbie question.
I'd installed PHPStorm yesterday and was very impressed. It identified countless small issues with my code, like referencing non-static classes statically - I loved that it highlighted the problems in my open PHP files. There was a bit long list in the "inspection results" section (I think) which identified errors in various groupings. Great!
Today I can't get it to identify any errors at all, other than "Typos". Same project.
Clearly I messed up a a configuration somewhere, but I'm pretty baffled as to where. I've been through the Preferences section for the last hour trying different things, but can't get it to work as before.
Any tips...?
Ben
Editor not doing proper code highlighting or not working inspections can be caused by the corrupted caches.
The solution is to do File | Invalidate Caches and restart the IDE.
Invalidating caches didn't worked for me.
In my case inspections were disabled because I had activated a wrong profile that wasn't checking PHP issues.
So be sure to check the used profile:

Flex 3 Referencing old files, will not compile updates to code

I am making some changes to a Flex 3 project and have run into trouble. I am using Flex Builder 3, working on a PC. Everything was working as expected throughout my first day of code updates, but on day 2 Flex started behaving badly.
The problem started when I removed a component, and then got an error that it couldn't find the specified component in some accompanying AS3 code. No problem, I updated the reference so it wouldn't look for the old missing component (a form item). When I compiled the project in debugger to check my work, it failed when it got to that part, and gave an error that it couldn't find the component I'd removed. However, my code had fixed the problem, and the error was referencing a line of code that wasn't there any more. I proceeded to change the file around greatly, and even resorted to creating a new file, changing the name of it, and then recompiling it. I did a clean compile as well, rebooted my machine, restarted Flex, but every time it gives an error referencing the bit of code that isn't even there any more. It's as if it's loading a cached project each time (both in debugger and run mode).
For reference, here's the error I'm getting:
ReferenceError: Error #1069: Property Winter Cost not found on views.PopupUsage and there is no default value.
Well, the file "PopupUsage.mxml" doesn't even exist any more and is not referenced in my project at all, but it's still being referenced by Flex when I compile the files. Any ideas? What can I do to make Flex move on and look at my code?
Thanks in advance!
The only time I have encountered this issue is when I've been developing an application that uses another SWC in the project build path. Where I've come undone is not referencing the SWC project in the project properties build path, but only referencing the SWC itself. If you have the SWC project code imported and you're editing it, then you can see this type of behaviour, appearing as though there's a mysterious cached version of your app, where in fact its simply the build path that isn't quite right.
So check your project properties build path for this issue, it sounds obvious, but I've lost count of the amount of times I've quickly imported the code for a library and forgotten to reference it properly in the application I'm using it in!

MySQL Connector/NET - support for transactions under Mono

Does anyone know how to get MySQL transactions working under Mono?
I'm using MySQL Connector/NET (via Subsonic 3) and it works perfectly under Microsoft .NET. Recently however I tried running the same site under Mono on Ubuntu and it almost works - except I can't seem to get transactions working.
Reading around the Mono/MySQL sites it's not exactly clear what is and isn't supported.
The original problem is a NotImplementedExcetion with call stack like this:
[System.NotImplementedException]: The requested feature is not implemented.
at MySql.Data.MySqlClient.MySqlConnection.EnlistTransaction (System.Transactions.Transaction) <0x00181>
at MySql.Data.MySqlClient.MySqlConnection.Open () <0x00381>
at SubSonic.DataProviders.DbDataProvider.CreateConnection (string) <0x00059>
at SubSonic.DataProviders.DbDataProvider.CreateConnection () <0x00015>
There's a few mentions of this on the MySQL site which seem to point to Mono not supporting the required infrastructure to make transactions work. There's also a comment that transactions work fine when using CommittableTransaction rather than TransactionScope. So I tried that, but got the same exception.
Another comment on the MySQL site suggested rebuilding the MySQL data provider with the MONO build option. Which I tried and the site now works, but transactions aren't being used - they've been simply disabled. Really?
I find it hard to believe that transactions can't be made to work in this environment, but can't find a working example.
Mono 2.6.7, MySQL Connection/NET 6.3.4, Subsonic 3, Ubuntu 10.10
Figured it out. It's TransactionScope that doesn't seem to work. Reverting back to DbConnection.BeginTransaction works fine. I've written up how to do it under Subsonic here: http://www.toptensoftware.com/blog/posts/18/using-transactions-with-mono-mysql-and-subsonic
I also had this problem with mono v.2.10.9 and mysqlconnector v. 6.6.5 and 6.7.2-Beta and I was unable to find a solution for this problem but now I figured it out.
First I took the sources of mysqlconnector and added them into my project folder. Thought it would work if I compile the connector directly with mono but it doesn't.
Then I stepped trough the code and I found that there are the following lines of code at line 530 in the file Connection.cs of the MySql.Data project:
#if !MONO && !CF && !RT
Console.WriteLine("### Should not be here... ###");
if (Transaction.Current != null && Settings.AutoEnlist)
EnlistTransaction(Transaction.Current);
#endif
The Console.WriteLine was added by me to try if it will also appear if I run my Application with mono and it appeared. So I commented this lines out and after that everything was working at this moment.
The real solution however should not be to comment out some lines of code.
For solving this you have to define the 'MONO' symbol.
If you are using MonoDevelop just right click on the project MySql.Data and select the compiler section. There you will find a textbox with the label 'define symbols' or something similar. Simply add the new symbol 'MONO' into this textbox.

Catching the dreaded Blue Screen Of Death

It's a simple problem. Sometimes Windows will just halt everything and throws a BSOD. Game over, please reboot to play another game. Or whatever. Annoying but not extremely serious...
What I want is simple. I want to catch the BSOD when it occurs. Why? Just for some additional crash logging. It's okay that the system goes blue but when it happens, I just want to log some additional information or perform one additional action.
Is this even possible? If so, how? And what would be the limitations?
Btw, I don't want to do anything when the system recovers, I want to catch it while it happens. This to allow me one final action. (For example, flushing a file before the system goes down.)
BSOD happens due to an error in the Windows kernel or more commonly in a faulty device driver (that runs in kernel mode). There is very little you can do about it. If it is a driver problem, you can hope the vendor will fix it.
You can configure Windows to a create memory dump upon BSOD which will help you troubleshoot the problem. You can get a pretty good idea about the faulting driver by loading the dump into WinDbg and using the !analyze command.
Knowing which driver is causing the problem will let you look for a new driver, but if that doesn't fix the problem, there is little you can do about it (unless you're very good with a hex editor).
UPDATE: If you want to debug this while it is happening, you need to debug the kernel. A good place to pick up more info is the book Windows Internals by Mark Russinovich. Also, I believe there's a bit of info in the help file for WinDbg and there must be something in the device driver kit as well (but that is beyond my knowledge).
The data is stored in what's called "Minidumps".
You can then use debugging tools to explore those dumps. The process is documented here http://forums.majorgeeks.com/showthread.php?t=35246
You have two ways to figure out what happened:
The first is to upload the dmp file located under C:\Minidump***.dmp to microsoft service as they describe it : http://answers.microsoft.com/en-us/windows/wiki/windows_10-update/blue-screen-of-death-bsod/1939df35-283f-4830-a4dd-e95ee5d8669d
or use their software debugger WinDbg to read the dmp file
NB: You will find several files, you can tell the difference using the name that contain the event date.
The second way is to note the error code from the blue screen and to make a search about it in Google and Microsoft website.
The first method is more accurate and efficient.
Windows can be configured to create a crash dump on blue screens.
Here's more information:
How to read the small memory dump files that Windows creates for debugging (support.microsoft.com)